source: trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.h@ 7665

Last change on this file since 7665 was 7665, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 1.7 KB
Line 
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
12class MH3;
13
14class MJTrainSeparation : public MJTrainRanForest
15{
16private:
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
35public:
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
Note: See TracBrowser for help on using the repository browser.