Logo ROOT  
Reference Guide
BDT.h
Go to the documentation of this file.
1#ifndef BDT__HH
2#define BDT__HH
3#include <iostream>
4#include <iomanip>
5#include <fstream>
6
7#include "tmvaglob.h"
8
9#include "RQ_OBJECT.h"
10
11#include "TROOT.h"
12#include "TStyle.h"
13#include "TPad.h"
14#include "TCanvas.h"
15#include "TLine.h"
16#include "TFile.h"
17#include "TColor.h"
18#include "TPaveText.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// Uncomment this only if the link problem is solved. The include statement tends
31// to use the ROOT classes rather than the local TMVA release
32// #include "TMVA/DecisionTree.h"
33// #include "TMVA/DecisionTreeNode.h"
34namespace TMVA{
35
36 // this macro displays a decision tree read in from the weight file
37
38
39 inline Int_t getSigColorF () {return TColor::GetColor( "#0000FF" );} // Pure Signal
40 inline Int_t getBkgColorF () {return TColor::GetColor( "#FF0000" );} // Pure Backgr.
41 inline Int_t getIntColorF () {return TColor::GetColor( "#33aa77" );} // novel green
42
43
44 inline Int_t getSigColorT () {return 10;}
45 inline Int_t getBkgColorT () {return 10;}
46 inline Int_t getIntColorT () {return 10;}
47
48
49
51
52 RQ_OBJECT("StatDialogBDT")
53
54 public:
55
56 StatDialogBDT(TString dataset, const TGWindow* p, TString wfile,
57 TString methName = "BDT", Int_t itree = 0 );
58 virtual ~StatDialogBDT() {
60 fThis = 0;
62 fMain->Cleanup();
63 if(gROOT->GetListOfCanvases()->FindObject(fCanvas))
64 delete fCanvas;
65 }
66
67 // draw method
68 void DrawTree(Int_t itree );
69
70 void RaiseDialog() { if (fMain) { fMain->RaiseWindow(); fMain->Layout(); fMain->MapWindow(); } }
71
72 private:
73
78
79
81
85
86 void UpdateCanvases();
87
88 // draw methods
89 TMVA::DecisionTree* ReadTree( TString * &vars, Int_t itree );
91 Double_t x, Double_t y, Double_t xscale, Double_t yscale, TString* vars );
92 void GetNtrees();
93
98
99 public:
100
101 // static function for external deletion
102 static void Delete() { if (fThis != 0) { delete fThis; fThis = 0; } }
103
104 // slots
105 void SetItree(); //*SIGNAL*
106 void Redraw(); //*SIGNAL*
107 void Close(); //*SIGNAL*
108
109 private:
110
112
113 };
114 // ========================================================================================
115
116 extern std::vector<TControlBar*> BDT_Global__cbar;
117
118 // intermediate GUI
119 void BDT(TString dataset, const TString& fin = "TMVA.root" );
120 void BDT_DeleteTBar(int i);
121 void BDT(TString dataset, Int_t itree, TString wfile , TString methName = "BDT", Bool_t useTMVAStyle = kTRUE ) ;
122
123}
124#endif
#define RQ_OBJECT(sender_class)
Definition: RQ_OBJECT.h:87
bool Bool_t
Definition: RtypesCore.h:61
double Double_t
Definition: RtypesCore.h:57
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define gROOT
Definition: TROOT.h:406
The Canvas class.
Definition: TCanvas.h:27
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:1769
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:951
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1241
virtual void MapWindow()
map window
Definition: TGFrame.h:229
virtual void CloseWindow()
Close and delete main frame.
Definition: TGFrame.cxx:1730
virtual void RaiseWindow()
raise window
Definition: TGWindow.cxx:198
Implementation of a Decision Tree.
Definition: DecisionTree.h:64
void Close()
Definition: BDT.cxx:45
void RaiseDialog()
Definition: BDT.h:70
TString fMethName
Definition: BDT.h:95
TString fWfile
Definition: BDT.h:94
TGTextButton * fDrawButton
Definition: BDT.h:83
Int_t fItree
Definition: BDT.h:75
TGMainFrame * fMain
Definition: BDT.h:74
static void Delete()
Definition: BDT.h:102
TMVA::DecisionTree * ReadTree(TString *&vars, Int_t itree)
Definition: BDT.cxx:213
TCanvas * fCanvas
Definition: BDT.h:77
void DrawTree(Int_t itree)
Definition: BDT.cxx:298
void GetNtrees()
Definition: BDT.cxx:114
void Redraw()
Definition: BDT.cxx:40
void SetItree()
Definition: BDT.cxx:35
TGHorizontalFrame * fButtons
Definition: BDT.h:82
StatDialogBDT(TString dataset, const TGWindow *p, TString wfile, TString methName="BDT", Int_t itree=0)
Definition: BDT.cxx:50
Int_t fColorOffset
Definition: BDT.h:97
TGNumberEntry * fInput
Definition: BDT.h:80
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:164
Int_t fNtrees
Definition: BDT.h:76
TString fDataset
Definition: BDT.h:96
virtual ~StatDialogBDT()
Definition: BDT.h:58
static StatDialogBDT * fThis
Definition: BDT.h:111
TGTextButton * fCloseButton
Definition: BDT.h:84
void UpdateCanvases()
Definition: BDT.cxx:109
Basic string class.
Definition: TString.h:131
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
create variable transformations
Int_t getSigColorT()
Definition: BDT.h:44
Int_t getIntColorT()
Definition: BDT.h:46
Int_t getIntColorF()
Definition: BDT.h:41
void BDT_DeleteTBar(int i)
Int_t getSigColorF()
Definition: BDT.h:39
void BDT(TString dataset, const TString &fin="TMVA.root")
Int_t getBkgColorT()
Definition: BDT.h:45
Int_t getBkgColorF()
Definition: BDT.h:40