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");
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;
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.
image html pict1_TGaxis_012 png width
Define new text attributes for the label number "labNum".
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.