Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:11

0001 #ifndef tmvaglob__HH
0002 #define tmvaglob__HH
0003 // global TMVA style settings
0004 #ifndef TMVA_TMVAGLOB
0005 #define TMVA_TMVAGLOB
0006 
0007 #include <iostream>
0008 #include <vector>
0009 
0010 #include "TPad.h"
0011 #include "TCanvas.h"
0012 #include "TColor.h"
0013 #include "TSystem.h"
0014 #include "TImage.h"
0015 #include "TKey.h"
0016 #include "TH1.h"
0017 #include "TROOT.h"
0018 #include "TStyle.h"
0019 #include "TFile.h"
0020 #include "TDirectory.h"
0021 #include "TObjArray.h"
0022 #include "TClass.h"
0023 #include "TText.h"
0024 #include "TLegend.h"
0025 
0026 #include "RVersion.h"
0027 
0028 namespace TMVA{
0029 
0030    using std::cout;
0031    using std::endl;
0032 
0033    namespace TMVAGlob {
0034       // --------- S t y l e ---------------------------
0035       // -----------------------------------------------
0036 
0037       enum TypeOfPlot { kId = 0,
0038                         kNorm,
0039                         kDecorrelated,
0040                         kPCA,
0041                         kGaussDecorr,
0042                         kNumOfMethods };
0043 
0044       inline Int_t getCanvas         () {return  TColor::GetColor( "#f0f0f0" );}
0045       inline Int_t getFrameFill      () {return  TColor::GetColor( "#fffffd" );}
0046       inline Int_t getTitleBox       () {return  TColor::GetColor( "#5D6B7D" );}
0047       inline Int_t getTitleBorder    () {return  TColor::GetColor( "#7D8B9D" );}
0048       inline Int_t getTitleText      () {return  TColor::GetColor( "#FFFFFF" );}
0049       inline Int_t getSignalLine     () {return  TColor::GetColor( "#0000ee" );}
0050       inline Int_t getSignalFill     () {return  TColor::GetColor( "#7d99d1" );}
0051       inline Int_t getBackgroundLine () {return  TColor::GetColor( "#ff0000" );}
0052       inline Int_t getBackgroundFill () {return  TColor::GetColor( "#ff0000" );}
0053       inline Int_t getNovelBlue      () {return  TColor::GetColor( "#2244a5" );}
0054 
0055 
0056       // set the style
0057       void SetSignalAndBackgroundStyle( TH1* sig, TH1* bkg, TH1* all = nullptr );
0058       void SetMultiClassStyle( TObjArray* hists );
0059       // set frame styles
0060       void SetFrameStyle( TH1* frame, Float_t scale = 1.0 );
0061       void SetTMVAStyle();
0062       void DestroyCanvases();
0063       // set style and remove existing canvas'
0064       void Initialize( Bool_t useTMVAStyle = kTRUE );
0065       // checks if file with name "fin" is already open, and if not opens one
0066       TFile* OpenFile( const TString& fin );
0067       // used to create output file for canvas
0068       void imgconv( TCanvas* c, const TString & fname );
0069       TImage * findImage(const char * imageName) ;
0070       void plot_logo( Float_t v_scale = 1.0, Float_t skew = 1.0 );
0071       void NormalizeHist( TH1* h );
0072       void NormalizeHists( TH1* sig, TH1* bkg = nullptr );
0073       void GetMethodName( TString & name, TKey * mkey );
0074       void GetMethodTitle( TString & name, TKey * ikey ) ;
0075       void GetMethodName( TString & name, TDirectory * mdir );
0076       void GetMethodTitle( TString & name, TDirectory * idir ) ;
0077       TKey *NextKey( TIter & keyIter, TString className);
0078       UInt_t GetListOfKeys( TList& keys, TString inherits, TDirectory *dir=nullptr );
0079       Int_t GetNumberOfTargets( TDirectory *dir );
0080       Int_t GetNumberOfInputVariables( TDirectory *dir );
0081       std::vector<TString> GetInputVariableNames(TDirectory *dir );
0082       Int_t GetNumberOfInputVariablesMultiClass( TDirectory *dir );
0083       std::vector<TString> GetClassNames(TDirectory *dir );
0084       TKey* FindMethod( TString name, TDirectory *dir=nullptr );
0085       Bool_t ExistMethodName( TString name, TDirectory *dir=nullptr );
0086       UInt_t GetListOfMethods( TList & methods, TDirectory *dir=nullptr );
0087       UInt_t GetListOfJobs( TFile* file, TList& jobdirs);
0088       UInt_t GetListOfTitles( TDirectory *rfdir, TList & titles );
0089       UInt_t GetListOfTitles( TString & methodName, TList & titles, TDirectory *dir=nullptr );
0090       TDirectory *GetInputVariablesDir( TMVAGlob::TypeOfPlot type, TDirectory *dir=nullptr );
0091       TDirectory *GetCorrelationPlotsDir( TMVAGlob::TypeOfPlot type, TDirectory *dir=nullptr );
0092 
0093    }
0094 
0095 #endif
0096 }
0097 #endif