#ifndef BDT__HH
#define BDT__HH
#include <iostream>
#include <iomanip>
#include <fstream>

#include "tmvaglob.h"

#include "RQ_OBJECT.h"

#include "TROOT.h"
#include "TStyle.h"
#include "TPad.h"
#include "TCanvas.h"
#include "TLine.h"
#include "TFile.h"
#include "TColor.h"
#include "TPaveText.h"
#include "TObjString.h"
#include "TControlBar.h"

#include "TGWindow.h"
#include "TGButton.h"
#include "TGLabel.h"
#include "TGNumberEntry.h"

#include "TMVA/DecisionTree.h"
#include "TMVA/Tools.h"
#include "TXMLEngine.h"

// Uncomment this only if the link problem is solved. The include statement tends
// to use the ROOT classes rather than the local TMVA release
// #include "TMVA/DecisionTree.h"
// #include "TMVA/DecisionTreeNode.h"
namespace TMVA{

   // this macro displays a decision tree read in from the weight file

   // static const Int_t kSigColorF = TColor::GetColor( "#2244a5" );  // novel blue 
   // static const Int_t kBkgColorF = TColor::GetColor( "#dd0033" );  // novel red  
   // static const Int_t kIntColorF = TColor::GetColor( "#33aa77" );  // novel green

   static const Int_t kSigColorF = TColor::GetColor( "#0000FF" );  // Pure Signal
   static const Int_t kBkgColorF = TColor::GetColor( "#FF0000" );  // Pure Backgr.
   static const Int_t kIntColorF = TColor::GetColor( "#33aa77" );  // novel green


   static const Int_t kSigColorT = 10;
   static const Int_t kBkgColorT = 10;
   static const Int_t kIntColorT = 10;



   class StatDialogBDT {  

      RQ_OBJECT("StatDialogBDT")

   public:

      StatDialogBDT( const TGWindow* p, TString wfile = "weights/TMVAClassification_BDT.weights.txt", 
                     TString methName = "BDT", Int_t itree = 0 );
      virtual ~StatDialogBDT() {
         TMVA::DecisionTreeNode::fgIsTraining=false;
         fThis = 0;
         fMain->CloseWindow();
         fMain->Cleanup();
         if(gROOT->GetListOfCanvases()->FindObject(fCanvas))
            delete fCanvas; 
      }
   
      // draw method
      void DrawTree( Int_t itree );

      void RaiseDialog() { if (fMain) { fMain->RaiseWindow(); fMain->Layout(); fMain->MapWindow(); } }
   
   private:
   
      TGMainFrame *fMain;
      Int_t        fItree;
      Int_t        fNtrees;
      TCanvas*     fCanvas;


      TGNumberEntry* fInput;

      TGHorizontalFrame* fButtons;
      TGTextButton* fDrawButton;
      TGTextButton* fCloseButton;

      void UpdateCanvases();

      // draw methods
      TMVA::DecisionTree* ReadTree( TString * &vars, Int_t itree );
      void                DrawNode( TMVA::DecisionTreeNode *n, 
                                    Double_t x, Double_t y, Double_t xscale,  Double_t yscale, TString* vars );
      void GetNtrees();

      TString fWfile;
      TString fMethName;

      Int_t   fColorOffset;

   public:

      // static function for external deletion
      static void Delete() { if (fThis != 0) { delete fThis; fThis = 0; } }

      // slots
      void SetItree(); //*SIGNAL*
      void Redraw(); //*SIGNAL*
      void Close(); //*SIGNAL*

   private:

      static StatDialogBDT* fThis;

   };
   // ========================================================================================

   static std::vector<TControlBar*> BDT_Global__cbar;

   // intermediate GUI
   void BDT( const TString& fin = "TMVA.root" );
   void BDT_DeleteTBar(int i);
   void BDT( Int_t itree, TString wfile = "weights/TMVAnalysis_test_BDT.weights.txt", TString methName = "BDT", Bool_t useTMVAStyle = kTRUE ) ;

}
#endif
 BDT.h:1
 BDT.h:2
 BDT.h:3
 BDT.h:4
 BDT.h:5
 BDT.h:6
 BDT.h:7
 BDT.h:8
 BDT.h:9
 BDT.h:10
 BDT.h:11
 BDT.h:12
 BDT.h:13
 BDT.h:14
 BDT.h:15
 BDT.h:16
 BDT.h:17
 BDT.h:18
 BDT.h:19
 BDT.h:20
 BDT.h:21
 BDT.h:22
 BDT.h:23
 BDT.h:24
 BDT.h:25
 BDT.h:26
 BDT.h:27
 BDT.h:28
 BDT.h:29
 BDT.h:30
 BDT.h:31
 BDT.h:32
 BDT.h:33
 BDT.h:34
 BDT.h:35
 BDT.h:36
 BDT.h:37
 BDT.h:38
 BDT.h:39
 BDT.h:40
 BDT.h:41
 BDT.h:42
 BDT.h:43
 BDT.h:44
 BDT.h:45
 BDT.h:46
 BDT.h:47
 BDT.h:48
 BDT.h:49
 BDT.h:50
 BDT.h:51
 BDT.h:52
 BDT.h:53
 BDT.h:54
 BDT.h:55
 BDT.h:56
 BDT.h:57
 BDT.h:58
 BDT.h:59
 BDT.h:60
 BDT.h:61
 BDT.h:62
 BDT.h:63
 BDT.h:64
 BDT.h:65
 BDT.h:66
 BDT.h:67
 BDT.h:68
 BDT.h:69
 BDT.h:70
 BDT.h:71
 BDT.h:72
 BDT.h:73
 BDT.h:74
 BDT.h:75
 BDT.h:76
 BDT.h:77
 BDT.h:78
 BDT.h:79
 BDT.h:80
 BDT.h:81
 BDT.h:82
 BDT.h:83
 BDT.h:84
 BDT.h:85
 BDT.h:86
 BDT.h:87
 BDT.h:88
 BDT.h:89
 BDT.h:90
 BDT.h:91
 BDT.h:92
 BDT.h:93
 BDT.h:94
 BDT.h:95
 BDT.h:96
 BDT.h:97
 BDT.h:98
 BDT.h:99
 BDT.h:100
 BDT.h:101
 BDT.h:102
 BDT.h:103
 BDT.h:104
 BDT.h:105
 BDT.h:106
 BDT.h:107
 BDT.h:108
 BDT.h:109
 BDT.h:110
 BDT.h:111
 BDT.h:112
 BDT.h:113
 BDT.h:114
 BDT.h:115
 BDT.h:116
 BDT.h:117
 BDT.h:118
 BDT.h:119
 BDT.h:120
 BDT.h:121
 BDT.h:122
 BDT.h:123
 BDT.h:124
 BDT.h:125
 BDT.h:126
 BDT.h:127
 BDT.h:128