24 #ifndef ROOT_TMVA_RuleCut
25 #define ROOT_TMVA_RuleCut
39 RuleCut(
const std::vector< const TMVA::Node * > & nodes );
42 RuleCut(
const RuleCut & other ) : fLogger(0) { Copy( other ); }
51 inline Bool_t EvalEvent(
const Event &eve );
54 Bool_t GetCutRange(Int_t sel,Double_t &rmin, Double_t &rmax, Bool_t &dormin, Bool_t &dormax)
const;
57 UInt_t GetNcuts()
const;
60 inline void SetNvars( UInt_t nc );
61 void SetNeve( Double_t n ) { fCutNeve = n; }
62 void SetPurity( Double_t ssb ) { fPurity = ssb; }
63 void SetSelector( Int_t i, UInt_t s ) { fSelector[i] = s; }
64 void SetCutMin( Int_t i, Double_t v ) { fCutMin[i] = v; }
65 void SetCutMax( Int_t i, Double_t v ) { fCutMax[i] = v; }
66 void SetCutDoMin( Int_t i, Bool_t v ) { fCutDoMin[i] = v; }
67 void SetCutDoMax( Int_t i, Bool_t v ) { fCutDoMax[i] = v; }
70 UInt_t GetNvars()
const {
return fSelector.size(); }
71 UInt_t GetSelector(Int_t is)
const {
return fSelector[is]; }
72 Double_t GetCutMin(Int_t is)
const {
return fCutMin[is]; }
73 Double_t GetCutMax(Int_t is)
const {
return fCutMax[is]; }
74 Char_t GetCutDoMin(Int_t is)
const {
return fCutDoMin[is]; }
75 Char_t GetCutDoMax(Int_t is)
const {
return fCutDoMax[is]; }
76 Double_t GetCutNeve()
const {
return fCutNeve; }
77 Double_t GetPurity()
const {
return fPurity; }
81 inline void Copy(
const RuleCut & other);
84 void MakeCuts(
const std::vector< const TMVA::Node * > & nodes );
86 std::vector<UInt_t> fSelector;
87 std::vector<Double_t> fCutMin;
88 std::vector<Double_t> fCutMax;
89 std::vector<Char_t> fCutDoMin;
90 std::vector<Char_t> fCutDoMax;
95 mutable MsgLogger* fLogger;
96 MsgLogger& Log()
const {
return *fLogger; }
101 inline void TMVA::RuleCut::Copy(
const TMVA::RuleCut & other )
104 if (&other !=
this) {
105 for (UInt_t ns=0; ns<other.GetNvars(); ns++) {
106 fSelector.push_back( other.GetSelector(ns) );
107 fCutMin.push_back( other.GetCutMin(ns) );
108 fCutMax.push_back( other.GetCutMax(ns) );
109 fCutDoMin.push_back( other.GetCutDoMin(ns) );
110 fCutDoMax.push_back( other.GetCutDoMax(ns) );
112 fCutNeve = other.GetCutNeve();
113 fPurity = other.GetPurity();
118 inline Bool_t TMVA::RuleCut::EvalEvent(
const Event &eve )
126 Bool_t minOK, cutOK=kFALSE;
130 val = eve.GetValue(sel);
131 minOK = (fCutDoMin[nc] ? (val>fCutMin[nc]):kTRUE);
132 cutOK = (minOK ? ((fCutDoMax[nc] ? (val<fCutMax[nc]):kTRUE)) : kFALSE);
134 done = ((!cutOK) || (nc==fSelector.size()));
141 inline void TMVA::RuleCut::SetNvars( UInt_t nc )
150 fSelector.resize(nc);
153 fCutDoMin.resize(nc);
154 fCutDoMax.resize(nc);