6#define CheckDerivedPlots 0
11 HistType htype ,
bool useTMVAStyle )
13 cout <<
"=== Compare histograms of two files ===" << endl;
14 cout <<
" File-1: " << finAn << endl;
15 cout <<
" File-2: " << finApp << endl;
32 Int_t countCanvas = 0;
37 while ( (key = (
TKey*)next()) ) {
41 cout <<
"--- Found directory: " << dirname <<
" --> ignoring" << endl;
44 cout <<
"--- Found directory: " << dirname
45 <<
" --> going in" << endl;
50 cout <<
"--- Method: " << methodName << endl;
56 TIter nextTitle(&titles);
64 TString hname =
"MVA_" + methodTitle;
67 TH1* sig =
dynamic_cast<TH1*
>(titDir->
Get( hname +
"_S" ));
68 TH1* bgd =
dynamic_cast<TH1*
>(titDir->
Get( hname +
"_B" ));
70 if (sig==0 || bgd==0)
continue;
74 if (htype == kProbaType)
76 else if (htype == kRarityType)
80 TString ctitle = ((htype == TMVA::kMVAType) ?
82 (htype == kProbaType) ?
88 (htype == kProbaType) ?
93 countCanvas*50+200, countCanvas*20,
width,
width*0.78 );
112 if (Draw_CFANN_Logy && methodName ==
"CFANN")
ymin = 0.01;
118 frame->GetXaxis()->SetTitle(methodTitle);
119 if (htype == kProbaType ) frame->GetXaxis()->SetTitle(
"Signal probability" );
120 else if (htype == kRarityType) frame->GetXaxis()->SetTitle(
"Signal rarity" );
121 frame->GetYaxis()->SetTitle(
"Normalized");
127 c->GetPad(0)->SetLeftMargin( 0.105 );
128 frame->GetYaxis()->SetTitleOffset( 1.2 );
130 if (Draw_CFANN_Logy && methodName ==
"CFANN")
c->SetLogy();
133 TLegend *legend=
new TLegend(
c->GetLeftMargin(), 1 -
c->GetTopMargin() - 0.12,
134 c->GetLeftMargin() + 0.3, 1 -
c->GetTopMargin() );
137 legend->
AddEntry(bgd,
"Background",
"F");
140 legend->
Draw(
"same");
143 sig->
Draw(
"samehist");
144 bgd->
Draw(
"samehist");
148 cout <<
"--- Searching for histogram: " << hStem.
Data() <<
" in application file" << endl;
150 TH1* testHist = (
TH1*)fileApp->
Get( hStem );
152 cout <<
"--> Found application histogram: " << testHist->
GetName() <<
" --> superimpose it" << endl;
157 testHist->
Draw(
"samehist");
161 frame->Draw(
"sameaxis");
bool Bool_t
Boolean (0=false, 1=true) (bool).
int Int_t
Signed integer 4 bytes (int).
float Float_t
Float 4 bytes (float).
double Double_t
Double 8 bytes.
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 cname
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Bool_t cd() override
Change current directory to "this" directory.
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
Describe directory structure in memory.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
TH1 is the base class of all histogram classes in ROOT.
void SetTitle(const char *title) override
Set the title of the TNamed.
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
virtual Int_t GetNbinsX() const
virtual Double_t GetBinWidth(Int_t bin) const
void Draw(Option_t *option="") override
Default Draw method for all objects.
Double_t GetRMS(Int_t axis=1) const
This function returns the Standard Deviation (Sigma) of the distribution not the Root Mean Square (RM...
virtual Double_t GetBinContent(Int_t bin) const
virtual Double_t GetMean(Int_t axis=1) const
2-D histogram with a float per channel (see TH1 documentation)
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual TObject * ReadObj()
To read a TObject* from the file.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
void Draw(Option_t *option="") override
Draw this box with its current attributes.
void SetMargin(Float_t margin)
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
virtual void SetBorderSize(Int_t bordersize=4)
Sets the border size of the TPave box and shadow.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void SetNDC(Bool_t isNDC=kTRUE)
#define CheckDerivedPlots
void Initialize(Bool_t useTMVAStyle=kTRUE)
TKey * NextKey(TIter &keyIter, TString className)
void GetMethodTitle(TString &name, TKey *ikey)
void plot_logo(Float_t v_scale=1.0, Float_t skew=1.0)
void SetSignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *all=nullptr)
TFile * OpenFile(const TString &fin)
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
void NormalizeHists(TH1 *sig, TH1 *bkg=nullptr)
void GetMethodName(TString &name, TKey *mkey)
void imgconv(TCanvas *c, const TString &fname)
void compareanapp(TString finAn="TMVA.root", TString finApp="TMVApp.root", HistType htype=kMVAType, bool useTMVAStyle=kTRUE)