ROOT  6.06/09
Reference Guide
BDT_Reg.h
Go to the documentation of this file.
1 #ifndef BDT_Reg__HH
2 #define BDT_Reg__HH
3 #include <iostream>
4 #include <iomanip>
5 #include <fstream>
6 
7 #include "TMVA/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 "TObjString.h"
20 #include "TControlBar.h"
21 
22 #include "TGWindow.h"
23 #include "TGButton.h"
24 #include "TGLabel.h"
25 #include "TGNumberEntry.h"
26 
27 #include "TMVA/DecisionTree.h"
28 #include "TMVA/Tools.h"
29 #include "TXMLEngine.h"
30 #include "TMVA/BDT.h"
31 // Uncomment this only if the link problem is solved. The include statement tends
32 // to use the ROOT classes rather than the local TMVA release
33 // #include "TMVA/DecisionTree.h"
34 // #include "TMVA/DecisionTreeNode.h"
35 
36 namespace TMVA{
37 
38 
39 
41 
42  RQ_OBJECT("StatDialogBDTReg")
43 
44  public:
45 
46  StatDialogBDTReg( const TGWindow* p, TString wfile = "weights/TMVARegression_BDT.weights.xml",
47  TString methName = "BDT", Int_t itree = 0 );
48  virtual ~StatDialogBDTReg() {
50  fThis = 0;
51  fMain->CloseWindow();
52  fMain->Cleanup();
53  if(gROOT->GetListOfCanvases()->FindObject(fCanvas))
54  delete fCanvas;
55  }
56 
57  // draw method
58  void DrawTree( Int_t itree );
59 
60  void RaiseDialog() { if (fMain) { fMain->RaiseWindow(); fMain->Layout(); fMain->MapWindow(); } }
61 
62  private:
63 
68 
70 
74 
75  void UpdateCanvases();
76 
77  // draw methods
78  TMVA::DecisionTree* ReadTree( TString * &vars, Int_t itree );
80  Double_t x, Double_t y, Double_t xscale, Double_t yscale, TString* vars );
81  void GetNtrees();
82 
85 
86  public:
87 
88  // static function for external deletion
89  static void Delete() { if (fThis != 0) { delete fThis; fThis = 0; } }
90 
91  // slots
92  void SetItree(); //*SIGNAL*
93  void Redraw(); //*SIGNAL*
94  void Close(); //*SIGNAL*
95 
96  private:
97 
99 
100  };
101 
102  // ========================================================================================
103 
104  static std::vector<TControlBar*> BDTReg_Global__cbar;
105 
106  // intermediate GUI
107  void BDT_Reg( const TString& fin = "TMVAReg.root" );
108  void BDTReg_DeleteTBar(int i);
109 
110  void BDT_Reg( Int_t itree, TString wfile = "weights/TMVARegression_BDT.weights.xml", TString methName = "BDT", Bool_t useTMVAStyle = kTRUE );
111 
112 
113 }
114 #endif
TCanvas * fCanvas
Definition: BDT_Reg.h:67
StatDialogBDTReg(const TGWindow *p, TString wfile="weights/TMVARegression_BDT.weights.xml", TString methName="BDT", Int_t itree=0)
Definition: BDT_Reg.cxx:48
TGMainFrame * fMain
Definition: BDT_Reg.h:64
TGTextButton * fDrawButton
Definition: BDT_Reg.h:72
#define gROOT
Definition: TROOT.h:340
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1239
Double_t x[n]
Definition: legend1.C:17
TMVA::DecisionTree * ReadTree(TString *&vars, Int_t itree)
Definition: BDT_Reg.cxx:208
TGTextButton * fCloseButton
Definition: BDT_Reg.h:73
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_Reg.cxx:159
TGNumberEntry * fInput
Definition: BDT_Reg.h:69
virtual void CloseWindow()
Close and delete main frame.
Definition: TGFrame.cxx:1728
#define RQ_OBJECT(sender_class)
Definition: RQ_OBJECT.h:101
The Canvas class.
Definition: TCanvas.h:48
static void Delete()
Definition: BDT_Reg.h:89
double Double_t
Definition: RtypesCore.h:55
virtual ~StatDialogBDTReg()
Definition: BDT_Reg.h:48
virtual void RaiseWindow()
Definition: TGWindow.h:96
Double_t y[n]
Definition: legend1.C:17
static StatDialogBDTReg * fThis
Definition: BDT_Reg.h:98
TGHorizontalFrame * fButtons
Definition: BDT_Reg.h:71
Abstract ClassifierFactory template that handles arbitrary types.
virtual void MapWindow()
Definition: TGFrame.h:267
void DrawTree(Int_t itree)
Definition: BDT_Reg.cxx:289
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:949
const Bool_t kTRUE
Definition: Rtypes.h:91
const Int_t n
Definition: legend1.C:16
void BDTReg_DeleteTBar(int i)
Definition: BDT_Reg.cxx:432
void BDT_Reg(const TString &fin="TMVAReg.root")
Definition: BDT_Reg.cxx:363
static std::vector< TControlBar * > BDTReg_Global__cbar
Definition: BDT_Reg.h:104