1 | #ifndef MARS_MRFEnergyEst
|
---|
2 | #define MARS_MRFEnergyEst
|
---|
3 |
|
---|
4 | #ifndef MARS_MTask
|
---|
5 | #include "MTask.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef ROOT_TObjArray
|
---|
9 | #include <TObjArray.h>
|
---|
10 | #endif
|
---|
11 | #ifndef ROOT_TArrayD
|
---|
12 | #include <TArrayD.h>
|
---|
13 | #endif
|
---|
14 |
|
---|
15 | class MHMatrix;
|
---|
16 | class MDataArray;
|
---|
17 | class MParameterD;
|
---|
18 |
|
---|
19 | class MRFEnergyEst : public MTask
|
---|
20 | {
|
---|
21 | public:
|
---|
22 | enum EstimationMode_t
|
---|
23 | {
|
---|
24 | kMean,
|
---|
25 | kMaximum,
|
---|
26 | kFit
|
---|
27 | };
|
---|
28 | private:
|
---|
29 | Bool_t fDebug; // Debugging of eventloop while training on/off
|
---|
30 |
|
---|
31 | TString fFileName; // File name to forest
|
---|
32 | TObjArray fEForests; // List of forests
|
---|
33 |
|
---|
34 | MDataArray *fData; //! Used to store the MDataChains to get the event values
|
---|
35 | MParameterD *fEnergyEst; //! Used to storeestimated energy
|
---|
36 |
|
---|
37 | Int_t fNumTrees; //! Training parameters
|
---|
38 | Int_t fNumTry; //! Training parameters
|
---|
39 | Int_t fNdSize; //! Training parameters
|
---|
40 |
|
---|
41 | MHMatrix *fTestMatrix; //! Test Matrix
|
---|
42 |
|
---|
43 | EstimationMode_t fEstimationMode;
|
---|
44 |
|
---|
45 | // MRFEnergyEst
|
---|
46 | Int_t ReadForests(MParList &plist);
|
---|
47 |
|
---|
48 | // MTask
|
---|
49 | Int_t PreProcess(MParList *plist);
|
---|
50 | Int_t Process();
|
---|
51 |
|
---|
52 | // MParContainer
|
---|
53 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
54 |
|
---|
55 | public:
|
---|
56 | MRFEnergyEst(const char *name=NULL, const char *title=NULL);
|
---|
57 | ~MRFEnergyEst();
|
---|
58 |
|
---|
59 | // Setter for estimation
|
---|
60 | void SetFileName(TString str) { fFileName = str; }
|
---|
61 | void SetEstimationMode(EstimationMode_t op) { fEstimationMode = op; }
|
---|
62 |
|
---|
63 | // Setter for training
|
---|
64 | void SetNumTrees(Int_t n=-1) { fNumTrees = n; }
|
---|
65 | void SetNdSize(Int_t n=-1) { fNdSize = n; }
|
---|
66 | void SetNumTry(Int_t n=-1) { fNumTry = n; }
|
---|
67 | void SetDebug(Bool_t b=kTRUE) { fDebug = b; }
|
---|
68 |
|
---|
69 | // Train Interface
|
---|
70 | Int_t Train(const MHMatrix &n, const TArrayD &grid);
|
---|
71 |
|
---|
72 | // Test Interface
|
---|
73 | void SetTestMatrix(MHMatrix *m=0) { fTestMatrix=m; }
|
---|
74 | void InitMapping(MHMatrix *m=0) { fTestMatrix=m; }
|
---|
75 |
|
---|
76 | ClassDef(MRFEnergyEst, 0) // Task
|
---|
77 | };
|
---|
78 |
|
---|
79 | #endif
|
---|