1 | #ifndef MARS_MJTrainSeparation
|
---|
2 | #define MARS_MJTrainSeparation
|
---|
3 |
|
---|
4 | #ifndef MARS_MJTrainRanForest
|
---|
5 | #include "MJTrainRanForest.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef MARS_MDataSet
|
---|
9 | #include "MDataSet.h"
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | class MH3;
|
---|
13 |
|
---|
14 | class MJTrainSeparation : public MJTrainRanForest
|
---|
15 | {
|
---|
16 | private:
|
---|
17 | MDataSet fDataSetTest;
|
---|
18 | MDataSet fDataSetTrain;
|
---|
19 |
|
---|
20 | UInt_t fNumTrainOn;
|
---|
21 | UInt_t fNumTrainOff;
|
---|
22 |
|
---|
23 | UInt_t fNumTestOn;
|
---|
24 | UInt_t fNumTestOff;
|
---|
25 |
|
---|
26 | Bool_t fAutoTrain;
|
---|
27 | Bool_t fUseRegression;
|
---|
28 |
|
---|
29 | void DisplayResult(MH3 &h31, MH3 &h32);
|
---|
30 |
|
---|
31 | Bool_t GetEventsProduced(MDataSet &set, Double_t &num, Double_t &min, Double_t &max) const;
|
---|
32 | Double_t GetDataRate(MDataSet &set) const;
|
---|
33 | Bool_t AutoTrain();
|
---|
34 |
|
---|
35 | public:
|
---|
36 | MJTrainSeparation() :
|
---|
37 | fNumTrainOn((UInt_t)-1), fNumTrainOff((UInt_t)-1),
|
---|
38 | fNumTestOn((UInt_t)-1), fNumTestOff((UInt_t)-1),
|
---|
39 | fAutoTrain(kFALSE), fUseRegression(kTRUE)
|
---|
40 | { }
|
---|
41 |
|
---|
42 | void SetDataSetTrain(const MDataSet &ds, UInt_t non=(UInt_t)-1, UInt_t noff=(UInt_t)-1)
|
---|
43 | {
|
---|
44 | ds.Copy(fDataSetTrain);
|
---|
45 |
|
---|
46 | fDataSetTrain.SetNumAnalysis(1);
|
---|
47 |
|
---|
48 | fNumTrainOn = non;
|
---|
49 | fNumTrainOff = noff;
|
---|
50 | }
|
---|
51 | void SetDataSetTest(const MDataSet &ds, UInt_t non=(UInt_t)-1, UInt_t noff=(UInt_t)-1)
|
---|
52 | {
|
---|
53 | ds.Copy(fDataSetTest);
|
---|
54 |
|
---|
55 | fDataSetTest.SetNumAnalysis(1);
|
---|
56 |
|
---|
57 | fNumTestOn = non;
|
---|
58 | fNumTestOff = noff;
|
---|
59 | }
|
---|
60 |
|
---|
61 | void EnableAutoTrain(Bool_t b=kTRUE) { fAutoTrain = b; }
|
---|
62 | void EnableRegression(Bool_t b=kTRUE) { fUseRegression = b; }
|
---|
63 | void EnableClassification(Bool_t b=kTRUE) { fUseRegression = !b; }
|
---|
64 |
|
---|
65 | Bool_t Train(const char *out);
|
---|
66 |
|
---|
67 | ClassDef(MJTrainSeparation, 0)//Class to train Random Forest gamma-/background-separation
|
---|
68 | };
|
---|
69 |
|
---|
70 | #endif
|
---|