Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
28namespace 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 inline Int_t getCanvas () {return TColor::GetColor( "#f0f0f0" );}
45 inline Int_t getFrameFill () {return TColor::GetColor( "#fffffd" );}
46 inline Int_t getTitleBox () {return TColor::GetColor( "#5D6B7D" );}
47 inline Int_t getTitleBorder () {return TColor::GetColor( "#7D8B9D" );}
48 inline Int_t getTitleText () {return TColor::GetColor( "#FFFFFF" );}
49 inline Int_t getSignalLine () {return TColor::GetColor( "#0000ee" );}
50 inline Int_t getSignalFill () {return TColor::GetColor( "#7d99d1" );}
51 inline Int_t getBackgroundLine () {return TColor::GetColor( "#ff0000" );}
52 inline Int_t getBackgroundFill () {return TColor::GetColor( "#ff0000" );}
53 inline Int_t getNovelBlue () {return TColor::GetColor( "#2244a5" );}
54
55
56 // set the style
57 void SetSignalAndBackgroundStyle( TH1* sig, TH1* bkg, TH1* all = nullptr );
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 = nullptr );
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=nullptr );
81 std::vector<TString> GetInputVariableNames(TDirectory *dir );
83 std::vector<TString> GetClassNames(TDirectory *dir );
84 TKey* FindMethod( TString name, TDirectory *dir=nullptr );
86 UInt_t GetListOfMethods( TList & methods, TDirectory *dir=nullptr );
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=nullptr );
92
93 }
94
95#endif
96}
97#endif
#define c(i)
Definition RSha256.hxx:101
#define h(i)
Definition RSha256.hxx:106
bool Bool_t
Definition RtypesCore.h:63
unsigned int UInt_t
Definition RtypesCore.h:46
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition TGX11.cxx:110
The Canvas class.
Definition TCanvas.h:23
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:1839
Describe directory structure in memory.
Definition TDirectory.h:45
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:53
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
An abstract interface to image processing library.
Definition TImage.h:29
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition TKey.h:28
A doubly linked list.
Definition TList.h:38
An array of TObjects.
Definition TObjArray.h:31
Basic string class.
Definition TString.h:139
Int_t getFrameFill()
Definition tmvaglob.h:45
UInt_t GetListOfJobs(TFile *file, TList &jobdirs)
Definition tmvaglob.cxx:615
Int_t getTitleBorder()
Definition tmvaglob.h:47
Int_t getTitleBox()
Definition tmvaglob.h:46
UInt_t GetListOfTitles(TDirectory *rfdir, TList &titles)
Definition tmvaglob.cxx:643
void Initialize(Bool_t useTMVAStyle=kTRUE)
Definition tmvaglob.cxx:176
Int_t GetNumberOfInputVariablesMultiClass(TDirectory *dir)
Definition tmvaglob.cxx:464
Int_t getTitleText()
Definition tmvaglob.h:48
Int_t GetNumberOfInputVariables(TDirectory *dir)
Definition tmvaglob.cxx:420
TKey * NextKey(TIter &keyIter, TString className)
Definition tmvaglob.cxx:364
void GetMethodTitle(TString &name, TKey *ikey)
Definition tmvaglob.cxx:348
Int_t getCanvas()
Definition tmvaglob.h:44
void plot_logo(Float_t v_scale=1.0, Float_t skew=1.0)
Definition tmvaglob.cxx:270
void DestroyCanvases()
Definition tmvaglob.cxx:166
Int_t getSignalFill()
Definition tmvaglob.h:50
Int_t getBackgroundFill()
Definition tmvaglob.h:52
TDirectory * GetInputVariablesDir(TMVAGlob::TypeOfPlot type, TDirectory *dir=nullptr)
Definition tmvaglob.cxx:707
void SetSignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *all=nullptr)
Definition tmvaglob.cxx:8
TFile * OpenFile(const TString &fin)
Definition tmvaglob.cxx:192
Int_t getNovelBlue()
Definition tmvaglob.h:53
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
Definition tmvaglob.cxx:77
TKey * FindMethod(TString name, TDirectory *dir=nullptr)
Definition tmvaglob.cxx:519
void NormalizeHists(TH1 *sig, TH1 *bkg=nullptr)
Definition tmvaglob.cxx:324
Int_t getBackgroundLine()
Definition tmvaglob.h:51
Bool_t ExistMethodName(TString name, TDirectory *dir=nullptr)
Definition tmvaglob.cxx:548
UInt_t GetListOfMethods(TList &methods, TDirectory *dir=nullptr)
Definition tmvaglob.cxx:590
void GetMethodName(TString &name, TKey *mkey)
Definition tmvaglob.cxx:342
Int_t GetNumberOfTargets(TDirectory *dir)
Definition tmvaglob.cxx:403
TImage * findImage(const char *imageName)
Definition tmvaglob.cxx:252
std::vector< TString > GetInputVariableNames(TDirectory *dir)
Definition tmvaglob.cxx:436
void SetMultiClassStyle(TObjArray *hists)
Definition tmvaglob.cxx:47
void NormalizeHist(TH1 *h)
Definition tmvaglob.cxx:315
TDirectory * GetCorrelationPlotsDir(TMVAGlob::TypeOfPlot type, TDirectory *dir=nullptr)
Definition tmvaglob.cxx:725
Int_t getSignalLine()
Definition tmvaglob.h:49
void SetTMVAStyle()
Definition tmvaglob.cxx:96
std::vector< TString > GetClassNames(TDirectory *dir)
Definition tmvaglob.cxx:469
UInt_t GetListOfKeys(TList &keys, TString inherits, TDirectory *dir=nullptr)
Definition tmvaglob.cxx:382
void imgconv(TCanvas *c, const TString &fname)
Definition tmvaglob.cxx:212
create variable transformations