41 Int_t countCanvas = 0;
52 cout <<
"--- Probas.C: no methods found!" << endl;
62 while ( (key = (
TKey*)next()) ) {
69 cout <<
"+++ No titles found for classifier: " << methodName << endl;
72 TIter nextTitle(&titles);
77 while ( (instkey = (
TKey *)nextTitle()) ) {
82 if (nhists==0) cout <<
"*** No histograms found!" << endl;
83 TIter nextInDir(&h1hists);
87 while ( (hkey = (
TKey*)nextInDir()) ) {
96 sig = (
TH1*)instDir->
Get( hnameS );
97 bgd = (
TH1*)instDir->
Get( hnameB );
99 if (sig == 0 || bgd == 0) {
100 cout <<
"*** probas.C: big troubles in probas.... histogram: " << hname <<
" not found" << endl;
107 for (
int i=0; i<= 5; i++) {
108 TString hspline = hnameS +
Form(
"_smoothed_hist_from_spline%i",i);
109 sigF = (
TH1*)instDir->
Get( hspline );
118 sigF = (
TH1*)instDir->
Get( hspline );
125 if ((sigF == NULL || bkgF == NULL) &&!hname.
Contains(
"hist") ) {
126 cout <<
"*** probas.C: big troubles - did not find probability histograms" << endl;
133 if (NULL != sigF && NULL != bkgF && NULL!=sig && NULL!=bgd) {
137 sig->SetTitle(
TString(
"TMVA output for classifier: ") + methodTitle );
140 cout <<
"--- Book canvas no: " << countCanvas << endl;
142 sprintf( cn,
"canvas%d", countCanvas+1 );
143 c =
new TCanvas( cn,
Form(
"TMVA Output Fit Variables %s",methodTitle.
Data()),
144 countCanvas*50+200, countCanvas*20,
width,
width*0.78 );
153 bgd->GetMean() - nrms*bgd->GetRMS() ),
154 sig->GetXaxis()->GetXmin() );
156 bgd->GetMean() + nrms*bgd->GetRMS() ),
157 sig->GetXaxis()->GetXmax() );
161 if (Draw_CFANN_Logy && methodName ==
"CFANN")
ymin = 0.01;
165 TH2F* frame =
new TH2F(
TString(
"frame") + sig->GetName() +
"_proba", sig->GetTitle(),
174 if (Draw_CFANN_Logy && methodName ==
"CFANN")
c->SetLogy();
178 sig->SetMarkerSize( 0.7 );
179 sig->SetMarkerStyle( 20 );
180 sig->SetLineWidth(1);
183 bgd->SetMarkerSize( 0.7 );
184 bgd->SetMarkerStyle( 24 );
185 bgd->SetLineWidth(1);
190 sigF->SetFillStyle( 0 );
191 bkgF->SetFillStyle( 0 );
192 sigF->Draw(
"samehist");
193 bkgF->Draw(
"samehist");
196 frame->
Draw(
"sameaxis");
199 TLegend *legend=
new TLegend(
c->GetLeftMargin(), 1 -
c->GetTopMargin() - 0.2,
200 c->GetLeftMargin() + 0.4, 1 -
c->GetTopMargin() );
201 legend->
AddEntry(sig,
"Signal data",
"P");
202 legend->
AddEntry(sigF,
"Signal PDF",
"L");
203 legend->
AddEntry(bgd,
"Background data",
"P");
204 legend->
AddEntry(bkgF,
"Background PDF",
"L");
205 legend->
Draw(
"same");
212 sprintf( fname,
"%s/plots/mva_pdf_%s_c%i",dataset.
Data(), methodTitle.
Data(), countCanvas+1 );
221 cout <<
"--- No PDFs found for method " << methodTitle <<
". Did you request \"CreateMVAPdfs\" in the option string?" << endl;
include TDocParser_001 C image html pict1_TDocParser_001 png width
char * Form(const char *fmt,...)
Describe directory structure in memory.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
TH1 is the base class of all histogram classes in ROOT.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
virtual void Draw(Option_t *option="")
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.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
void SetMargin(Float_t margin)
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual const char * GetName() const
Returns name of object.
virtual void SetBorderSize(Int_t bordersize=4)
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
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)
UInt_t GetListOfKeys(TList &keys, TString inherits, TDirectory *dir=0)
TFile * OpenFile(const TString &fin)
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
Int_t getBackgroundLine()
void GetMethodName(TString &name, TKey *mkey)
UInt_t GetListOfMethods(TList &methods, TDirectory *dir=0)
void SetSignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *all=0)
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)
Short_t Min(Short_t a, Short_t b)