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;
29 const Int_t width = 600;
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)
75 sig->
SetTitle(
Form(
"TMVA probability for classifier: %s", methodTitle.
Data()) );
76 else if (htype == kRarityType)
80 TString ctitle = ((htype == TMVA::kMVAType) ?
81 Form(
"TMVA output %s",methodTitle.
Data()) :
82 (htype == kProbaType) ?
83 Form(
"TMVA probability %s",methodTitle.
Data()) :
84 Form(
"TMVA rarity %s",methodTitle.
Data()));
86 TString cname = ((htype == TMVA::kMVAType) ?
87 Form(
"output_%s",methodTitle.
Data()) :
88 (htype == kProbaType) ?
89 Form(
"probability_%s",methodTitle.
Data()) :
90 Form(
"rarity_%s",methodTitle.
Data()));
93 countCanvas*50+200, countCanvas*20, width, width*0.78 );
112 if (Draw_CFANN_Logy && methodName ==
"CFANN") ymin = 0.01;
119 if (htype == kProbaType ) frame->
GetXaxis()->
SetTitle(
"Signal probability" );
120 else if (htype == kRarityType) frame->
GetXaxis()->
SetTitle(
"Signal rarity" );
130 if (Draw_CFANN_Logy && methodName ==
"CFANN") c->
SetLogy();
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");
167 TString uoflow =
Form(
"U/O-flow (S,B): (%.1f, %.1f)%% / (%.1f, %.1f)%%",
172 t->SetTextSize( 0.030 );
173 t->SetTextAngle( 90 );
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title Offset is a correction factor with respect to the "s...
virtual const char * GetName() const
Returns name of object.
std::string GetName(const std::string &scope_name)
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
void imgconv(TCanvas *c, const TString &fname)
Float_t GetLeftMargin() const
This class displays a legend box (TPaveText) containing several legend entries.
virtual TVirtualPad * GetPad(Int_t subpadnumber) const
Get a pointer to subpadnumber of this pad.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
TFile * OpenFile(const TString &fin)
void NormalizeHists(TH1 *sig, TH1 *bkg=0)
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
#define CheckDerivedPlots
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
void SetSignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *all=0)
virtual Double_t GetMean(Int_t axis=1) const
For axis = 1,2 or 3 returns the mean value of the histogram along X,Y or Z axis.
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
Short_t Min(Short_t a, Short_t b)
void SetMargin(Float_t margin)
Double_t GetRMS(Int_t axis=1) const
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
TKey * NextKey(TIter &keyIter, TString className)
void GetMethodTitle(TString &name, TKey *ikey)
Base class for several text objects.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
std::string GetMethodName(TCppMethod_t)
void Initialize(Bool_t useTMVAStyle=kTRUE)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
tomato 2-D histogram with a float per channel (see TH1 documentation)}
char * Form(const char *fmt,...)
void plot_logo(Float_t v_scale=1.0, Float_t skew=1.0)
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width for 1D histogram.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Describe directory structure in memory.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual TObject * ReadObj()
To read a TObject* from the file.
Float_t GetTopMargin() const
Short_t Max(Short_t a, Short_t b)
virtual void SetTitle(const char *title)
Change (i.e.
void compareanapp(TString finAn="TMVA.root", TString finApp="TMVApp.root", HistType htype=kMVAType, bool useTMVAStyle=kTRUE)
virtual Int_t GetNbinsX() const
virtual void Update()
Update canvas pad buffers.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
THist< 2, float, THistStatContent, THistStatUncertainty > TH2F
virtual void SetBorderSize(Int_t bordersize=4)
virtual const char * GetTitle() const
Returns title of object.
virtual void SetLeftMargin(Float_t leftmargin)
Set Pad left margin in fraction of the pad width.
const char * Data() const
virtual void SetLogy(Int_t value=1)
Set Lin/Log scale for Y.