41 Int_t countCanvas = 0;
52 cout <<
"--- Probas.C: no methods found!" << endl;
57 constexpr std::size_t fnameSize = 200;
58 char fname[fnameSize];
63 while ( (key = (
TKey*)next()) ) {
70 cout <<
"+++ No titles found for classifier: " << methodName << endl;
73 TIter nextTitle(&titles);
78 while ( (instkey = (
TKey *)nextTitle()) ) {
83 if (nhists==0) cout <<
"*** No histograms found!" << endl;
84 TIter nextInDir(&h1hists);
88 while ( (hkey = (
TKey*)nextInDir()) ) {
97 sig = (
TH1*)instDir->
Get( hnameS );
98 bgd = (
TH1*)instDir->
Get( hnameB );
100 if (sig == 0 || bgd == 0) {
101 cout <<
"*** probas.C: big troubles in probas.... histogram: " << hname <<
" not found" << endl;
108 for (
int i=0; i<= 5; i++) {
110 sigF = (
TH1*)instDir->
Get( hspline );
119 sigF = (
TH1*)instDir->
Get( hspline );
126 if ((sigF == NULL || bkgF == NULL) &&!hname.
Contains(
"hist") ) {
127 cout <<
"*** probas.C: big troubles - did not find probability histograms" << endl;
134 if (NULL != sigF && NULL != bkgF && NULL!=sig && NULL!=bgd) {
138 sig->SetTitle(
TString(
"TMVA output for classifier: ") + methodTitle );
141 cout <<
"--- Book canvas no: " << countCanvas << endl;
143 snprintf( cn, 20,
"canvas%d", countCanvas+1 );
145 countCanvas*50+200, countCanvas*20,
width,
width*0.78 );
154 bgd->GetMean() - nrms*bgd->GetRMS() ),
155 sig->GetXaxis()->GetXmin() );
157 bgd->GetMean() + nrms*bgd->GetRMS() ),
158 sig->GetXaxis()->GetXmax() );
162 if (Draw_CFANN_Logy && methodName ==
"CFANN")
ymin = 0.01;
166 TH2F* frame =
new TH2F(
TString(
"frame") + sig->GetName() +
"_proba", sig->GetTitle(),
175 if (Draw_CFANN_Logy && methodName ==
"CFANN")
c->SetLogy();
179 sig->SetMarkerSize( 0.7 );
180 sig->SetMarkerStyle( 20 );
181 sig->SetLineWidth(1);
184 bgd->SetMarkerSize( 0.7 );
185 bgd->SetMarkerStyle( 24 );
186 bgd->SetLineWidth(1);
191 sigF->SetFillStyle( 0 );
192 bkgF->SetFillStyle( 0 );
193 sigF->Draw(
"samehist");
194 bkgF->Draw(
"samehist");
197 frame->
Draw(
"sameaxis");
200 TLegend *legend=
new TLegend(
c->GetLeftMargin(), 1 -
c->GetTopMargin() - 0.2,
201 c->GetLeftMargin() + 0.4, 1 -
c->GetTopMargin() );
202 legend->
AddEntry(sig,
"Signal data",
"P");
203 legend->
AddEntry(sigF,
"Signal PDF",
"L");
204 legend->
AddEntry(bgd,
"Background data",
"P");
205 legend->
AddEntry(bkgF,
"Background PDF",
"L");
206 legend->
Draw(
"same");
213 snprintf( fname, fnameSize,
"%s/plots/mva_pdf_%s_c%i",
dataset.Data(), methodTitle.
Data(), countCanvas+1 );
222 cout <<
"--- No PDFs found for method " << methodTitle <<
". Did you request \"CreateMVAPdfs\" in the option string?" << endl;
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 TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
TH1 is the base class of all histogram classes in ROOT.
void Draw(Option_t *option="") override
Draw this histogram with options.
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.
This class displays a legend box (TPaveText) containing several legend entries.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
void Draw(Option_t *option="") override
Draw this legend with its current attributes.
void SetMargin(Float_t margin)
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
virtual void SetBorderSize(Int_t bordersize=4)
Sets the border size of the TPave box and shadow.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
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
UInt_t GetListOfTitles(TDirectory *rfdir, TList &titles)
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)
Int_t getBackgroundLine()
UInt_t GetListOfMethods(TList &methods, TDirectory *dir=nullptr)
void GetMethodName(TString &name, TKey *mkey)
UInt_t GetListOfKeys(TList &keys, TString inherits, TDirectory *dir=nullptr)
void imgconv(TCanvas *c, const TString &fname)
void probas(TString dataset, TString fin="TMVA.root", 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.