File indexing completed on 2025-01-18 10:10:57
0001 #ifndef BDT__HH
0002 #define BDT__HH
0003
0004 #include <vector>
0005
0006 #include "tmvaglob.h"
0007
0008 #include "RQ_OBJECT.h"
0009
0010 #include "TStyle.h"
0011 #include "TPad.h"
0012 #include "TCanvas.h"
0013 #include "TColor.h"
0014 #include "TPaveText.h"
0015 #include "TControlBar.h"
0016
0017 #include "TGWindow.h"
0018 #include "TGButton.h"
0019 #include "TGLabel.h"
0020 #include "TGNumberEntry.h"
0021
0022 #include "TMVA/DecisionTree.h"
0023 #include "TMVA/Tools.h"
0024 #include "TXMLEngine.h"
0025
0026
0027
0028
0029
0030 namespace TMVA{
0031
0032
0033
0034
0035 inline Int_t getSigColorF () {return TColor::GetColor( "#0000FF" );}
0036 inline Int_t getBkgColorF () {return TColor::GetColor( "#FF0000" );}
0037 inline Int_t getIntColorF () {return TColor::GetColor( "#33aa77" );}
0038
0039
0040 inline Int_t getSigColorT () {return 10;}
0041 inline Int_t getBkgColorT () {return 10;}
0042 inline Int_t getIntColorT () {return 10;}
0043
0044
0045
0046 class StatDialogBDT {
0047
0048 RQ_OBJECT("StatDialogBDT")
0049
0050 public:
0051
0052 StatDialogBDT(TString dataset, const TGWindow* p, TString wfile,
0053 TString methName = "BDT", Int_t itree = 0 );
0054 virtual ~StatDialogBDT() {
0055 TMVA::DecisionTreeNode::SetIsTraining(false);
0056 fThis = nullptr;
0057 fMain->CloseWindow();
0058 fMain->Cleanup();
0059 if(gROOT->GetListOfCanvases()->FindObject(fCanvas))
0060 delete fCanvas;
0061 }
0062
0063
0064 void DrawTree(Int_t itree );
0065
0066 void RaiseDialog() { if (fMain) { fMain->RaiseWindow(); fMain->Layout(); fMain->MapWindow(); } }
0067
0068 private:
0069
0070 TGMainFrame *fMain;
0071 Int_t fItree;
0072 Int_t fNtrees;
0073 TCanvas* fCanvas;
0074
0075
0076 TGNumberEntry* fInput;
0077
0078 TGHorizontalFrame* fButtons;
0079 TGTextButton* fDrawButton;
0080 TGTextButton* fCloseButton;
0081
0082 void UpdateCanvases();
0083
0084
0085 TMVA::DecisionTree* ReadTree( TString * &vars, Int_t itree );
0086 void DrawNode( TMVA::DecisionTreeNode *n,
0087 Double_t x, Double_t y, Double_t xscale, Double_t yscale, TString* vars );
0088 void GetNtrees();
0089
0090 TString fWfile;
0091 TString fMethName;
0092 TString fDataset;
0093 Int_t fColorOffset;
0094
0095 public:
0096
0097
0098 static void Delete() { if (fThis) { delete fThis; fThis = nullptr; } }
0099
0100
0101 void SetItree();
0102 void Redraw();
0103 void Close();
0104
0105 private:
0106
0107 static StatDialogBDT* fThis;
0108
0109 };
0110
0111
0112 extern std::vector<TControlBar*> BDT_Global__cbar;
0113
0114
0115 void BDT(TString dataset, const TString& fin = "TMVA.root" );
0116 void BDT_DeleteTBar(int i);
0117 void BDT(TString dataset, Int_t itree, TString wfile , TString methName = "BDT", Bool_t useTMVAStyle = kTRUE ) ;
0118
0119 }
0120 #endif