source: trunk/MagicSoft/Mars/mtools/MTFillMatrix.h@ 7447

Last change on this file since 7447 was 7413, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 2.1 KB
Line 
1#ifndef MARS_MTFillMatrix
2#define MARS_MTFillMatrix
3
4#ifndef MARS_MParList
5#include "MParList.h"
6#endif
7
8#ifndef MARS_MH3
9#include "MH3.h"
10#endif
11
12class MRead;
13class MTask;
14class MHMatrix;
15class MFilter;
16
17class MTFillMatrix : public MParContainer
18{
19private:
20 MH3 *fReference;
21 MRead *fReader;
22
23 MHMatrix *fDestMatrix1;
24 MHMatrix *fDestMatrix2;
25
26 Int_t fNumDestEvents1;
27 Int_t fNumDestEvents2;
28
29 MTask *fWriteFile1;
30 MTask *fWriteFile2;
31
32 TList fPreCuts;
33
34 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
35
36 Bool_t CheckResult(MHMatrix *m, Int_t num) const;
37 Bool_t WriteMatrix(MHMatrix *m, const TString &fname, Int_t i) const;
38
39public:
40 MTFillMatrix(const MH3 *ref=NULL);
41 ~MTFillMatrix();
42
43 void SetDestMatrix1(MHMatrix *matrix, UInt_t num=0)
44 {
45 fDestMatrix1 = matrix;
46 if (num>0)
47 fNumDestEvents1 = num;
48 }
49 void SetWriteFile1(MTask *write, UInt_t num=0)
50 {
51 fWriteFile1 = write;
52 if (num>0)
53 fNumDestEvents1 = num;
54 }
55 void SetNumDestEvents1(UInt_t num)
56 {
57 fNumDestEvents1 = num;
58 }
59 void SetDestMatrix2(MHMatrix *matrix, UInt_t num=0)
60 {
61 fDestMatrix2 = matrix;
62 if (num>0)
63 fNumDestEvents2 = num;
64 }
65 void SetWriteFile2(MTask *write, UInt_t num=0)
66 {
67 fWriteFile2 = write;
68 if (num>0)
69 fNumDestEvents2 = num;
70 }
71 void SetNumDestEvents2(UInt_t num)
72 {
73 fNumDestEvents2 = num;
74 }
75
76 void SetReader(MRead *task) { fReader = task; }
77
78 void AddPreCut(const char *rule);
79 void AddPreCut(MFilter *f);
80 void AddPreCuts(const TList &list);
81
82 Bool_t Process(const MParList &plist=MParList());
83 Bool_t WriteMatrix1(const TString &fname) const { return WriteMatrix(fDestMatrix1, fname, 1); }
84 Bool_t WriteMatrix2(const TString &fname) const { return WriteMatrix(fDestMatrix2, fname, 2); }
85 Bool_t WriteMatrices(const TString &fname) const;
86
87 ClassDef(MTFillMatrix, 0) // Tool to fill matrices (eg. trainings- and test-matrices)
88};
89
90#endif
Note: See TracBrowser for help on using the repository browser.