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, Double_t &num) const;
|
---|
33 | Double_t GetNumMC(MDataSet &set) const;
|
---|
34 | Bool_t AutoTrain(MDataSet &set, UInt_t &on, UInt_t &off);
|
---|
35 |
|
---|
36 | public:
|
---|
37 | MJTrainSeparation() :
|
---|
38 | fNumTrainOn((UInt_t)-1), fNumTrainOff((UInt_t)-1),
|
---|
39 | fNumTestOn((UInt_t)-1), fNumTestOff((UInt_t)-1),
|
---|
40 | fAutoTrain(kFALSE), fUseRegression(kTRUE)
|
---|
41 | { }
|
---|
42 |
|
---|
43 | void SetDataSetTrain(const MDataSet &ds, UInt_t non=(UInt_t)-1, UInt_t noff=(UInt_t)-1)
|
---|
44 | {
|
---|
45 | ds.Copy(fDataSetTrain);
|
---|
46 |
|
---|
47 | fDataSetTrain.SetNumAnalysis(1);
|
---|
48 |
|
---|
49 | fNumTrainOn = non;
|
---|
50 | fNumTrainOff = noff;
|
---|
51 | }
|
---|
52 | void SetDataSetTest(const MDataSet &ds, UInt_t non=(UInt_t)-1, UInt_t noff=(UInt_t)-1)
|
---|
53 | {
|
---|
54 | ds.Copy(fDataSetTest);
|
---|
55 |
|
---|
56 | fDataSetTest.SetNumAnalysis(1);
|
---|
57 |
|
---|
58 | fNumTestOn = non;
|
---|
59 | fNumTestOff = noff;
|
---|
60 | }
|
---|
61 |
|
---|
62 | void EnableAutoTrain(Bool_t b=kTRUE) { fAutoTrain = b; }
|
---|
63 | void EnableRegression(Bool_t b=kTRUE) { fUseRegression = b; }
|
---|
64 | void EnableClassification(Bool_t b=kTRUE) { fUseRegression = !b; }
|
---|
65 |
|
---|
66 | Bool_t Train(const char *out);
|
---|
67 |
|
---|
68 | ClassDef(MJTrainSeparation, 0)//Class to train Random Forest gamma-/background-separation
|
---|
69 | };
|
---|
70 |
|
---|
71 | #endif
|
---|