72 UInt_t nnodes = nodes.size();
74 Log() << kWARNING <<
"<MakeCuts()> Empty cut created." <<
Endl;
85 typedef std::pair<Double_t,Int_t> CutDir_t;
86 typedef std::pair<Int_t,CutDir_t> SelCut_t;
97 std::list<SelCut_t> allsel;
101 const Node *nextNode;
102 for (
UInt_t i=0; i<nnodes-1; i++) {
103 nextNode = nodes[i+1];
108 if (nodes[i]->GetRight() == nextNode) {
111 else if (nodes[i]->GetLeft() == nextNode) {
115 Log() << kFATAL <<
"<MakeTheRule> BUG! Should not be here - an end-node before the end!" <<
Endl;
118 allsel.push_back(SelCut_t(
sel,CutDir_t(val,dir)));
126 for ( std::list<SelCut_t>::const_iterator it = allsel.begin(); it!=allsel.end(); ++it ) {
128 val = (*it).second.first;
129 dir = (*it).second.second;
134 fSelector.push_back(
sel);
135 fCutMin.resize( fSelector.size(),0);
136 fCutMax.resize( fSelector.size(),0);
137 fCutDoMin.resize( fSelector.size(),
kFALSE);
138 fCutDoMax.resize( fSelector.size(),
kFALSE);
142 if ((val<fCutMin[nsel-1]) || firstMin) {
143 fCutMin[nsel-1] = val;
144 fCutDoMin[nsel-1] =
kTRUE;
149 if ((val>fCutMax[nsel-1]) || firstMax) {
150 fCutMax[nsel-1] = val;
151 fCutDoMax[nsel-1] =
kTRUE;
167 for (
UInt_t i=0; i<fSelector.size(); i++) {
168 if (fCutDoMin[i]) rval += 1;
169 if (fCutDoMax[i]) rval += 1;
184 foundIt = (
Int_t(fSelector[ind])==
sel);
186 done = (foundIt || (ind==fSelector.size()));
188 if (!foundIt)
return kFALSE;
189 rmin = fCutMin[ind-1];
190 rmax = fCutMax[ind-1];
191 dormin = fCutDoMin[ind-1];
192 dormax = fCutDoMax[ind-1];
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Short_t GetSelector() const
return index of variable used for discrimination at this node
Float_t GetCutValue(void) const
return the cut value applied at this node
Float_t GetNEvents(void) const
return the number of events that entered the node (during training), or -1 if traininfo undefined
Float_t GetPurity(void) const
return S/(S+B) (purity) at this node (from training)
ostringstream derivative to redirect and format output
Node for the BinarySearch or Decision Trees.
RuleCut()
empty constructor
virtual ~RuleCut()
destructor
UInt_t GetNcuts() const
get number of cuts
void MakeCuts(const std::vector< const TMVA::Node * > &nodes)
Construct the cuts from the given array of nodes.
Bool_t GetCutRange(Int_t sel, Double_t &rmin, Double_t &rmax, Bool_t &dormin, Bool_t &dormax) const
get cut range for a given selector
MsgLogger & Endl(MsgLogger &ml)