Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
mvaeffs.cxx
Go to the documentation of this file.
1#include "TCanvas.h"
2#include "TFile.h"
3#include "TFormula.h"
4#include "TGButton.h"
5#include "TGLabel.h"
6#include "TGNumberEntry.h"
7#include "TGWindow.h"
8#include "TGaxis.h"
9#include "TH1.h"
10#include "TIterator.h"
11#include "TKey.h"
12#include "TLatex.h"
13#include "TLegend.h"
14#include "TLine.h"
15#include "TList.h"
16#include "TMVA/mvaeffs.h"
17#include "TMVA/tmvaglob.h"
18#include "TROOT.h"
19#include "TError.h"
20#include "TApplication.h"
21
22#include <iomanip>
23#include <iostream>
24
25using std::cout;
26using std::endl;
27using std::setfill;
28using std::setw;
29
30// this macro plots the signal and background efficiencies
31// as a function of the MVA cut.
32
34{
35 delete sigE;
36 delete bgdE;
37 delete purS;
38 delete sSig;
39 delete effpurS;
40 if(gROOT->GetListOfCanvases()->FindObject(canvas))
41 delete canvas;
42}
43
45{
46 TString pname = "purS_" + methodTitle;
47 TString epname = "effpurS_" + methodTitle;
48 TString ssigname = "significance_" + methodTitle;
49
50 sigE = (TH1*)origSigE->Clone("sigEffi");
51 bgdE = (TH1*)origBgdE->Clone("bgdEffi");
52
53 Int_t nbins = sigE->GetNbinsX();
54 Double_t low = sigE->GetBinLowEdge(1);
55 Double_t high = sigE->GetBinLowEdge(nbins+1);
56 purS = new TH1F(pname, pname, nbins, low, high);
57 sSig = new TH1F(ssigname, ssigname, nbins, low, high);
58 effpurS = new TH1F(epname, epname, nbins, low, high);
59
60 // chop off useless stuff
61 sigE->SetTitle( TString::Format("Cut efficiencies for %s classifier", methodTitle.Data()) );
62
63 // set the histogram style
67 sigE->SetFillStyle( 0 );
68 bgdE->SetFillStyle( 0 );
69 sSig->SetFillStyle( 0 );
70 sigE->SetLineWidth( 3 );
71 bgdE->SetLineWidth( 3 );
72 sSig->SetLineWidth( 3 );
73
74 // the purity and quality
75 purS->SetFillStyle( 0 );
76 purS->SetLineWidth( 2 );
77 purS->SetLineStyle( 5 );
78 effpurS->SetFillStyle( 0 );
79 effpurS->SetLineWidth( 2 );
80 effpurS->SetLineStyle( 6 );
81}
82
84{
85 fNSignal = fSigInput->GetNumber();
86}
87
89{
90 fNBackground = fBkgInput->GetNumber();
91}
92
94{
95 // replace all occurrence of S and B but only if neighbours are not alphanumerics
96 auto replace_vars = [](TString & f, char oldLetter, char newLetter ) {
97 auto pos = f.First(oldLetter);
98 while(pos != kNPOS) {
99 if ( ( pos > 0 && !TString(f[pos-1]).IsAlpha() ) ||
100 ( pos < f.Length()-1 && !TString(f[pos+1]).IsAlpha() ) )
101 {
102 f[pos] = newLetter;
103 }
104 int pos2 = pos+1;
105 pos = f.Index(oldLetter,pos2);
106 }
107 };
108
109 TString formula = fFormula;
110 replace_vars(formula,'S','x');
111 replace_vars(formula,'B','y');
112 // f.ReplaceAll("S","x");
113 // f.ReplaceAll("B","y");
114 return formula;
115}
116
117
119{
120 TString f = fFormula;
121 f.ReplaceAll("(","{");
122 f.ReplaceAll(")","}");
123 f.ReplaceAll("sqrt","#sqrt");
124 return f;
125}
126
128{
129 SetNSignal();
130 SetNBackground();
131 UpdateSignificanceHists();
132 UpdateCanvases();
133}
134
136{
137 delete this;
138}
139
141{
142 if (fInfoList) {
143 TIter next(fInfoList);
144 MethodInfo *info(0);
145 while ( (info = (MethodInfo*)next()) ) {
146 delete info;
147 }
148 delete fInfoList;
149 fInfoList=0;
150 }
151
152 // in case of batch mode fMain is a nullptr
153 if (fMain) {
154
155 fSigInput->Disconnect();
156 fBkgInput->Disconnect();
157 fDrawButton->Disconnect();
158 fCloseButton->Disconnect();
159
160 fMain->CloseWindow();
161 fMain->Cleanup();
162 fMain = 0;
163 }
164}
165
167 fNSignal(ns),
168 fNBackground(nb),
169 fFormula(""),
170 dataset(ds),
171 fInfoList(0),
172 fSigInput(0),
173 fBkgInput(0),
174 fButtons(0),
175 fDrawButton(0),
176 fCloseButton(0),
177 maxLenTitle(0)
178{
179 // only in interactive mode
180 if (p != nullptr) {
181 UInt_t totalWidth = 500;
182 UInt_t totalHeight = 300;
183
184 // main frame
185 fMain = new TGMainFrame(p, totalWidth, totalHeight, kMainFrame | kVerticalFrame);
186
187 TGLabel *sigLab = new TGLabel(fMain, "Signal events");
188 fMain->AddFrame(sigLab, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5));
189
193 fSigInput->Resize(100, 24);
194
195 TGLabel *bkgLab = new TGLabel(fMain, "Background events");
196 fMain->AddFrame(bkgLab, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5));
197
201 fBkgInput->Resize(100, 24);
202
203 fButtons = new TGHorizontalFrame(fMain, totalWidth, 30);
204
205 fCloseButton = new TGTextButton(fButtons, "&Close");
207
208 fDrawButton = new TGTextButton(fButtons, "&Draw");
210
212
213 fMain->SetWindowName("Significance");
214 fMain->SetWMPosition(0, 0);
217 fMain->MapWindow();
218
219 fSigInput->Connect("ValueSet(Long_t)", "TMVA::StatDialogMVAEffs", this, "SetNSignal()");
220 fBkgInput->Connect("ValueSet(Long_t)", "TMVA::StatDialogMVAEffs", this, "SetNBackground()");
221
222 // fDrawButton->Connect("Clicked()","TGNumberEntry",fSigInput, "ValueSet(Long_t)");
223 // fDrawButton->Connect("Clicked()","TGNumberEntry",fBkgInput, "ValueSet(Long_t)");
224 fDrawButton->Connect("Clicked()", "TMVA::StatDialogMVAEffs", this, "Redraw()");
225
226 fCloseButton->Connect("Clicked()", "TMVA::StatDialogMVAEffs", this, "Close()");
227 }
228}
229
231{
232 if (fInfoList==0) return;
233 if (fInfoList->First()==0) return;
234 MethodInfo* info = (MethodInfo*)fInfoList->First();
235 if ( info->canvas==0 ) {
236 DrawHistograms();
237 return;
238 }
239 TIter next(fInfoList);
240 while ( (info = (MethodInfo*)next()) ) {
241 info->canvas->Update();
242 info->rightAxis->SetWmax(1.1*info->maxSignificance);
243 info->canvas->Modified(kTRUE);
244 info->canvas->Update();
245 info->canvas->Paint();
246 }
247}
248
250{
251 TFormula f("sigf",GetFormula());
252 TIter next(fInfoList);
253 MethodInfo* info(0);
254 TString cname = "Classifier";
255 if (cname.Length() > maxLenTitle) maxLenTitle = cname.Length();
256 TString str = TString::Format( "%*s ( #signal, #backgr.) Optimal-cut %s NSig NBkg EffSig EffBkg",
257 maxLenTitle, cname.Data(), GetFormulaString().Data() );
258 cout << "--- " << setfill('=') << setw(str.Length()) << "" << setfill(' ') << endl;
259 cout << "--- " << str << endl;
260 cout << "--- " << setfill('-') << setw(str.Length()) << "" << setfill(' ') << endl;
261 Double_t maxSig = -1;
262 Double_t maxSigErr = -1;
263 while ((info = (MethodInfo*)next())) {
264 for (Int_t i=1; i<=info->origSigE->GetNbinsX(); i++) {
265 Float_t eS = info->origSigE->GetBinContent( i );
266 Float_t S = eS * fNSignal;
267 Float_t B = info->origBgdE->GetBinContent( i ) * fNBackground;
268 info->purS->SetBinContent( i, (S+B==0)?0:S/(S+B) );
269
270 Double_t sig = f.Eval(S,B);
271 if (sig > maxSig) {
272 maxSig = sig;
273 if (GetFormulaString() == "S/sqrt(B)") {
274 maxSigErr = sig * sqrt( 1./S + 1./(2.*B));
275 }
276 }
277 info->sSig->SetBinContent( i, sig );
278 info->effpurS->SetBinContent( i, eS*info->purS->GetBinContent( i ) );
279 }
280
281 info->maxSignificance = info->sSig->GetMaximum();
282 info->maxSignificanceErr = (maxSigErr > 0) ? maxSigErr : 0;
283 info->sSig->Scale(1/info->maxSignificance);
284
285 // update the text in the lower left corner
286 PrintResults( info );
287 }
288 cout << "--- " << setfill('-') << setw(str.Length()) << "" << setfill(' ') << endl << endl;
289}
290
292{
293 if (fInfoList) {
294 TIter next(fInfoList);
295 MethodInfo *info(0);
296 while ( (info = (MethodInfo*)next()) ) {
297 delete info;
298 }
299 delete fInfoList;
300 fInfoList=0;
301 }
302 fInfoList = new TList;
303
304 // search for the right histograms in full list of keys
305 TIter next(file->GetDirectory(dataset.Data())->GetListOfKeys());
306 TKey *key(0);
307 while( (key = (TKey*)next()) ) {
308
309 if (!TString(key->GetName()).BeginsWith("Method_")) continue;
310 if( ! gROOT->GetClass(key->GetClassName())->InheritsFrom("TDirectory") ) continue;
311
312 cout << "--- Found directory: " << ((TDirectory*)key->ReadObj())->GetName() << endl;
313
314 TDirectory* mDir = (TDirectory*)key->ReadObj();
315
316 TIter keyIt(mDir->GetListOfKeys());
317 TKey *titkey;
318 while((titkey = (TKey*)keyIt())) {
319 if( ! gROOT->GetClass(titkey->GetClassName())->InheritsFrom("TDirectory") ) continue;
320
321 MethodInfo* info = new MethodInfo();
322 TDirectory* titDir = (TDirectory *)titkey->ReadObj();
323
326 if (info->methodTitle.Length() > maxLenTitle) maxLenTitle = info->methodTitle.Length();
327 TString hname = "MVA_" + info->methodTitle;
328
329 cout << "--- Classifier: " << info->methodTitle << endl;
330
331 info->sig = dynamic_cast<TH1*>(titDir->Get( hname + "_S" ));
332 info->bgd = dynamic_cast<TH1*>(titDir->Get( hname + "_B" ));
333 info->origSigE = dynamic_cast<TH1*>(titDir->Get( hname + "_effS" ));
334 info->origBgdE = dynamic_cast<TH1*>(titDir->Get( hname + "_effB" ));
335 if (info->origSigE==0 || info->origBgdE==0) { delete info; continue; }
336
337 info->SetResultHists();
338 fInfoList->Add(info);
339 }
340 }
341 return;
342}
343
345{
346 // counter variables
347 Int_t countCanvas = 0;
348
349 // define Canvas layout here!
350 const Int_t width = 600; // size of canvas
351 Int_t signifColor = TColor::GetColor( "#00aa00" );
352
353 TIter next(fInfoList);
354 MethodInfo* info = nullptr;
355 while ( (info = (MethodInfo*)next()) ) {
356
357 // create new canvas
358 TCanvas *c = new TCanvas( TString::Format("canvas%d", countCanvas+1),
359 TString::Format("Cut efficiencies for %s classifier",info->methodTitle.Data()),
360 countCanvas*50+200, countCanvas*20, width, Int_t(width*0.78) );
361 info->canvas = c;
362
363 // draw grid
364 c->SetGrid(1);
365 c->SetTickx(0);
366 c->SetTicky(0);
367
368 TStyle *TMVAStyle = gROOT->GetStyle("Plain"); // our style is based on Plain
369 TMVAStyle->SetLineStyleString( 5, "[32 22]" );
370 TMVAStyle->SetLineStyleString( 6, "[12 22]" );
371
372 c->SetTopMargin(.2);
373
374 // and the signal purity and quality
375 info->effpurS->SetTitle("Cut efficiencies and optimal cut value");
376 if (info->methodTitle.Contains("Cuts")) {
377 info->effpurS->GetXaxis()->SetTitle( "Signal Efficiency" );
378 }
379 else {
380 info->effpurS->GetXaxis()->SetTitle( TString("Cut value applied on ") + info->methodTitle + " output" );
381 }
382 info->effpurS->GetYaxis()->SetTitle( "Efficiency (Purity)" );
384
385 c->SetTicks(0,0);
386 c->SetRightMargin ( 2.0 );
387
388 info->effpurS->SetMaximum(1.1);
389 info->effpurS->Draw("histl");
390
391 info->purS->Draw("samehistl");
392
393 // overlay signal and background histograms
394 info->sigE->Draw("samehistl");
395 info->bgdE->Draw("samehistl");
396
397 info->sSig->SetLineColor( signifColor );
398 info->sSig->Draw("samehistl");
399
400 // redraw axes
401 info->effpurS->Draw( "sameaxis" );
402
403 // Draw legend
404 TLegend *legend1= new TLegend( c->GetLeftMargin(), 1 - c->GetTopMargin(),
405 c->GetLeftMargin() + 0.4, 1 - c->GetTopMargin() + 0.12 );
406 legend1->SetFillStyle( 1 );
407 legend1->AddEntry(info->sigE,"Signal efficiency","L");
408 legend1->AddEntry(info->bgdE,"Background efficiency","L");
409 legend1->Draw("same");
410 legend1->SetBorderSize(1);
411 legend1->SetMargin( 0.3 );
412
413 TLegend *legend2= new TLegend( c->GetLeftMargin() + 0.4, 1 - c->GetTopMargin(),
414 1 - c->GetRightMargin(), 1 - c->GetTopMargin() + 0.12 );
415 legend2->SetFillStyle( 1 );
416 legend2->AddEntry(info->purS,"Signal purity","L");
417 legend2->AddEntry(info->effpurS,"Signal efficiency*purity","L");
418 legend2->AddEntry(info->sSig,GetLatexFormula().Data(),"L");
419 legend2->Draw("same");
420 legend2->SetBorderSize(1);
421 legend2->SetMargin( 0.3 );
422
423 // line to indicate maximum efficiency
424 TLine* effline = new TLine( info->sSig->GetXaxis()->GetXmin(), 1, info->sSig->GetXaxis()->GetXmax(), 1 );
425 effline->SetLineWidth( 1 );
426 effline->SetLineColor( 1 );
427 effline->Draw();
428
429 // print comments
430 TLatex tl;
431 tl.SetNDC();
432 tl.SetTextSize( 0.033 );
433 Int_t maxbin = info->sSig->GetMaximumBin();
434 info->line1 = tl.DrawLatex( 0.15, 0.23, TString::Format("For %1.0f signal and %1.0f background", fNSignal, fNBackground));
435 tl.DrawLatex( 0.15, 0.19, "events the maximum "+GetLatexFormula()+" is");
436
437 if (info->maxSignificanceErr > 0) {
438 info->line2 = tl.DrawLatex( 0.15, 0.15, TString::Format("%5.2f +- %4.2f when cutting at %5.2f",
439 info->maxSignificance,
440 info->maxSignificanceErr,
441 info->sSig->GetXaxis()->GetBinCenter(maxbin)) );
442 }
443 else {
444 info->line2 = tl.DrawLatex( 0.15, 0.15, TString::Format("%4.2f when cutting at %5.2f",
445 info->maxSignificance,
446 info->sSig->GetXaxis()->GetBinCenter(maxbin)) );
447 }
448
449 // add comment for Method cuts
450 if (info->methodTitle.Contains("Cuts")){
451 tl.DrawLatex( 0.13, 0.77, "Method Cuts provides a bundle of cut selections, each tuned to a");
452 tl.DrawLatex(0.13, 0.74, "different signal efficiency. Shown is the purity for each cut selection.");
453 }
454 // save canvas to file
455 c->Update();
456
457 // Draw second axes
458 info->rightAxis = new TGaxis(c->GetUxmax(), c->GetUymin(),
459 c->GetUxmax(), c->GetUymax(),0,1.1*info->maxSignificance,510,"+L");
460 info->rightAxis->SetLineColor ( signifColor );
461 info->rightAxis->SetLabelColor( signifColor );
462 info->rightAxis->SetTitleColor( signifColor );
463
464 info->rightAxis->SetTitleSize( info->sSig->GetXaxis()->GetTitleSize() );
465 info->rightAxis->SetTitle( "Significance" );
466 info->rightAxis->Draw();
467
468 c->Update();
469
470 // switches
471 const Bool_t Save_Images = kTRUE;
472
473 if (Save_Images) {
474 TMVAGlob::imgconv( c, TString::Format("%s/plots/mvaeffs_%s",dataset.Data(), info->methodTitle.Data()) );
475 }
476 countCanvas++;
477 }
478}
479
481{
482 Int_t maxbin = info->sSig->GetMaximumBin();
483 if (info->line1 !=0 )
484 info->line1->SetText( 0.15, 0.23, TString::Format("For %1.0f signal and %1.0f background", fNSignal, fNBackground));
485
486 if (info->line2 !=0 ) {
487 if (info->maxSignificanceErr > 0) {
488 info->line2->SetText( 0.15, 0.15, TString::Format("%3.2g +- %3.2g when cutting at %3.2g",
489 info->maxSignificance,
490 info->maxSignificanceErr,
491 info->sSig->GetXaxis()->GetBinCenter(maxbin)) );
492 }
493 else {
494 info->line2->SetText( 0.15, 0.15, TString::Format("%3.4f when cutting at %3.4f", info->maxSignificance,
495 info->sSig->GetXaxis()->GetBinCenter(maxbin)) );
496 }
497
498 }
499
500 if (info->maxSignificanceErr <= 0) {
501 TString opt = TString::Format( "%%%is: (%%9.8g,%%9.8g) %%9.4f %%10.6g %%8.7g %%8.7g %%8.4g %%8.4g",
502 maxLenTitle );
503 cout << "--- "
504 << Form( opt.Data(),
505 info->methodTitle.Data(), fNSignal, fNBackground,
506 info->sSig->GetXaxis()->GetBinCenter( maxbin ),
507 info->maxSignificance,
508 info->origSigE->GetBinContent( maxbin )*fNSignal,
509 info->origBgdE->GetBinContent( maxbin )*fNBackground,
510 info->origSigE->GetBinContent( maxbin ),
511 info->origBgdE->GetBinContent( maxbin ) )
512 << endl;
513 }
514 else {
515 TString opt = TString::Format( "%%%is: (%%9.8g,%%9.8g) %%9.4f (%%8.3g +-%%6.3g) %%8.7g %%8.7g %%8.4g %%8.4g",
516 maxLenTitle );
517 cout << "--- "
518 << Form( opt.Data(),
519 info->methodTitle.Data(), fNSignal, fNBackground,
520 info->sSig->GetXaxis()->GetBinCenter( maxbin ),
521 info->maxSignificance,
522 info->maxSignificanceErr,
523 info->origSigE->GetBinContent( maxbin )*fNSignal,
524 info->origBgdE->GetBinContent( maxbin )*fNBackground,
525 info->origSigE->GetBinContent( maxbin ),
526 info->origBgdE->GetBinContent( maxbin ) )
527 << endl;
528 }
529}
530
531void TMVA::mvaeffs(TString dataset, TString fin, Float_t nsignal, Float_t nbackground, Bool_t useTMVAStyle,
532 TString formula)
533{
534 TMVAGlob::Initialize( useTMVAStyle );
535
536 TGClient *graphicsClient = TGClient::Instance();
537 if (graphicsClient == nullptr && !gROOT->IsBatch()) {
538 if (gApplication == nullptr)
539 // When using mvaeffs in a stand-alone macro, and batch mode is not set
540 Info("mvaeffs","GUI is not initialized, because TApplication is not started. Running as in batch mode");
541 else {
542 // gTAPPlication has started but `TGClient::Instance` is a nullptr. Should not happen
543 Error("mvaeffs", "TApplication is present but TGCLient instance is a nullptr");
544 return;
545 }
546 }
547
548 StatDialogMVAEffs* gGui = new StatDialogMVAEffs(dataset,
549 (graphicsClient) ? graphicsClient->GetRoot() : nullptr, nsignal, nbackground);
550
551
552 TFile* file = TMVAGlob::OpenFile( fin );
553 gGui->ReadHistograms(file);
554 gGui->SetFormula(formula);
555 gGui->UpdateSignificanceHists();
556 gGui->DrawHistograms();
557 if (!gROOT->IsBatch()) gGui->RaiseDialog();
558}
@ kVerticalFrame
Definition GuiTypes.h:381
@ kMainFrame
Definition GuiTypes.h:380
#define f(i)
Definition RSha256.hxx:104
#define c(i)
Definition RSha256.hxx:101
float Float_t
Definition RtypesCore.h:57
constexpr Ssiz_t kNPOS
Definition RtypesCore.h:117
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
R__EXTERN TApplication * gApplication
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Definition TError.cxx:218
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:185
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t width
#define gROOT
Definition TROOT.h:406
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2489
virtual Float_t GetTitleSize() const
Definition TAttAxis.h:44
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition TAttFill.h:39
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition TAttLine.h:43
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:40
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition TAttText.h:47
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Definition TAxis.cxx:473
Double_t GetXmax() const
Definition TAxis.h:142
Double_t GetXmin() const
Definition TAxis.h:141
The Canvas class.
Definition TCanvas.h:23
void Paint(Option_t *option="") override
Paint canvas.
Definition TCanvas.cxx:1543
void Update() override
Update canvas pad buffers.
Definition TCanvas.cxx:2489
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1921
TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory") override
Find a directory named "apath".
Describe directory structure in memory.
Definition TDirectory.h:45
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual TList * GetListOfKeys() const
Definition TDirectory.h:223
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:53
The Formula class.
Definition TFormula.h:89
Window client.
Definition TGClient.h:37
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition TGClient.cxx:224
static TGClient * Instance()
Returns global gClient (initialize graphics first, if not already done)
Definition TGClient.cxx:93
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:316
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
void MapWindow() override
map window
Definition TGFrame.h:204
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:385
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:397
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition TGFrame.cxx:1881
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1788
TGNumberEntry is a number entry input widget with up/down buttons.
virtual void SetLimits(ELimit limits=TGNumberFormat::kNELNoLimits, Double_t min=0, Double_t max=1)
@ kNELLimitMin
Lower limit only.
Yield an action as soon as it is clicked.
Definition TGButton.h:142
ROOT GUI Window base class.
Definition TGWindow.h:23
The axis painter class.
Definition TGaxis.h:24
void SetTitleSize(Float_t titlesize)
Definition TGaxis.h:129
virtual void SetTitle(const char *title="")
Change the title of the axis.
Definition TGaxis.cxx:2942
void SetWmax(Double_t wmax)
Definition TGaxis.h:133
void SetLabelColor(Int_t labelcolor)
Definition TGaxis.h:104
void SetTitleColor(Int_t titlecolor)
Definition TGaxis.h:131
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:623
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
void SetTitle(const char *title) override
Change/set the title.
Definition TH1.cxx:6747
TAxis * GetXaxis()
Definition TH1.h:325
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...
Definition TH1.cxx:8578
virtual Int_t GetNbinsX() const
Definition TH1.h:298
virtual void SetMaximum(Double_t maximum=-1111)
Definition TH1.h:405
TAxis * GetYaxis()
Definition TH1.h:326
void Draw(Option_t *option="") override
Draw this histogram with options.
Definition TH1.cxx:3068
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...
Definition TH1.cxx:9255
virtual Int_t GetMaximumBin() const
Return location of bin with maximum value in the range.
Definition TH1.cxx:8610
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition TH1.cxx:5090
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
Definition TH1.cxx:6633
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition TKey.h:28
virtual const char * GetClassName() const
Definition TKey.h:75
virtual TObject * ReadObj()
To read a TObject* from the file.
Definition TKey.cxx:758
To draw Mathematical Formula.
Definition TLatex.h:18
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.
Definition TLatex.cxx:1943
This class displays a legend box (TPaveText) containing several legend entries.
Definition TLegend.h:23
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Definition TLegend.cxx:320
void Draw(Option_t *option="") override
Draw this legend with its current attributes.
Definition TLegend.cxx:425
void SetMargin(Float_t margin)
Definition TLegend.h:69
Use the TLine constructor to create a simple line.
Definition TLine.h:22
A doubly linked list.
Definition TList.h:38
virtual ~MethodInfo()
Definition mvaeffs.cxx:33
TString methodTitle
Definition mvaeffs.h:50
TCanvas * canvas
Definition mvaeffs.h:60
TGaxis * rightAxis
Definition mvaeffs.h:63
TLatex * line1
Definition mvaeffs.h:61
void SetResultHists()
Definition mvaeffs.cxx:44
Double_t maxSignificanceErr
Definition mvaeffs.h:65
TLatex * line2
Definition mvaeffs.h:62
Double_t maxSignificance
Definition mvaeffs.h:64
TString methodName
Definition mvaeffs.h:49
TGTextButton * fCloseButton
Definition mvaeffs.h:106
void ReadHistograms(TFile *file)
Definition mvaeffs.cxx:291
virtual ~StatDialogMVAEffs()
Definition mvaeffs.cxx:140
void PrintResults(const MethodInfo *info)
Definition mvaeffs.cxx:480
TGHorizontalFrame * fButtons
Definition mvaeffs.h:104
StatDialogMVAEffs(TString ds, const TGWindow *p, Float_t ns, Float_t nb)
Definition mvaeffs.cxx:166
TGNumberEntry * fSigInput
Definition mvaeffs.h:101
TGMainFrame * fMain
Definition mvaeffs.h:94
TGTextButton * fDrawButton
Definition mvaeffs.h:105
TGNumberEntry * fBkgInput
Definition mvaeffs.h:102
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:164
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition TObject.cxx:292
void SetGrid(Int_t valuex=1, Int_t valuey=1) override
Definition TPad.h:335
void Modified(Bool_t flag=true) override
Mark pad modified Will be repainted when TCanvas::Update() will be called next time.
Definition TPad.cxx:7388
virtual void SetBorderSize(Int_t bordersize=4)
Sets the border size of the TPave box and shadow.
Definition TPave.h:77
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.
Definition TQObject.cxx:869
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:417
Ssiz_t First(char c) const
Find first occurrence of a character c.
Definition TString.cxx:538
const char * Data() const
Definition TString.h:376
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition TString.h:704
Bool_t IsAlpha() const
Returns true if all characters in string are alphabetic.
Definition TString.cxx:1798
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition TString.h:623
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2378
void Clone(Ssiz_t nc)
Make self a distinct copy with capacity of at least tot, where tot cannot be smaller than the current...
Definition TString.cxx:1279
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:632
TStyle objects may be created to define special styles.
Definition TStyle.h:29
void SetLineStyleString(Int_t i, const char *text)
Set line style string using the PostScript convention.
Definition TStyle.cxx:1483
virtual void SetText(Double_t x, Double_t y, const char *text)
Definition TText.h:74
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
Definition TText.cxx:823
void Initialize(Bool_t useTMVAStyle=kTRUE)
Definition tmvaglob.cxx:176
void GetMethodTitle(TString &name, TKey *ikey)
Definition tmvaglob.cxx:348
void SetSignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *all=nullptr)
Definition tmvaglob.cxx:8
TFile * OpenFile(const TString &fin)
Definition tmvaglob.cxx:192
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
Definition tmvaglob.cxx:77
void GetMethodName(TString &name, TKey *mkey)
Definition tmvaglob.cxx:342
void imgconv(TCanvas *c, const TString &fname)
Definition tmvaglob.cxx:212
void mvaeffs(TString dataset, TString fin="TMVA.root", Float_t nSignal=1000, Float_t nBackground=1000, Bool_t useTMVAStyle=kTRUE, TString formula="S/sqrt(S+B)")