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

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