Logo ROOT   6.10/09
Reference Guide
mvaeffs.h
Go to the documentation of this file.
1 #ifndef mvaeffs__HH
2 #define mvaeffs__HH
3 #include <iostream>
4 #include <iomanip>
5 using std::cout;
6 using std::endl;
7 
8 #include "tmvaglob.h"
9 
10 #include "RQ_OBJECT.h"
11 
12 #include "TH1.h"
13 #include "TROOT.h"
14 #include "TList.h"
15 #include "TIterator.h"
16 #include "TStyle.h"
17 #include "TPad.h"
18 #include "TCanvas.h"
19 #include "TLatex.h"
20 #include "TLegend.h"
21 #include "TLine.h"
22 #include "TH2.h"
23 #include "TFormula.h"
24 #include "TFile.h"
25 #include "TApplication.h"
26 #include "TKey.h"
27 #include "TClass.h"
28 #include "TGaxis.h"
29 
30 #include "TGWindow.h"
31 #include "TGButton.h"
32 #include "TGLabel.h"
33 #include "TGNumberEntry.h"
34 
35 namespace TMVA{
36 
37  void mvaeffs(TString dataset, TString fin = "TMVA.root",
38  Bool_t useTMVAStyle = kTRUE, TString formula="S/sqrt(S+B)" );
39 
40  // this macro plots the signal and background efficiencies
41  // as a function of the MVA cut.
42 
43 
44  class MethodInfo : public TNamed {
45  public:
47  methodName(""),
48  methodTitle(""),
49  sig(0),
50  bgd(0),
51  origSigE(0),
52  origBgdE(0),
53  sigE(0),
54  bgdE(0),
55  purS(0),
56  sSig(0),
57  effpurS(0),
58  canvas(0),
59  line1(0),
60  line2(0),
61  rightAxis(0),
62  maxSignificance(0),
64  {}
65  virtual ~MethodInfo();
66 
69  TH1* sig;
70  TH1* bgd;
76  TH1* sSig;
84 
85  void SetResultHists();
86 
88  };
89 
91 
92  RQ_OBJECT("StatDialogMVAEffs")
93 
94  public:
95 
96  StatDialogMVAEffs(TString ds,const TGWindow* p, Float_t ns, Float_t nb);
97  virtual ~StatDialogMVAEffs();
98 
99  void SetFormula(const TString& f) { fFormula = f; }
100  TString GetFormula();
101  TString GetFormulaString() { return fFormula; }
102  TString GetLatexFormula();
103 
104  void ReadHistograms(TFile* file);
105  void UpdateSignificanceHists();
106  void DrawHistograms();
107 
108  void RaiseDialog() { if (fMain) { fMain->RaiseWindow(); fMain->Layout(); fMain->MapWindow(); } }
109 
110  private:
111 
118 
121 
125 
127 
128  void UpdateCanvases();
129 
130  public:
131 
132  // slots
133  void SetNSignal(); //*SIGNAL*
134  void SetNBackground(); //*SIGNAL*
135  void Redraw(); //*SIGNAL*
136  void Close(); //*SIGNAL*
137 
138  // result printing
139  void PrintResults( const MethodInfo* info );
140  };
141 
142 }
143 #endif
TGNumberEntry * fBkgInput
Definition: mvaeffs.h:120
TH1 * effpurS
Definition: mvaeffs.h:77
float Float_t
Definition: RtypesCore.h:53
TLatex * line2
Definition: mvaeffs.h:80
void mvaeffs(TString dataset, TString fin="TMVA.root", Bool_t useTMVAStyle=kTRUE, TString formula="S/sqrt(S+B)")
TLatex * line1
Definition: mvaeffs.h:79
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:46
Basic string class.
Definition: TString.h:129
TCanvas * canvas
Definition: mvaeffs.h:78
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual ~MethodInfo()
Definition: mvaeffs.cxx:39
TString methodName
Definition: mvaeffs.h:67
#define ClassDef(name, id)
Definition: Rtypes.h:297
TGTextButton * fDrawButton
Definition: mvaeffs.h:123
TString methodTitle
Definition: mvaeffs.h:68
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
To draw Mathematical Formula.
Definition: TLatex.h:18
TString GetFormulaString()
Definition: mvaeffs.h:101
A doubly linked list.
Definition: TList.h:43
TGNumberEntry * fSigInput
Definition: mvaeffs.h:119
The axis painter class.
Definition: TGaxis.h:24
#define RQ_OBJECT(sender_class)
Definition: RQ_OBJECT.h:87
TGaxis * rightAxis
Definition: mvaeffs.h:81
void SetFormula(const TString &f)
Definition: mvaeffs.h:99
The Canvas class.
Definition: TCanvas.h:31
double f(double x)
TH1 * origSigE
Definition: mvaeffs.h:71
double Double_t
Definition: RtypesCore.h:55
The TH1 histogram class.
Definition: TH1.h:56
Double_t maxSignificance
Definition: mvaeffs.h:82
TH1 * origBgdE
Definition: mvaeffs.h:72
TGTextButton * fCloseButton
Definition: mvaeffs.h:124
Abstract ClassifierFactory template that handles arbitrary types.
Definition: file.py:1
TGHorizontalFrame * fButtons
Definition: mvaeffs.h:122
TGMainFrame * fMain
Definition: mvaeffs.h:112
const Bool_t kTRUE
Definition: RtypesCore.h:91
void SetResultHists()
Definition: mvaeffs.cxx:50
Double_t maxSignificanceErr
Definition: mvaeffs.h:83