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

Last change on this file since 7685 was 7671, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 1.8 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, Double_t &num) const;
33 Double_t GetNumMC(MDataSet &set) const;
34 Bool_t AutoTrain(MDataSet &set, UInt_t &on, UInt_t &off);
35
36public:
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
Note: See TracBrowser for help on using the repository browser.