52 const Int_t width = 600;
58 Int_t countCanvas = 0;
69 cout <<
"--- Probas.C: no methods found!" << endl;
79 while ( (key = (
TKey*)next()) ) {
86 cout <<
"+++ No titles found for classifier: " << methodName << endl;
89 TIter nextTitle(&titles);
94 while ( (instkey = (
TKey *)nextTitle()) ) {
99 if (nhists==0) cout <<
"*** No histograms found!" << endl;
100 TIter nextInDir(&h1hists);
104 while ( (hkey = (
TKey*)nextInDir()) ) {
113 sig = (
TH1*)instDir->
Get( hnameS );
114 bgd = (
TH1*)instDir->
Get( hnameB );
116 if (sig == 0 || bgd == 0) {
117 cout <<
"*** probas.C: big troubles in probas.... histogram: " << hname <<
" not found" << endl;
124 for (
int i=0; i<= 5; i++) {
125 TString hspline = hnameS +
Form(
"_smoothed_hist_from_spline%i",i);
126 sigF = (
TH1*)instDir->
Get( hspline );
135 sigF = (
TH1*)instDir->
Get( hspline );
142 if ((sigF == NULL || bkgF == NULL) &&!hname.
Contains(
"hist") ) {
143 cout <<
"*** probas.C: big troubles - did not find probability histograms" << endl;
150 if (NULL != sigF && NULL != bkgF && NULL!=sig && NULL!=bgd) {
154 sig->SetTitle(
TString(
"TMVA output for classifier: ") + methodTitle );
157 cout <<
"--- Book canvas no: " << countCanvas << endl;
159 sprintf( cn,
"canvas%d", countCanvas+1 );
160 c =
new TCanvas( cn,
Form(
"TMVA Output Fit Variables %s",methodTitle.
Data()),
161 countCanvas*50+200, countCanvas*20, width, width*0.78 );
170 bgd->GetMean() - nrms*bgd->GetRMS() ),
171 sig->GetXaxis()->GetXmin() );
173 bgd->GetMean() + nrms*bgd->GetRMS() ),
174 sig->GetXaxis()->GetXmax() );
178 if (Draw_CFANN_Logy && methodName ==
"CFANN") ymin = 0.01;
182 TH2F* frame =
new TH2F(
TString(
"frame") + sig->GetName() +
"_proba", sig->GetTitle(),
191 if (Draw_CFANN_Logy && methodName ==
"CFANN") c->
SetLogy();
195 sig->SetMarkerSize( 0.7 );
196 sig->SetMarkerStyle( 20 );
197 sig->SetLineWidth(1);
200 bgd->SetMarkerSize( 0.7 );
201 bgd->SetMarkerStyle( 24 );
202 bgd->SetLineWidth(1);
207 sigF->SetFillStyle( 0 );
208 bkgF->SetFillStyle( 0 );
209 sigF->Draw(
"samehist");
210 bkgF->Draw(
"samehist");
213 frame->
Draw(
"sameaxis");
218 legend->
AddEntry(sig,
"Signal data",
"P");
219 legend->
AddEntry(sigF,
"Signal PDF",
"L");
220 legend->
AddEntry(bgd,
"Background data",
"P");
221 legend->
AddEntry(bkgF,
"Background PDF",
"L");
222 legend->
Draw(
"same");
229 sprintf( fname,
"%s/plots/mva_pdf_%s_c%i",dataset.
Data(), methodTitle.
Data(), countCanvas+1 );
238 cout <<
"--- No PDFs found for method " << methodTitle <<
". Did you request \"CreateMVAPdfs\" in the option string?" << endl;
virtual const char * GetName() const
Returns name of object.
void imgconv(TCanvas *c, const TString &fname)
Float_t GetLeftMargin() const
This class displays a legend box (TPaveText) containing several legend entries.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
TString & ReplaceAll(const TString &s1, const TString &s2)
TFile * OpenFile(const TString &fin)
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 probas(TString dataset, TString fin="TMVA.root", Bool_t useTMVAStyle=kTRUE)
void SetSignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *all=0)
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
UInt_t GetListOfKeys(TList &keys, TString inherits, TDirectory *dir=0)
Short_t Min(Short_t a, Short_t b)
void SetMargin(Float_t margin)
Int_t getBackgroundLine()
void GetMethodTitle(TString &name, TKey *ikey)
Book space in a file, create I/O buffers, to fill them, (un)compress them.
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)}
char * Form(const char *fmt,...)
void plot_logo(Float_t v_scale=1.0, Float_t skew=1.0)
virtual TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory named "apath".
UInt_t GetListOfMethods(TList &methods, TDirectory *dir=0)
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 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)
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
const char * Data() const
UInt_t GetListOfTitles(TDirectory *rfdir, TList &titles)
virtual void SetLogy(Int_t value=1)
Set Lin/Log scale for Y.