Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
BDT.h
Go to the documentation of this file.
1#ifndef BDT__HH
2#define BDT__HH
3
4#include <vector>
5
6#include "tmvaglob.h"
7
8#include "RQ_OBJECT.h"
9
10#include "TStyle.h"
11#include "TPad.h"
12#include "TCanvas.h"
13#include "TColor.h"
14#include "TPaveText.h"
15#include "TControlBar.h"
16
17#include "TGWindow.h"
18#include "TGButton.h"
19#include "TGLabel.h"
20#include "TGNumberEntry.h"
21
22#include "TMVA/DecisionTree.h"
23#include "TMVA/Tools.h"
24#include "TXMLEngine.h"
25
26// Uncomment this only if the link problem is solved. The include statement tends
27// to use the ROOT classes rather than the local TMVA release
28// #include "TMVA/DecisionTree.h"
29// #include "TMVA/DecisionTreeNode.h"
30namespace TMVA{
31
32 // this macro displays a decision tree read in from the weight file
33
34
35 inline Int_t getSigColorF () {return TColor::GetColor( "#0000FF" );} // Pure Signal
36 inline Int_t getBkgColorF () {return TColor::GetColor( "#FF0000" );} // Pure Backgr.
37 inline Int_t getIntColorF () {return TColor::GetColor( "#33aa77" );} // novel green
38
39
40 inline Int_t getSigColorT () {return 10;}
41 inline Int_t getBkgColorT () {return 10;}
42 inline Int_t getIntColorT () {return 10;}
43
44
45
47
48 RQ_OBJECT("StatDialogBDT")
49
50 public:
51
52 StatDialogBDT(TString dataset, const TGWindow* p, TString wfile,
53 TString methName = "BDT", Int_t itree = 0 );
54 virtual ~StatDialogBDT() {
56 fThis = 0;
58 fMain->Cleanup();
59 if(gROOT->GetListOfCanvases()->FindObject(fCanvas))
60 delete fCanvas;
61 }
62
63 // draw method
64 void DrawTree(Int_t itree );
65
66 void RaiseDialog() { if (fMain) { fMain->RaiseWindow(); fMain->Layout(); fMain->MapWindow(); } }
67
68 private:
69
74
75
77
81
82 void UpdateCanvases();
83
84 // draw methods
85 TMVA::DecisionTree* ReadTree( TString * &vars, Int_t itree );
87 Double_t x, Double_t y, Double_t xscale, Double_t yscale, TString* vars );
88 void GetNtrees();
89
94
95 public:
96
97 // static function for external deletion
98 static void Delete() { if (fThis != 0) { delete fThis; fThis = 0; } }
99
100 // slots
101 void SetItree(); //*SIGNAL*
102 void Redraw(); //*SIGNAL*
103 void Close(); //*SIGNAL*
104
105 private:
106
108
109 };
110 // ========================================================================================
111
112 extern std::vector<TControlBar*> BDT_Global__cbar;
113
114 // intermediate GUI
115 void BDT(TString dataset, const TString& fin = "TMVA.root" );
116 void BDT_DeleteTBar(int i);
117 void BDT(TString dataset, Int_t itree, TString wfile , TString methName = "BDT", Bool_t useTMVAStyle = kTRUE ) ;
118
119}
120#endif
#define RQ_OBJECT(sender_class)
Definition RQ_OBJECT.h:87
bool Bool_t
Definition RtypesCore.h:63
double Double_t
Definition RtypesCore.h:59
const Bool_t kTRUE
Definition RtypesCore.h:100
#define gROOT
Definition TROOT.h:404
The Canvas class.
Definition TCanvas.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:1822
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:967
virtual void Layout()
Layout the elements of the composite frame.
Definition TGFrame.cxx:1257
virtual void MapWindow()
map window
Definition TGFrame.h:204
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:386
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:398
virtual void CloseWindow()
Close and delete main frame.
Definition TGFrame.cxx:1770
TGNumberEntry is a number entry input widget with up/down buttons.
Yield an action as soon as it is clicked.
Definition TGButton.h:142
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual void RaiseWindow()
raise window
Definition TGWindow.cxx:208
static void SetIsTraining(bool on)
Implementation of a Decision Tree.
void RaiseDialog()
Definition BDT.h:66
TString fMethName
Definition BDT.h:91
TString fWfile
Definition BDT.h:90
TGTextButton * fDrawButton
Definition BDT.h:79
TGMainFrame * fMain
Definition BDT.h:70
static void Delete()
Definition BDT.h:98
TMVA::DecisionTree * ReadTree(TString *&vars, Int_t itree)
Definition BDT.cxx:207
TCanvas * fCanvas
Definition BDT.h:73
void DrawTree(Int_t itree)
Definition BDT.cxx:292
void SetItree()
Definition BDT.cxx:29
TGHorizontalFrame * fButtons
Definition BDT.h:78
Int_t fColorOffset
Definition BDT.h:93
TGNumberEntry * fInput
Definition BDT.h:76
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:158
Int_t fNtrees
Definition BDT.h:72
TString fDataset
Definition BDT.h:92
virtual ~StatDialogBDT()
Definition BDT.h:54
static StatDialogBDT * fThis
Definition BDT.h:107
TGTextButton * fCloseButton
Definition BDT.h:80
void UpdateCanvases()
Definition BDT.cxx:103
std::vector< TControlBar * > BDT_Global__cbar
Definition BDT.h:112
Basic string class.
Definition TString.h:136
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:40
Int_t getIntColorT()
Definition BDT.h:42
Int_t getIntColorF()
Definition BDT.h:37
void BDT_DeleteTBar(int i)
Int_t getSigColorF()
Definition BDT.h:35
void BDT(TString dataset, const TString &fin="TMVA.root")
Int_t getBkgColorT()
Definition BDT.h:41
Int_t getBkgColorF()
Definition BDT.h:36