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