Logo ROOT   6.14/05
Reference Guide
BDT.cxx
Go to the documentation of this file.
1 #include "TMVA/BDT.h"
2 #include <iostream>
3 #include <iomanip>
4 #include <fstream>
5 
6 
7 
8 #include "RQ_OBJECT.h"
9 
10 #include "TROOT.h"
11 #include "TStyle.h"
12 #include "TPad.h"
13 #include "TCanvas.h"
14 #include "TLine.h"
15 #include "TFile.h"
16 #include "TColor.h"
17 #include "TPaveText.h"
18 #include "TObjString.h"
19 #include "TControlBar.h"
20 
21 #include "TGWindow.h"
22 #include "TGButton.h"
23 #include "TGLabel.h"
24 #include "TGNumberEntry.h"
25 
26 #include "TMVA/DecisionTree.h"
27 #include "TMVA/Tools.h"
28 #include "TXMLEngine.h"
29 
30 std::vector<TControlBar*> TMVA::BDT_Global__cbar;
31 
33 
35 {
37 }
38 
40 {
42 }
43 
45 {
46  delete this;
47 }
48 
49 TMVA::StatDialogBDT::StatDialogBDT(TString dataset, const TGWindow* p, TString wfile, TString methName, Int_t itree )
50  : fMain( 0 ),
51  fItree(itree),
52  fNtrees(0),
53  fCanvas(0),
54  fInput(0),
55  fButtons(0),
56  fDrawButton(0),
57  fCloseButton(0),
58  fWfile( wfile ),
59  fMethName( methName ),
60  fDataset(dataset)
61 {
62  UInt_t totalWidth = 500;
63  UInt_t totalHeight = 200;
64 
65  fThis = this;
66 
68 
69  // read number of decision trees from weight file
70  GetNtrees();
71 
72  // main frame
73  fMain = new TGMainFrame(p, totalWidth, totalHeight, kMainFrame | kVerticalFrame);
74 
75  TGLabel *sigLab = new TGLabel( fMain, Form( "Decision tree [%i-%i]",0,fNtrees-1 ) );
76  fMain->AddFrame(sigLab, new TGLayoutHints(kLHintsLeft | kLHintsTop,5,5,5,5));
77 
80  fInput->Resize(100,24);
82 
83  fButtons = new TGHorizontalFrame(fMain, totalWidth,30);
84 
85  fCloseButton = new TGTextButton(fButtons,"&Close");
87 
88  fDrawButton = new TGTextButton(fButtons,"&Draw");
90 
92 
93  fMain->SetWindowName("Decision tree");
94  fMain->SetWMPosition(0,0);
97  fMain->MapWindow();
98 
99  fInput->Connect("ValueSet(Long_t)","TMVA::StatDialogBDT",this, "SetItree()");
100 
101  // doesn't seem to exist .. gives an 'error message' and seems to work just fine without ... :)
102  // fDrawButton->Connect("ValueSet(Long_t)","TGNumberEntry",fInput, "Clicked()");
103  fDrawButton->Connect("Clicked()", "TMVA::StatDialogBDT", this, "Redraw()");
104 
105  fCloseButton->Connect("Clicked()", "TMVA::StatDialogBDT", this, "Close()");
106 }
107 
109 {
110  DrawTree(fItree );
111 }
112 
114 {
115  if(!fWfile.EndsWith(".xml") ){
116  std::ifstream fin( fWfile );
117  if (!fin.good( )) { // file not found --> Error
118  cout << "*** ERROR: Weight file: " << fWfile << " does not exist" << endl;
119  return;
120  }
121 
122  TString dummy = "";
123 
124  // read total number of trees, and check whether requested tree is in range
125  Int_t nc = 0;
126  while (!dummy.Contains("NTrees")) {
127  fin >> dummy;
128  nc++;
129  if (nc > 200) {
130  cout << endl;
131  cout << "*** Huge problem: could not locate term \"NTrees\" in BDT weight file: "
132  << fWfile << endl;
133  cout << "==> panic abort (please contact the TMVA authors)" << endl;
134  cout << endl;
135  exit(1);
136  }
137  }
138  fin >> dummy;
139  fNtrees = dummy.ReplaceAll("\"","").Atoi();
140  fin.close();
141  }
142  else{
143  void* doc = TMVA::gTools().xmlengine().ParseFile(fWfile);
144  void* rootnode = TMVA::gTools().xmlengine().DocGetRootElement(doc);
145  void* ch = TMVA::gTools().xmlengine().GetChild(rootnode);
146  while(ch){
147  TString nodeName = TString( TMVA::gTools().xmlengine().GetNodeName(ch) );
148  if(nodeName=="Weights") {
149  TMVA::gTools().ReadAttr( ch, "NTrees", fNtrees );
150  break;
151  }
152  ch = TMVA::gTools().xmlengine().GetNext(ch);
153  }
154  }
155  cout << "--- Found " << fNtrees << " decision trees in weight file" << endl;
156 
157 }
158 
159 ////////////////////////////////////////////////////////////////////////////////
160 /// recursively puts an entries in the histogram for the node and its daughters
161 ///
162 
164  Double_t x, Double_t y,
165  Double_t xscale, Double_t yscale, TString * vars)
166 {
167  Float_t xsize=xscale*1.5;
168  Float_t ysize=yscale/3;
169  if (xsize>0.15) xsize=0.1; //xscale/2;
170  if (n->GetLeft() != NULL){
171  TLine *a1 = new TLine(x-xscale/4,y-ysize,x-xscale,y-ysize*2);
172  a1->SetLineWidth(2);
173  a1->Draw();
174  DrawNode((TMVA::DecisionTreeNode*) n->GetLeft(), x-xscale, y-yscale, xscale/2, yscale, vars);
175  }
176  if (n->GetRight() != NULL){
177  TLine *a1 = new TLine(x+xscale/4,y-ysize,x+xscale,y-ysize*2);
178  a1->SetLineWidth(2);
179  a1->Draw();
180  DrawNode((TMVA::DecisionTreeNode*) n->GetRight(), x+xscale, y-yscale, xscale/2, yscale, vars );
181  }
182 
183  // TPaveText *t = new TPaveText(x-xscale/2,y-yscale/2,x+xscale/2,y+yscale/2, "NDC");
184  TPaveText *t = new TPaveText(x-xsize,y-ysize,x+xsize,y+ysize, "NDC");
185 
186  t->SetBorderSize(1);
187 
188  t->SetFillStyle(1001);
189 
190 
191  Double_t pur=n->GetPurity();
192  t->SetFillColor(fColorOffset+Int_t(pur*100));
193 
194  char buffer[25];
195  sprintf( buffer, "N=%f", n->GetNEvents() );
196  if (n->GetNEvents()>0) t->AddText(buffer);
197  sprintf( buffer, "S/(S+B)=%4.3f", n->GetPurity() );
198  t->AddText(buffer);
199 
200  if (n->GetNodeType() == 0){
201  if (n->GetCutType()){
202  t->AddText(TString(vars[n->GetSelector()]+">"+=::Form("%5.3g",n->GetCutValue())));
203  }else{
204  t->AddText(TString(vars[n->GetSelector()]+"<"+=::Form("%5.3g",n->GetCutValue())));
205  }
206  }
207 
208  t->Draw();
209 
210  return;
211 }
213 {
214  cout << "--- Reading Tree " << itree << " from weight file: " << fWfile << endl;
216  if(!fWfile.EndsWith(".xml") ){
217  std::ifstream fin( fWfile );
218  if (!fin.good( )) { // file not found --> Error
219  cout << "*** ERROR: Weight file: " << fWfile << " does not exist" << endl;
220  delete d;
221  d = nullptr;
222  return 0;
223  }
224 
225  TString dummy = "";
226 
227  if (itree >= fNtrees) {
228  cout << "*** ERROR: requested decision tree: " << itree
229  << ", but number of trained trees only: " << fNtrees << endl;
230  delete d;
231  d = nullptr;
232  return 0;
233  }
234 
235  // file header with name
236  while (!dummy.Contains("#VAR")) fin >> dummy;
237  fin >> dummy >> dummy >> dummy; // the rest of header line
238 
239  // number of variables
240  Int_t nVars;
241  fin >> dummy >> nVars;
242 
243  // variable mins and maxes
244  vars = new TString[nVars+1]; // last one is if "fisher cut criterium"
245  for (Int_t i = 0; i < nVars; i++) fin >> vars[i] >> dummy >> dummy >> dummy >> dummy;
246  vars[nVars]="FisherCrit";
247 
248  char buffer[20];
249  char line[256];
250  sprintf(buffer,"Tree %d",itree);
251 
252  while (!dummy.Contains(buffer)) {
253  fin.getline(line,256);
254  dummy = TString(line);
255  }
256 
257  d->Read(fin);
258 
259  fin.close();
260  }
261  else{
262  if (itree >= fNtrees) {
263  cout << "*** ERROR: requested decision tree: " << itree
264  << ", but number of trained trees only: " << fNtrees << endl;
265  delete d;
266  d = nullptr;
267  return 0;
268  }
269  Int_t nVars;
270  void* doc = TMVA::gTools().xmlengine().ParseFile(fWfile);
271  void* rootnode = TMVA::gTools().xmlengine().DocGetRootElement(doc);
272  void* ch = TMVA::gTools().xmlengine().GetChild(rootnode);
273  while(ch){
274  TString nodeName = TString( TMVA::gTools().xmlengine().GetNodeName(ch) );
275  if(nodeName=="Variables"){
276  TMVA::gTools().ReadAttr( ch, "NVar", nVars);
277  vars = new TString[nVars+1];
278  void* varnode = TMVA::gTools().xmlengine().GetChild(ch);
279  for (Int_t i = 0; i < nVars; i++){
280  TMVA::gTools().ReadAttr( varnode, "Expression", vars[i]);
281  varnode = TMVA::gTools().xmlengine().GetNext(varnode);
282  }
283  vars[nVars]="FisherCrit";
284  }
285  if(nodeName=="Weights") break;
286  ch = TMVA::gTools().xmlengine().GetNext(ch);
287  }
288  ch = TMVA::gTools().xmlengine().GetChild(ch);
289  for (int i=0; i<itree; i++) ch = TMVA::gTools().xmlengine().GetNext(ch);
290  d->ReadXML(ch);
291  }
292  return d;
293 }
294 
295 ////////////////////////////////////////////////////////////////////////////////
296 
298 {
299  TString *vars;
300  TMVA::DecisionTree* d = ReadTree( vars, itree );
301  if (d == 0) return;
302 
303  UInt_t depth = d->GetTotalTreeDepth();
304  Double_t ystep = 1.0/(depth + 1.0);
305 
306  cout << "--- Tree depth: " << depth << endl;
307 
308  TStyle* TMVAStyle = gROOT->GetStyle("Plain"); // our style is based on Plain
309 
310 
311 
312  Double_t r[2] = {1., 0.};
313  Double_t g[2] = {0., 0.};
314  Double_t b[2] = {0., 1.};
315  Double_t stop[2] = {0., 1.0};
316  fColorOffset = TColor::CreateGradientColorTable(2, stop, r, g, b, 100);
317 
318  Int_t MyPalette[100];
319  for (int i=0;i<100;i++) MyPalette[i] = fColorOffset+i;
320  TMVAStyle->SetPalette(100, MyPalette);
321 
322 
323 
324  Int_t canvasColor = TMVAStyle->GetCanvasColor(); // backup
325 
326  TString cbuffer = Form( "Reading weight file: %s", fWfile.Data() );
327  TString tbuffer = Form( "Decision Tree no.: %d", itree );
328  if (!fCanvas) fCanvas = new TCanvas( "c1", cbuffer, 200, 0, 1000, 600 );
329  else fCanvas->Clear();
330  fCanvas->Draw();
331 
332  DrawNode( (TMVA::DecisionTreeNode*)d->GetRoot(), 0.5, 1.-0.5*ystep, 0.25, ystep ,vars);
333 
334  // make the legend
335  Double_t yup=0.99;
336  Double_t ydown=yup-ystep/2.5;
337  Double_t dy= ystep/2.5 * 0.2;
338 
339  TPaveText *whichTree = new TPaveText(0.85,ydown,0.98,yup, "NDC");
340  whichTree->SetBorderSize(1);
341  whichTree->SetFillStyle(1001);
342  whichTree->SetFillColor( TColor::GetColor( "#ffff33" ) );
343  whichTree->AddText( tbuffer );
344  whichTree->Draw();
345 
346  TPaveText *signalleaf = new TPaveText(0.02,ydown ,0.15,yup, "NDC");
347  signalleaf->SetBorderSize(1);
348  signalleaf->SetFillStyle(1001);
349  signalleaf->SetFillColor( getSigColorF() );
350  signalleaf->AddText("Pure Signal Nodes");
351  signalleaf->SetTextColor( getSigColorT() );
352  signalleaf->Draw();
353 
354  ydown = ydown - ystep/2.5 -dy;
355  yup = yup - ystep/2.5 -dy;
356  TPaveText *backgroundleaf = new TPaveText(0.02,ydown,0.15,yup, "NDC");
357  backgroundleaf->SetBorderSize(1);
358  backgroundleaf->SetFillStyle(1001);
359  backgroundleaf->SetFillColor( getBkgColorF() );
360 
361  backgroundleaf->AddText("Pure Backgr. Nodes");
362  backgroundleaf->SetTextColor( getBkgColorT() );
363  backgroundleaf->Draw();
364 
365 
366  fCanvas->Update();
367  TString fname = fDataset+Form("/plots/%s_%i", fMethName.Data(), itree );
368  cout << "--- Creating image: " << fname << endl;
369  TMVAGlob::imgconv( fCanvas, fname );
370 
371  TMVAStyle->SetCanvasColor( canvasColor );
372 }
373 
374 // ========================================================================================
375 
376 
377 // intermediate GUI
378 void TMVA::BDT(TString dataset, const TString& fin )
379 {
380  // --- read the available BDT weight files
381 
382  // destroy all open cavases
384 
385  // checks if file with name "fin" is already open, and if not opens one
386  TFile* file = TMVAGlob::OpenFile( fin );
387 
388  TDirectory* dir = file->GetDirectory(dataset.Data())->GetDirectory( "Method_BDT" );
389  if (!dir) {
390  cout << "*** Error in macro \"BDT.C\": cannot find directory \"Method_BDT\" in file: " << fin << endl;
391  return;
392  }
393 
394  // read all directories
395  TIter next( dir->GetListOfKeys() );
396  TKey *key(0);
397  std::vector<TString> methname;
398  std::vector<TString> path;
399  std::vector<TString> wfile;
400  while ((key = (TKey*)next())) {
401  TDirectory* mdir = dir->GetDirectory( key->GetName() );
402  if (!mdir) {
403  cout << "*** Error in macro \"BDT.C\": cannot find sub-directory: " << key->GetName()
404  << " in directory: " << dir->GetName() << endl;
405  return;
406  }
407 
408  // retrieve weight file name and path
409  TObjString* strPath = (TObjString*)mdir->Get( "TrainingPath" );
410  TObjString* strWFile = (TObjString*)mdir->Get( "WeightFileName" );
411  if (!strPath || !strWFile) {
412  cout << "*** Error in macro \"BDT.C\": could not find TObjStrings \"TrainingPath\" and/or \"WeightFileName\" *** " << endl;
413  cout << "*** Maybe you are using TMVA >= 3.8.15 with an older training target file ? *** " << endl;
414  return;
415  }
416 
417  methname.push_back( key->GetName() );
418  path .push_back( strPath->GetString() );
419  wfile .push_back( strWFile->GetString() );
420  }
421 
422  // create the control bar
423  TControlBar* cbar = new TControlBar( "vertical", "Choose weight file:", 50, 50 );
424  BDT_Global__cbar.push_back(cbar);
425 
426  for (UInt_t im=0; im<path.size(); im++) {
427  TString fname = path[im];
428  if (fname[fname.Length()-1] != '/') fname += "/";
429  fname += wfile[im];
430  TString macro = Form( "TMVA::BDT(\"%s\",0,\"%s\",\"%s\")",dataset.Data(), fname.Data(), methname[im].Data() );
431  cbar->AddButton( fname, macro, "Plot decision trees from this weight file", "button" );
432  }
433 
434  // *** problems with this button in ROOT 5.19 ***
435 #if ROOT_VERSION_CODE < ROOT_VERSION(5,19,0)
436  cbar->AddButton( "Close", Form("BDT_DeleteTBar(%i)", BDT_Global__cbar.size()-1), "Close this control bar", "button" );
437 #endif
438  // **********************************************
439 
440  // set the style
441  cbar->SetTextColor("blue");
442 
443  // draw
444  cbar->Show();
445 }
446 
447 void TMVA::BDT_DeleteTBar(int i)
448 {
449  // destroy all open canvases
452 
453  delete BDT_Global__cbar[i];
454  BDT_Global__cbar[i] = 0;
455 }
456 
457 // input: - No. of tree
458 // - the weight file from which the tree is read
459 void TMVA::BDT(TString dataset, Int_t itree, TString wfile , TString methName , Bool_t useTMVAStyle )
460 {
461  // destroy possibly existing dialog windows and/or canvases
464  if(wfile=="")
465  wfile = dataset+"/weights/TMVAnalysis_test_BDT.weights.txt";
466  // quick check if weight file exist
467  if(!wfile.EndsWith(".xml") ){
468  std::ifstream fin( wfile );
469  if (!fin.good( )) { // file not found --> Error
470  cout << "*** ERROR: Weight file: " << wfile << " does not exist" << endl;
471  return;
472  }
473  }
474  std::cout << "test1";
475  // set style and remove existing canvas'
476  TMVAGlob::Initialize( useTMVAStyle );
477 
478  StatDialogBDT* gGui = new StatDialogBDT(dataset, gClient->GetRoot(), wfile, methName, itree );
479 
480  gGui->DrawTree(itree );
481 
482  gGui->RaiseDialog();
483 }
484 
void Show()
Show control bar.
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TAttLine.h:43
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
void DrawTree(Int_t itree)
Definition: BDT.cxx:297
void AddButton(TControlBarButton *button)
Add button.
TGNumberEntry * fInput
Definition: BDT.h:81
TXMLEngine & xmlengine()
Definition: Tools.h:270
void imgconv(TCanvas *c, const TString &fname)
Definition: tmvaglob.cxx:212
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
Definition: TControlBar.h:22
Int_t getSigColorT()
Definition: BDT.h:45
virtual TList * GetListOfKeys() const
Definition: TDirectory.h:150
void SetTextColor(const char *colorName)
Sets text color for control bar buttons, e.g.
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
Definition: TPaveText.cxx:233
Float_t GetNEvents(void) const
TGMainFrame * fMain
Definition: BDT.h:75
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
Definition: TDirectory.cxx:805
TLine * line
Collectable string class.
Definition: TObjString.h:28
float Float_t
Definition: RtypesCore.h:53
void BDT(TString dataset, const TString &fin="TMVA.root")
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1746
#define g(i)
Definition: RSha256.hxx:105
virtual void Read(std::istream &istr, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
Read the binary tree from an input stream.
Definition: BinaryTree.cxx:169
Int_t getBkgColorT()
Definition: BDT.h:46
TFile * OpenFile(const TString &fin)
Definition: tmvaglob.cxx:192
Int_t fItree
Definition: BDT.h:76
void GetNtrees()
Definition: BDT.cxx:113
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:47
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
Definition: TPaveText.cxx:182
#define gROOT
Definition: TROOT.h:410
void Close()
Definition: BDT.cxx:44
XMLNodePointer_t GetNext(XMLNodePointer_t xmlnode, Bool_t realnode=kTRUE)
return next to xmlnode node if realnode==kTRUE, any special nodes in between will be skipped ...
Basic string class.
Definition: TString.h:131
#define gClient
Definition: TGClient.h:166
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition: TObject.cxx:195
virtual void SetLimits(ELimit limits=TGNumberFormat::kNELNoLimits, Double_t min=0, Double_t max=1)
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition: TAttFill.h:39
Bool_t GetCutType(void) const
virtual DecisionTreeNode * GetRoot() const
Definition: DecisionTree.h:93
Int_t fColorOffset
Definition: BDT.h:98
Int_t fNtrees
Definition: BDT.h:77
void SetCanvasColor(Color_t color=19)
Definition: TStyle.h:321
TMVA::DecisionTree * ReadTree(TString *&vars, Int_t itree)
Definition: BDT.cxx:212
Double_t x[n]
Definition: legend1.C:17
StatDialogBDT(TString dataset, const TGWindow *p, TString wfile, TString methName="BDT", Int_t itree=0)
Definition: BDT.cxx:49
Float_t GetCutValue(void) const
void RaiseDialog()
Definition: BDT.h:71
static void Delete()
Definition: BDT.h:103
TString fDataset
Definition: BDT.h:97
void Clear(Option_t *option="")
Remove all primitives from the canvas.
Definition: TCanvas.cxx:707
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2152
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition: TKey.h:24
TStyle objects may be created to define special styles.
Definition: TStyle.h:27
TGTextButton * fDrawButton
Definition: BDT.h:84
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
Definition: TQObject.cxx:867
const TString & GetString() const
Definition: TObjString.h:47
Int_t GetNodeType(void) const
ROOT::R::TRInterface & r
Definition: Object.C:4
void Initialize(Bool_t useTMVAStyle=kTRUE)
Definition: tmvaglob.cxx:176
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition: TAttFill.h:37
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:375
Implementation of a Decision Tree.
Definition: DecisionTree.h:64
unsigned int UInt_t
Definition: RtypesCore.h:42
char * Form(const char *fmt,...)
Ssiz_t Length() const
Definition: TString.h:405
A simple line.
Definition: TLine.h:23
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb"...
Definition: TColor.cxx:1758
void ReadAttr(void *node, const char *, T &value)
read attribute from xml
Definition: Tools.h:335
Tools & gTools()
virtual void ReadXML(void *node, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
read attributes from XML
Definition: BinaryTree.cxx:144
void Redraw()
Definition: BDT.cxx:39
virtual TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory named "apath".
TCanvas * fCanvas
Definition: BDT.h:78
Float_t GetPurity(void) const
The Canvas class.
Definition: TCanvas.h:31
#define d(i)
Definition: RSha256.hxx:102
XMLDocPointer_t ParseFile(const char *filename, Int_t maxbuf=100000)
Parses content of file and tries to produce xml structures.
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:21
TGHorizontalFrame * fButtons
Definition: BDT.h:83
static StatDialogBDT * fThis
Definition: BDT.h:112
double Double_t
Definition: RtypesCore.h:55
virtual Double_t GetNumber() const
Describe directory structure in memory.
Definition: TDirectory.h:34
static RooMathCoreReg dummy
Double_t y[n]
Definition: legend1.C:17
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:619
TGTextButton * fCloseButton
Definition: BDT.h:85
UInt_t GetTotalTreeDepth() const
Definition: BinaryTree.h:93
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
TString fWfile
Definition: BDT.h:95
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
virtual void Draw(Option_t *option="")
Draw a canvas.
Definition: TCanvas.cxx:826
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition: TGFrame.cxx:1837
XMLNodePointer_t GetChild(XMLNodePointer_t xmlnode, Bool_t realnode=kTRUE)
returns first child of xmlnode
Definition: file.py:1
Int_t getBkgColorF()
Definition: BDT.h:41
virtual void MapWindow()
Definition: TGFrame.h:251
XMLNodePointer_t DocGetRootElement(XMLDocPointer_t xmldoc)
returns root node of document
virtual TDirectory * GetDirectory(const char *namecycle, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory using apath.
Definition: TDirectory.cxx:400
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
void UpdateCanvases()
Definition: BDT.cxx:108
virtual DecisionTreeNode * GetLeft() const
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition: TAttText.h:43
virtual DecisionTreeNode * GetRight() const
Color_t GetCanvasColor() const
Definition: TStyle.h:176
TString fMethName
Definition: BDT.h:96
Short_t GetSelector() const
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2248
static Int_t CreateGradientColorTable(UInt_t Number, Double_t *Stops, Double_t *Red, Double_t *Green, Double_t *Blue, UInt_t NColors, Float_t alpha=1.)
Static function creating a color table with several connected linear gradients.
Definition: TColor.cxx:2209
void DestroyCanvases()
Definition: tmvaglob.cxx:166
const Int_t n
Definition: legend1.C:16
Int_t getSigColorF()
Definition: BDT.h:40
void SetPalette(Int_t ncolors=kBird, Int_t *colors=0, Float_t alpha=1.)
See TColor::SetPalette.
Definition: TStyle.cxx:1637
void DrawNode(TMVA::DecisionTreeNode *n, Double_t x, Double_t y, Double_t xscale, Double_t yscale, TString *vars)
recursively puts an entries in the histogram for the node and its daughters
Definition: BDT.cxx:163
void SetItree()
Definition: BDT.cxx:34
virtual void SetBorderSize(Int_t bordersize=4)
Definition: TPave.h:70
const char * Data() const
Definition: TString.h:364
void BDT_DeleteTBar(int i)