ROOT
6.07/09
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
tmva
tmvagui
inc
TMVA
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 "
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
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
namespace
TMVA
{
36
37
// this macro displays a decision tree read in from the weight file
38
39
40
inline
Int_t
getSigColorF
() {
return
TColor::GetColor
(
"#0000FF"
);}
// Pure Signal
41
inline
Int_t
getBkgColorF
() {
return
TColor::GetColor
(
"#FF0000"
);}
// Pure Backgr.
42
inline
Int_t
getIntColorF
() {
return
TColor::GetColor
(
"#33aa77"
);}
// novel green
43
44
45
inline
Int_t
getSigColorT
() {
return
10;}
46
inline
Int_t
getBkgColorT
() {
return
10;}
47
inline
Int_t
getIntColorT
() {
return
10;}
48
49
50
51
class
StatDialogBDT
{
52
53
RQ_OBJECT
(
"StatDialogBDT"
)
54
55
public
:
56
57
StatDialogBDT
(
TString
dataset,
const
TGWindow
* p,
TString
wfile,
58
TString
methName =
"BDT"
,
Int_t
itree = 0 );
59
virtual
~StatDialogBDT
() {
60
TMVA::DecisionTreeNode::fgIsTraining
=
false
;
61
fThis
= 0;
62
fMain
->
CloseWindow
();
63
fMain
->
Cleanup
();
64
if
(
gROOT
->GetListOfCanvases()->FindObject(
fCanvas
))
65
delete
fCanvas
;
66
}
67
68
// draw method
69
void
DrawTree
(
Int_t
itree );
70
71
void
RaiseDialog
() {
if
(
fMain
) {
fMain
->
RaiseWindow
();
fMain
->
Layout
();
fMain
->
MapWindow
(); } }
72
73
private
:
74
75
TGMainFrame
*
fMain
;
76
Int_t
fItree
;
77
Int_t
fNtrees
;
78
TCanvas
*
fCanvas
;
79
80
81
TGNumberEntry
*
fInput
;
82
83
TGHorizontalFrame
*
fButtons
;
84
TGTextButton
*
fDrawButton
;
85
TGTextButton
*
fCloseButton
;
86
87
void
UpdateCanvases
();
88
89
// draw methods
90
TMVA::DecisionTree
*
ReadTree
(
TString
* &vars,
Int_t
itree );
91
void
DrawNode
(
TMVA::DecisionTreeNode
*
n
,
92
Double_t
x
,
Double_t
y
,
Double_t
xscale,
Double_t
yscale,
TString
* vars );
93
void
GetNtrees
();
94
95
TString
fWfile
;
96
TString
fMethName
;
97
TString
fDataset
;
98
Int_t
fColorOffset
;
99
100
public
:
101
102
// static function for external deletion
103
static
void
Delete
() {
if
(
fThis
!= 0) {
delete
fThis
;
fThis
= 0; } }
104
105
// slots
106
void
SetItree
();
//*SIGNAL*
107
void
Redraw
();
//*SIGNAL*
108
void
Close
();
//*SIGNAL*
109
110
private
:
111
112
static
StatDialogBDT
*
fThis
;
113
114
};
115
// ========================================================================================
116
117
static
std::vector<TControlBar*>
BDT_Global__cbar
;
118
119
// intermediate GUI
120
void
BDT
(
TString
dataset,
const
TString
& fin =
"TMVA.root"
);
121
void
BDT_DeleteTBar
(
int
i);
122
void
BDT
(
TString
dataset,
Int_t
itree,
TString
wfile ,
TString
methName =
"BDT"
,
Bool_t
useTMVAStyle =
kTRUE
) ;
123
124
}
125
#endif
DecisionTree.h
TMVA::StatDialogBDT::DrawTree
void DrawTree(Int_t itree)
Definition:
BDT.cxx:291
TMVA::StatDialogBDT::fInput
TGNumberEntry * fInput
Definition:
BDT.h:81
RQ_OBJECT.h
TMVA::DecisionTreeNode::fgIsTraining
static bool fgIsTraining
Definition:
DecisionTreeNode.h:353
TMVA::getSigColorT
Int_t getSigColorT()
Definition:
BDT.h:45
TMVA::StatDialogBDT::fMain
TGMainFrame * fMain
Definition:
BDT.h:75
TGTextButton
Definition:
TGButton.h:146
TXMLEngine.h
TMVA::BDT
void BDT(TString dataset, const TString &fin="TMVA.root")
Definition:
BDT.cxx:372
TMVA::getBkgColorT
Int_t getBkgColorT()
Definition:
BDT.h:46
TMVA::StatDialogBDT::fItree
Int_t fItree
Definition:
BDT.h:76
TMVA::StatDialogBDT::GetNtrees
void GetNtrees()
Definition:
BDT.cxx:113
TGNumberEntry.h
gROOT
#define gROOT
Definition:
TROOT.h:364
TMVA::StatDialogBDT::Close
void Close()
Definition:
BDT.cxx:44
TFile.h
TString
Basic string class.
Definition:
TString.h:137
TGWindow.h
Int_t
int Int_t
Definition:
RtypesCore.h:41
Bool_t
bool Bool_t
Definition:
RtypesCore.h:59
TPaveText.h
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition:
TGFrame.cxx:1239
TMVA::StatDialogBDT::fColorOffset
Int_t fColorOffset
Definition:
BDT.h:98
TMVA::StatDialogBDT::fNtrees
Int_t fNtrees
Definition:
BDT.h:77
TMVA::StatDialogBDT::ReadTree
TMVA::DecisionTree * ReadTree(TString *&vars, Int_t itree)
Definition:
BDT.cxx:212
TMVA::getIntColorT
Int_t getIntColorT()
Definition:
BDT.h:47
x
Double_t x[n]
Definition:
legend1.C:17
TMVA::BDT_Global__cbar
static std::vector< TControlBar * > BDT_Global__cbar
Definition:
BDT.h:117
TMVA::StatDialogBDT
Definition:
BDT.h:51
TMVA::StatDialogBDT::StatDialogBDT
StatDialogBDT(TString dataset, const TGWindow *p, TString wfile, TString methName="BDT", Int_t itree=0)
Definition:
BDT.cxx:49
TControlBar.h
TMVA::StatDialogBDT::RaiseDialog
void RaiseDialog()
Definition:
BDT.h:71
TMVA::StatDialogBDT::Delete
static void Delete()
Definition:
BDT.h:103
TMVA::StatDialogBDT::fDataset
TString fDataset
Definition:
BDT.h:97
TGLabel.h
TCanvas.h
TGHorizontalFrame
Definition:
TGFrame.h:461
TGWindow
Definition:
TGWindow.h:38
TMVA::StatDialogBDT::fDrawButton
TGTextButton * fDrawButton
Definition:
BDT.h:84
TObjString.h
tmvaglob.h
TROOT.h
TGMainFrame::CloseWindow
virtual void CloseWindow()
Close and delete main frame.
Definition:
TGFrame.cxx:1728
TMVA::DecisionTree
Definition:
DecisionTree.h:73
TColor::GetColor
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:1706
TMVA::StatDialogBDT::Redraw
void Redraw()
Definition:
BDT.cxx:39
TMVA::StatDialogBDT::fCanvas
TCanvas * fCanvas
Definition:
BDT.h:78
RQ_OBJECT
#define RQ_OBJECT(sender_class)
Definition:
RQ_OBJECT.h:101
TCanvas
The Canvas class.
Definition:
TCanvas.h:41
TMVA::StatDialogBDT::fButtons
TGHorizontalFrame * fButtons
Definition:
BDT.h:83
TMVA::StatDialogBDT::fThis
static StatDialogBDT * fThis
Definition:
BDT.h:112
TStyle.h
TMVA::StatDialogBDT::~StatDialogBDT
virtual ~StatDialogBDT()
Definition:
BDT.h:59
Double_t
double Double_t
Definition:
RtypesCore.h:55
TGWindow::RaiseWindow
virtual void RaiseWindow()
Definition:
TGWindow.h:96
y
Double_t y[n]
Definition:
legend1.C:17
TMVA::StatDialogBDT::fCloseButton
TGTextButton * fCloseButton
Definition:
BDT.h:85
TMVA::getIntColorF
Int_t getIntColorF()
Definition:
BDT.h:42
TMVA::StatDialogBDT::fWfile
TString fWfile
Definition:
BDT.h:95
TGNumberEntry
Definition:
TGNumberEntry.h:162
TMVA
Abstract ClassifierFactory template that handles arbitrary types.
Definition:
GeneticMinimizer.h:21
Tools.h
TMVA::getBkgColorF
Int_t getBkgColorF()
Definition:
BDT.h:41
TGFrame::MapWindow
virtual void MapWindow()
Definition:
TGFrame.h:267
TColor.h
TMVA::StatDialogBDT::UpdateCanvases
void UpdateCanvases()
Definition:
BDT.cxx:108
TMVA::StatDialogBDT::fMethName
TString fMethName
Definition:
BDT.h:96
TPad.h
TLine.h
TGCompositeFrame::Cleanup
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition:
TGFrame.cxx:949
kTRUE
const Bool_t kTRUE
Definition:
Rtypes.h:91
TGButton.h
n
const Int_t n
Definition:
legend1.C:16
TGMainFrame
Definition:
TGFrame.h:482
TMVA::getSigColorF
Int_t getSigColorF()
Definition:
BDT.h:40
TMVA::DecisionTreeNode
Definition:
DecisionTreeNode.h:120
TMVA::StatDialogBDT::DrawNode
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
TMVA::StatDialogBDT::SetItree
void SetItree()
Definition:
BDT.cxx:34
TMVA::BDT_DeleteTBar
void BDT_DeleteTBar(int i)
Definition:
BDT.cxx:441