52 TString pname =
"purS_" + methodTitle;
53 TString epname =
"effpurS_" + methodTitle;
54 TString ssigname =
"significance_" + methodTitle;
56 sigE = (
TH1*)origSigE->
Clone(
"sigEffi");
57 bgdE = (
TH1*)origBgdE->Clone(
"bgdEffi");
60 Double_t low = sigE->GetBinLowEdge(1);
61 Double_t high = sigE->GetBinLowEdge(nbins+1);
62 purS =
new TH1F(pname, pname, nbins, low, high);
63 sSig =
new TH1F(ssigname, ssigname, nbins, low, high);
64 effpurS =
new TH1F(epname, epname, nbins, low, high);
67 sigE->SetTitle(
Form(
"Cut efficiencies for %s classifier", methodTitle.Data()) );
73 sigE->SetFillStyle( 0 );
74 bgdE->SetFillStyle( 0 );
75 sSig->SetFillStyle( 0 );
76 sigE->SetLineWidth( 3 );
77 bgdE->SetLineWidth( 3 );
78 sSig->SetLineWidth( 3 );
81 purS->SetFillStyle( 0 );
82 purS->SetLineWidth( 2 );
83 purS->SetLineStyle( 5 );
84 effpurS->SetFillStyle( 0 );
85 effpurS->SetLineWidth( 2 );
86 effpurS->SetLineStyle( 6 );
91 fNSignal = fSigInput->GetNumber();
96 fNBackground = fBkgInput->GetNumber();
119 UpdateSignificanceHists();
141 fSigInput->Disconnect();
142 fBkgInput->Disconnect();
143 fDrawButton->Disconnect();
144 fCloseButton->Disconnect();
146 fMain->CloseWindow();
201 fSigInput->
Connect(
"ValueSet(Long_t)",
"TMVA::StatDialogMVAEffs",
this,
"SetNSignal()");
202 fBkgInput->
Connect(
"ValueSet(Long_t)",
"TMVA::StatDialogMVAEffs",
this,
"SetNBackground()");
213 if (fInfoList==0)
return;
214 if (fInfoList->First()==0)
return;
236 if (cname.
Length() > maxLenTitle) maxLenTitle = cname.
Length();
237 TString str =
Form(
"%*s ( #signal, #backgr.) Optimal-cut %s NSig NBkg EffSig EffBkg",
238 maxLenTitle, cname.
Data(), GetFormulaString().Data() );
239 cout <<
"--- " << setfill(
'=') << setw(str.
Length()) <<
"" << setfill(
' ') << endl;
240 cout <<
"--- " << str << endl;
241 cout <<
"--- " << setfill(
'-') << setw(str.
Length()) <<
"" << setfill(
' ') << endl;
254 if (GetFormulaString() ==
"S/sqrt(B)") {
255 maxSigErr = sig *
sqrt( 1./S + 1./(2.*B));
267 PrintResults( info );
269 cout <<
"--- " << setfill(
'-') << setw(str.
Length()) <<
"" << setfill(
' ') << endl << endl;
283 fInfoList =
new TList;
291 if( !
gROOT->GetClass(key->GetClassName())->InheritsFrom(
"TDirectory") )
continue;
293 cout <<
"--- Found directory: " << ((
TDirectory*)key->ReadObj())->GetName() << endl;
299 while((titkey = (
TKey*)keyIt())) {
300 if( !
gROOT->GetClass(titkey->GetClassName())->InheritsFrom(
"TDirectory") )
continue;
310 cout <<
"--- Classifier: " << info->
methodTitle << endl;
312 info->
sig =
dynamic_cast<TH1*
>(titDir->
Get( hname +
"_S" ));
313 info->
bgd =
dynamic_cast<TH1*
>(titDir->
Get( hname +
"_B" ));
314 info->
origSigE =
dynamic_cast<TH1*
>(titDir->
Get( hname +
"_effS" ));
315 info->
origBgdE =
dynamic_cast<TH1*
>(titDir->
Get( hname +
"_effB" ));
319 fInfoList->Add(info);
328 Int_t countCanvas = 0;
331 const Int_t width = 600;
341 countCanvas*50+200, countCanvas*20, width,
Int_t(width*0.78) );
389 legend1->
AddEntry(info->
bgdE,
"Background efficiency",
"L");
390 legend1->
Draw(
"same");
400 legend2->
Draw(
"same");
415 info->
line1 = tl.
DrawLatex( 0.15, 0.23,
Form(
"For %1.0f signal and %1.0f background", fNSignal, fNBackground));
416 tl.
DrawLatex( 0.15, 0.19,
"events the maximum "+GetLatexFormula()+
" is");
432 tl.
DrawLatex( 0.13, 0.77,
"Method Cuts provides a bundle of cut selections, each tuned to a");
433 tl.
DrawLatex(0.13, 0.74,
"different signal efficiency. Shown is the purity for each cut selection.");
464 if (info->
line1 !=0 )
465 info->
line1->
SetText( 0.15, 0.23,
Form(
"For %1.0f signal and %1.0f background", fNSignal, fNBackground));
467 if (info->
line2 !=0 ) {
469 info->
line2->
SetText( 0.15, 0.15,
Form(
"%3.2g +- %3.2g when cutting at %3.2g",
482 TString opt =
Form(
"%%%is: (%%9.8g,%%9.8g) %%9.4f %%10.6g %%8.7g %%8.7g %%8.4g %%8.4g",
496 TString opt =
Form(
"%%%is: (%%9.8g,%%9.8g) %%9.4f (%%8.3g +-%%6.3g) %%8.7g %%8.7g %%8.4g %%8.4g",
virtual void SetLineWidth(Width_t lwidth)
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual void SetTickx(Int_t value=1)
void imgconv(TCanvas *c, const TString &fname)
TGNumberEntry * fBkgInput
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void SetMaximum(Double_t maximum=-1111)
This class displays a legend box (TPaveText) containing several legend entries.
virtual TList * GetListOfKeys() const
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
virtual Int_t GetMaximumBin() const
Return location of bin with maximum value in the range.
void SetTitleColor(Int_t titlecolor)
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
TString & ReplaceAll(const TString &s1, const TString &s2)
TFile * OpenFile(const TString &fin)
virtual TList * GetListOfKeys() const
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 mvaeffs(TString fin="TMVA.root", Bool_t useTMVAStyle=kTRUE, TString formula="S/sqrt(S+B)")
void Clone(Ssiz_t nc)
Make self a distinct copy with capacity of at least tot, where tot cannot be smaller than the current...
Double_t GetUymax() const
void SetSignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *all=0)
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
virtual void SetTitle(const char *title="")
Change the title of the axis.
void SetMargin(Float_t margin)
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual void SetLimits(ELimit limits=TGNumberFormat::kNELNoLimits, Double_t min=0, Double_t max=1)
virtual void SetFillStyle(Style_t fstyle)
virtual Int_t GetNbinsX() const
virtual ~StatDialogMVAEffs()
virtual Float_t GetTitleSize() const
void SetLineStyleString(Int_t i, const char *text)
Set line style string using the PostScript convention.
virtual void SetTopMargin(Float_t topmargin)
Set Pad top margin in fraction of the pad height.
void UpdateSignificanceHists()
const char * Data() const
void SetTitleSize(Float_t titlesize)
Float_t GetTopMargin() const
virtual void SetText(Double_t x, Double_t y, const char *text)
Float_t GetRightMargin() const
virtual void Paint(Option_t *option="")
Paint canvas.
TGTextButton * fDrawButton
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)
To draw Mathematical Formula.
void GetMethodTitle(TString &name, TKey *ikey)
StatDialogMVAEffs(const TGWindow *p, Float_t ns, Float_t nb)
TLatex * DrawLatex(Double_t x, Double_t y, const char *text)
Make a copy of this object with the new parameters And copy object attributes.
std::vector< std::vector< double > > Data
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
void GetMethodName(TString &name, TKey *mkey)
Book space in a file, create I/O buffers, to fill them, (un)compress them.
TStyle objects may be created to define special styles.
virtual void SetLineColor(Color_t lcolor)
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
void PrintResults(const MethodInfo *info)
void Initialize(Bool_t useTMVAStyle=kTRUE)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
TGNumberEntry * fSigInput
virtual void SetTicky(Int_t value=1)
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
char * Form(const char *fmt,...)
void ReadHistograms(TFile *file)
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb"...
Double_t GetUxmax() const
void SetWmax(Double_t wmax)
void SetFormula(const TString &f)
Float_t GetLeftMargin() const
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Describe directory structure in memory.
Double_t GetUymin() const
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void SetTicks(Int_t valuex=1, Int_t valuey=1)
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual void SetRightMargin(Float_t rightmargin)
Set Pad right margin in fraction of the pad width.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
TGTextButton * fCloseButton
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TGHorizontalFrame * fButtons
void SetLabelColor(Int_t labelcolor)
virtual void SetTitle(const char *title)
Change (i.e.
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void SetTextSize(Float_t tsize=1)
virtual void Update()
Update canvas pad buffers.
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 void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
void Modified(Bool_t flag=1)
virtual void SetBorderSize(Int_t bordersize=4)
Double_t maxSignificanceErr
TString GetLatexFormula()