39 while ((key = (
TKey*)next())) {
42 if (!
gROOT->GetClass(key->GetClassName())->InheritsFrom(
"TDirectory"))
continue;
53 if (!
gROOT->GetClass(
titkey->GetClassName())->InheritsFrom(
"TDirectory"))
continue;
59 std::cout <<
"--- Found directory for method: " << methodName <<
"::" << methodTitle << std::flush;
62 else if (
htype == kRarityType )
hname +=
"_Rarity";
66 if (sig==0 || bgd==0) {
67 if (
htype == kMVAType)
68 cout <<
":\t mva distribution not available (this is normal for Cut classifier)" << endl;
69 else if(
htype == kProbaType)
70 cout <<
":\t probability distribution not available" << endl;
71 else if(
htype == kRarityType)
72 cout <<
":\t rarity distribution not available" << endl;
73 else if(
htype == kCompareType)
74 cout <<
":\t overtraining check not available" << endl;
79 cout <<
" containing " <<
hname <<
"_S/_B" << endl;
82 if (
htype == kProbaType)
84 else if (
htype == kRarityType)
86 else if (
htype == kCompareType)
109 cout <<
"--- Mean and RMS (S): " << sig->
GetMean() <<
", " << sig->
GetRMS() << endl;
110 cout <<
"--- Mean and RMS (B): " << bgd->
GetMean() <<
", " << bgd->
GetRMS() << endl;
137 c->GetPad(0)->SetLeftMargin( 0.105 );
142 c->GetLeftMargin() + (
htype == kCompareType ? 0.40 : 0.3), 1 -
c->GetTopMargin() );
143 legend->SetFillStyle( 1 );
144 legend->AddEntry(sig,
TString(
"Signal") + ((
htype == kCompareType) ?
" (test sample)" :
""),
"F");
145 legend->AddEntry(bgd,
TString(
"Background") + ((
htype == kCompareType) ?
" (test sample)" :
""),
"F");
147 legend->SetMargin( (
htype == kCompareType ? 0.2 : 0.3) );
151 sig->
Draw(
"samehist");
152 bgd->
Draw(
"samehist");
154 if (
htype == kCompareType) {
164 cout <<
"+++ Problem in \"mvas.C\": overtraining check histograms do not exist" << endl;
167 cout <<
"--- Found comparison histograms for overtraining check" << endl;
170 1 -
c->GetRightMargin(), 1 -
c->GetTopMargin() );
173 legend2->AddEntry(
sigOv,
"Signal (training sample)",
"P");
174 legend2->AddEntry(
bgdOv,
"Background (training sample)",
"P");
182 sigOv->SetMarkerColor( col );
183 sigOv->SetMarkerSize( 0.7 );
184 sigOv->SetMarkerStyle( 20 );
185 sigOv->SetLineWidth( 1 );
186 sigOv->SetLineColor( col );
187 sigOv->Draw(
"e1same");
190 bgdOv->SetMarkerColor( col );
191 bgdOv->SetMarkerSize( 0.7 );
192 bgdOv->SetMarkerStyle( 20 );
193 bgdOv->SetLineWidth( 1 );
194 bgdOv->SetLineColor( col );
195 bgdOv->Draw(
"e1same");
205 cout <<
"--- Perform Kolmogorov-Smirnov tests" << endl;
208 cout <<
"--- Goodness of signal (background) consistency: " <<
kolS <<
" (" <<
kolB <<
")" << endl;
212 tt->SetNDC();
tt->SetTextSize( 0.032 );
tt->AppendPad();
216 frame->
Draw(
"sameaxis");
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
static char * Format(const char *format, va_list ap)
Format a string in a circular formatting buffer (using a printf style format descriptor).
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
virtual void SetLimits(Double_t xmin, Double_t xmax)
TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory") override
Find a directory named "apath".
Describe directory structure in memory.
virtual TList * GetListOfKeys() const
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
TH1 is the base class of all histogram classes in ROOT.
void SetTitle(const char *title) override
Change/set the title.
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.
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 Int_t GetNbinsX() const
void Draw(Option_t *option="") override
Draw this histogram with options.
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
Return content of bin number bin.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width for 1D histogram.
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.
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.
This class displays a legend box (TPaveText) containing several legend entries.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetTitle() const override
Returns title of object.
Mother of all ROOT objects.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Base class for several text objects.
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
void Initialize(Bool_t useTMVAStyle=kTRUE)
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 mvas(TString dataset, TString fin="TMVA.root", HistType htype=kMVAType, Bool_t useTMVAStyle=kTRUE)
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.