Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
mvaeffs.h
Go to the documentation of this file.
1 #ifndef mvaeffs__HH
2 #define mvaeffs__HH
3 
4 #include "RQ_OBJECT.h"
5 #include "TCanvas.h"
6 #include "TFile.h"
7 #include "TGLabel.h"
8 #include "TGNumberEntry.h"
9 #include "TGWindow.h"
10 #include "TGaxis.h"
11 #include "TH1.h"
12 #include "TIterator.h"
13 #include "TLatex.h"
14 #include "TList.h"
15 
16 namespace TMVA{
17 
18  void mvaeffs(TString dataset, TString fin = "TMVA.root",
19  Bool_t useTMVAStyle = kTRUE, TString formula="S/sqrt(S+B)" );
20 
21  // this macro plots the signal and background efficiencies
22  // as a function of the MVA cut.
23 
24 
25  class MethodInfo : public TNamed {
26  public:
27  MethodInfo() :
28  methodName(""),
29  methodTitle(""),
30  sig(0),
31  bgd(0),
32  origSigE(0),
33  origBgdE(0),
34  sigE(0),
35  bgdE(0),
36  purS(0),
37  sSig(0),
38  effpurS(0),
39  canvas(0),
40  line1(0),
41  line2(0),
42  rightAxis(0),
43  maxSignificance(0),
44  maxSignificanceErr(0)
45  {}
46  virtual ~MethodInfo();
47 
48  TString methodName;
49  TString methodTitle;
50  TH1* sig;
51  TH1* bgd;
52  TH1* origSigE;
53  TH1* origBgdE;
54  TH1* sigE;
55  TH1* bgdE;
56  TH1* purS;
57  TH1* sSig;
58  TH1* effpurS;
59  TCanvas* canvas;
60  TLatex* line1;
61  TLatex* line2;
62  TGaxis* rightAxis;
63  Double_t maxSignificance;
64  Double_t maxSignificanceErr;
65 
66  void SetResultHists();
67 
68  ClassDef(MethodInfo,0);
69  };
70 
71  class StatDialogMVAEffs {
72 
73  RQ_OBJECT("StatDialogMVAEffs")
74 
75  public:
76 
77  StatDialogMVAEffs(TString ds,const TGWindow* p, Float_t ns, Float_t nb);
78  virtual ~StatDialogMVAEffs();
79 
80  void SetFormula(const TString& f) { fFormula = f; }
81  TString GetFormula();
82  TString GetFormulaString() { return fFormula; }
83  TString GetLatexFormula();
84 
85  void ReadHistograms(TFile* file);
86  void UpdateSignificanceHists();
87  void DrawHistograms();
88 
89  void RaiseDialog() { if (fMain) { fMain->RaiseWindow(); fMain->Layout(); fMain->MapWindow(); } }
90 
91  private:
92 
93  TGMainFrame *fMain;
94  Float_t fNSignal;
95  Float_t fNBackground;
96  TString fFormula;
97  TString dataset;
98  TList * fInfoList;
99 
100  TGNumberEntry* fSigInput;
101  TGNumberEntry* fBkgInput;
102 
103  TGHorizontalFrame* fButtons;
104  TGTextButton* fDrawButton;
105  TGTextButton* fCloseButton;
106 
107  Int_t maxLenTitle;
108 
109  void UpdateCanvases();
110 
111  public:
112 
113  // slots
114  void SetNSignal(); //*SIGNAL*
115  void SetNBackground(); //*SIGNAL*
116  void Redraw(); //*SIGNAL*
117  void Close(); //*SIGNAL*
118 
119  // result printing
120  void PrintResults( const MethodInfo* info );
121  };
122 
123 }
124 #endif