tmvaglob.h
Go to the documentation of this file.
1 #ifndef tmvaglob__HH
2 #define tmvaglob__HH
3 // global TMVA style settings
4 #ifndef TMVA_TMVAGLOB
5 #define TMVA_TMVAGLOB
6 
7 #include <iostream>
8 #include <vector>
9 
10 #include "TPad.h"
11 #include "TCanvas.h"
12 #include "TColor.h"
13 #include "TSystem.h"
14 #include "TImage.h"
15 #include "TKey.h"
16 #include "TH1.h"
17 #include "TROOT.h"
18 #include "TStyle.h"
19 #include "TFile.h"
20 #include "TDirectory.h"
21 #include "TObjArray.h"
22 #include "TClass.h"
23 #include "TText.h"
24 #include "TLegend.h"
25 
26 #include "RVersion.h"
27 
28 namespace TMVA{
29 
30  using std::cout;
31  using std::endl;
32 
33  namespace TMVAGlob {
34  // --------- S t y l e ---------------------------
35  // -----------------------------------------------
36 
37  enum TypeOfPlot { kId = 0,
43 
44  static Int_t c_Canvas = TColor::GetColor( "#f0f0f0" );
45  static Int_t c_FrameFill = TColor::GetColor( "#fffffd" );
46  static Int_t c_TitleBox = TColor::GetColor( "#5D6B7D" );
47  static Int_t c_TitleBorder = TColor::GetColor( "#7D8B9D" );
48  static Int_t c_TitleText = TColor::GetColor( "#FFFFFF" );
49  static Int_t c_SignalLine = TColor::GetColor( "#0000ee" );
50  static Int_t c_SignalFill = TColor::GetColor( "#7d99d1" );
51  static Int_t c_BackgroundLine = TColor::GetColor( "#ff0000" );
52  static Int_t c_BackgroundFill = TColor::GetColor( "#ff0000" );
53  static Int_t c_NovelBlue = TColor::GetColor( "#2244a5" );
54 
55 
56  // set the style
57  void SetSignalAndBackgroundStyle( TH1* sig, TH1* bkg, TH1* all = 0 );
58  void SetMultiClassStyle( TObjArray* hists );
59  // set frame styles
60  void SetFrameStyle( TH1* frame, Float_t scale = 1.0 );
61  void SetTMVAStyle();
62  void DestroyCanvases();
63  // set style and remove existing canvas'
64  void Initialize( Bool_t useTMVAStyle = kTRUE );
65  // checks if file with name "fin" is already open, and if not opens one
66  TFile* OpenFile( const TString& fin );
67  // used to create output file for canvas
68  void imgconv( TCanvas* c, const TString & fname );
69  TImage * findImage(const char * imageName) ;
70  void plot_logo( Float_t v_scale = 1.0, Float_t skew = 1.0 );
71  void NormalizeHist( TH1* h );
72  void NormalizeHists( TH1* sig, TH1* bkg = 0 );
73  void GetMethodName( TString & name, TKey * mkey );
74  void GetMethodTitle( TString & name, TKey * ikey ) ;
75  void GetMethodName( TString & name, TDirectory * mdir );
76  void GetMethodTitle( TString & name, TDirectory * idir ) ;
77  TKey *NextKey( TIter & keyIter, TString className);
78  UInt_t GetListOfKeys( TList& keys, TString inherits, TDirectory *dir=0 );
79  Int_t GetNumberOfTargets( TDirectory *dir );
80  Int_t GetNumberOfInputVariables( TDirectory *dir );
81  std::vector<TString> GetInputVariableNames(TDirectory *dir );
82  Int_t GetNumberOfInputVariablesMultiClass( TDirectory *dir );
83  std::vector<TString> GetClassNames(TDirectory *dir );
84  TKey* FindMethod( TString name, TDirectory *dir=0 );
85  Bool_t ExistMethodName( TString name, TDirectory *dir=0 );
86  UInt_t GetListOfMethods( TList & methods, TDirectory *dir=0 );
87  UInt_t GetListOfJobs( TFile* file, TList& jobdirs);
88  UInt_t GetListOfTitles( TDirectory *rfdir, TList & titles );
89  UInt_t GetListOfTitles( TString & methodName, TList & titles, TDirectory *dir=0 );
90  TDirectory *GetInputVariablesDir( TMVAGlob::TypeOfPlot type, TDirectory *dir=0 );
91  TDirectory *GetCorrelationPlotsDir( TMVAGlob::TypeOfPlot type, TDirectory *dir=0 );
92 
93  }
94 
95 #endif
96 }
97 #endif
TString fin
Definition: Style.C:24
const XML_Char * name
Definition: expat.h:151
void imgconv(TCanvas *c, const TString &fname)
Definition: tmvaglob.C:220
keys
Reco plots.
Definition: caf_analysis.py:46
static Int_t c_FrameFill
Definition: tmvaglob.h:45
Int_t GetNumberOfInputVariables(TDirectory *dir)
Definition: tmvaglob.C:426
TFile * OpenFile(const TString &fin)
Definition: tmvaglob.C:200
static Int_t c_NovelBlue
Definition: tmvaglob.h:53
std::vector< TString > GetClassNames(TDirectory *dir)
void NormalizeHists(TH1 *sig, TH1 *bkg=0)
Definition: tmvaglob.C:334
static Int_t c_SignalFill
Definition: tmvaglob.h:50
void NormalizeHist(TH1 *h)
Definition: tmvaglob.C:325
void SetSignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *all=0)
Definition: tmvaglob.C:48
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
Definition: tmvaglob.C:88
Bool_t ExistMethodName(TString name, TDirectory *dir=0)
Definition: tmvaglob.C:471
UInt_t GetListOfKeys(TList &keys, TString inherits, TDirectory *dir=0)
Definition: tmvaglob.C:392
TDirectory * GetCorrelationPlotsDir(TMVAGlob::TypeOfPlot type, TDirectory *dir=0)
TString hists[nhists]
Definition: bdt_com.C:3
static Int_t c_TitleText
Definition: tmvaglob.h:48
Int_t GetNumberOfTargets(TDirectory *dir)
Definition: tmvaglob.C:413
void GetMethodTitle(TString &name, TKey *ikey)
Definition: tmvaglob.C:358
Double_t scale
Definition: plot.C:25
void GetMethodName(TString &name, TKey *mkey)
Definition: tmvaglob.C:352
void SetTMVAStyle()
Definition: tmvaglob.C:107
void SetMultiClassStyle(TObjArray *hists)
static Int_t c_Canvas
Definition: tmvaglob.h:44
std::vector< TString > GetInputVariableNames(TDirectory *dir)
void Initialize(Bool_t useTMVAStyle=kTRUE)
Definition: tmvaglob.C:184
UInt_t GetListOfJobs(TFile *file, TList &jobdirs)
Definition: tmvaglob.C:538
void plot_logo(Float_t v_scale=1.0, Float_t skew=1.0)
Definition: tmvaglob.C:280
Int_t GetNumberOfInputVariablesMultiClass(TDirectory *dir)
OStream cout
Definition: OStream.cxx:6
static Int_t c_TitleBox
Definition: tmvaglob.h:46
TImage * findImage(const char *imageName)
Definition: tmvaglob.C:253
UInt_t GetListOfMethods(TList &methods, TDirectory *dir=0)
Definition: tmvaglob.C:513
static Int_t c_SignalLine
Definition: tmvaglob.h:49
TDirectory * dir
Definition: macro.C:5
TKey * NextKey(TIter &keyIter, TString className)
Definition: tmvaglob.C:374
static Int_t c_BackgroundFill
Definition: tmvaglob.h:52
TKey * FindMethod(TString name, TDirectory *dir=0)
Definition: tmvaglob.C:442
TFile * file
Definition: cellShifts.C:17
Definition: tmvaglob.h:28
static Int_t c_BackgroundLine
Definition: tmvaglob.h:51
void DestroyCanvases()
Definition: tmvaglob.C:174
TDirectory * GetInputVariablesDir(TMVAGlob::TypeOfPlot type, TDirectory *dir=0)
static Int_t c_TitleBorder
Definition: tmvaglob.h:47
UInt_t GetListOfTitles(TDirectory *rfdir, TList &titles)
Definition: tmvaglob.C:566