28 const Int_t width = 600;
34 Int_t countCanvas = 0;
42 if (!
gROOT->GetClass(key->GetClassName())->InheritsFrom(
"TDirectory"))
continue;
51 while ((titkey = (
TKey*)keyIt())) {
53 if (!
gROOT->GetClass(titkey->GetClassName())->InheritsFrom(
"TDirectory"))
continue;
59 std::cout <<
"--- Found directory for method: " << methodName <<
"::" << methodTitle << std::flush;
60 TString hname =
"MVA_" + methodTitle;
63 TH1* sig =
dynamic_cast<TH1*
>(titDir->
Get( hname +
"_S" ));
64 TH1* bgd =
dynamic_cast<TH1*
>(titDir->
Get( hname +
"_B" ));
66 if (sig==0 || bgd==0) {
68 cout <<
":\t mva distribution not available (this is normal for Cut classifier)" << endl;
70 cout <<
":\t probability distribution not available" << endl;
72 cout <<
":\t rarity distribution not available" << endl;
74 cout <<
":\t overtraining check not available" << endl;
79 cout <<
" containing " << hname <<
"_S/_B" << endl;
81 sig->
SetTitle(
Form(
"TMVA response for classifier: %s", methodTitle.
Data()) );
83 sig->
SetTitle(
Form(
"TMVA probability for classifier: %s", methodTitle.
Data()) );
87 sig->
SetTitle(
Form(
"TMVA overtraining check for classifier: %s", methodTitle.
Data()) );
91 Form(
"TMVA response %s",methodTitle.
Data()) :
93 Form(
"TMVA probability %s",methodTitle.
Data()) :
95 Form(
"TMVA comparison %s",methodTitle.
Data()) :
96 Form(
"TMVA Rarity %s",methodTitle.
Data()));
98 c =
new TCanvas(
Form(
"canvas%d", countCanvas+1), ctitle,
99 countCanvas*50+200, countCanvas*20, width, (
Int_t)width*0.78 );
109 cout <<
"--- Mean and RMS (S): " << sig->
GetMean() <<
", " << sig->
GetRMS() << endl;
110 cout <<
"--- Mean and RMS (B): " << bgd->
GetMean() <<
", " << bgd->
GetRMS() << endl;
148 legend->
Draw(
"same");
151 sig->
Draw(
"samehist");
152 bgd->
Draw(
"samehist");
159 TString ovname = hname +=
"_Train";
160 sigOv =
dynamic_cast<TH1*
>(titDir->
Get( ovname +
"_S" ));
161 bgdOv =
dynamic_cast<TH1*
>(titDir->
Get( ovname +
"_B" ));
163 if (sigOv == 0 || bgdOv == 0) {
164 cout <<
"+++ Problem in \"mvas.C\": overtraining check histograms do not exist" << endl;
167 cout <<
"--- Found comparison histograms for overtraining check" << endl;
173 legend2->
AddEntry(sigOv,
"Signal (training sample)",
"P");
174 legend2->
AddEntry(bgdOv,
"Background (training sample)",
"P");
176 legend2->
Draw(
"same");
187 sigOv->
Draw(
"e1same");
195 bgdOv->
Draw(
"e1same");
205 cout <<
"--- Perform Kolmogorov-Smirnov tests" << endl;
208 cout <<
"--- Goodness of signal (background) consistency: " << kolS <<
" (" << kolB <<
")" << endl;
210 TString probatext =
Form(
"Kolmogorov-Smirnov test: signal (background) probability = %5.3g (%5.3g)", kolS, kolB );
216 frame->
Draw(
"sameaxis");
222 TString uoflow =
Form(
"U/O-flow (S,B): (%.1f, %.1f)%% / (%.1f, %.1f)%%",
227 t->SetTextSize( 0.030 );
228 t->SetTextAngle( 90 );
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 * GetTitle() const
Returns title of object.
virtual void SetLineWidth(Width_t lwidth)
void imgconv(TCanvas *c, const TString &fname)
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
This class displays a legend box (TPaveText) containing several legend entries.
virtual void SetLimits(Double_t xmin, Double_t xmax)
virtual TList * GetListOfKeys() const
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
TFile * OpenFile(const TString &fin)
void NormalizeHists(TH1 *sig, TH1 *bkg=0)
virtual TList * GetListOfKeys() const
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
void SetSignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *all=0)
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
Short_t Min(Short_t a, Short_t b)
void SetMargin(Float_t margin)
virtual void SetFillStyle(Style_t fstyle)
virtual Int_t GetNbinsX() const
void mvas(TString fin="TMVA.root", HistType htype=kMVAType, Bool_t useTMVAStyle=kTRUE)
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
virtual Double_t GetBinWidth(Int_t bin) const
return bin width for 1D historam Better to use h1.GetXaxis().GetBinWidth(bin)
const char * Data() const
Float_t GetTopMargin() const
Float_t GetRightMargin() const
virtual void SetMarkerColor(Color_t mcolor=1)
void GetMethodTitle(TString &name, TKey *ikey)
Base class for several text objects.
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual void SetLineColor(Color_t lcolor)
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.
std::string GetMethodName(TCppMethod_t)
void Initialize(Bool_t useTMVAStyle=kTRUE)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
2-D histogram with a float per channel (see TH1 documentation)}
virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const
Statistical test of compatibility in shape between this histogram and h2, using Kolmogorov test...
char * Form(const char *fmt,...)
virtual void SetMarkerStyle(Style_t mstyle=1)
void plot_logo(Float_t v_scale=1.0, Float_t skew=1.0)
Double_t GetRMS(Int_t axis=1) const
virtual Color_t GetLineColor() const
virtual void SetMarkerSize(Size_t msize=1)
Float_t GetLeftMargin() const
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Describe directory structure in memory.
Mother of all ROOT objects.
virtual TVirtualPad * GetPad(Int_t subpadnumber) const
Get a pointer to subpadnumber of this pad.
Short_t Max(Short_t a, Short_t b)
virtual void SetTitle(const char *title)
Change (i.e.
virtual void SetTextSize(Float_t tsize=1)
virtual void Update()
Update canvas pad buffers.
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...
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
virtual void SetBorderSize(Int_t bordersize=4)
virtual void SetLeftMargin(Float_t leftmargin)
Set Pad left margin in fraction of the pad width.