ROOT  6.06/09
Reference Guide
ROCCalc.h
Go to the documentation of this file.
1 #ifndef ROOT_TMVA_ROCCalc
2 #define ROOT_TMVA_ROCCalc
3 #include <vector>
4 #include <sstream>
5 #include <iostream>
6 #include <iomanip>
7 
8 class TList;
9 class TTree;
10 class TString;
11 class TH1;
12 class TH2;
13 class TH2F;
14 class TSpline;
15 class TSpline1;
16 
17 namespace TMVA {
18 
19  class MsgLogger;
20 
21 
22  class ROCCalc {
23 
24  public:
25  ROCCalc(TH1* mvaS, TH1* mvaB);
26 
27  ~ROCCalc();
28 
29 
30  TH1D* GetROC();
31  // return the signal eff for a given backgr. efficiency
32  Double_t GetEffSForEffBof(Double_t effBref, Double_t &effSerr);
33  // return the cut value
35  // return the area under the ROC curve
37  // return the statistical significance as function of the mva cut value
38  TH1* GetSignificance( Int_t nStot, Int_t nBtot);
39  TH1* GetPurity(Int_t nStot, Int_t nBtot);
40 
41  void ApplySignalAndBackgroundStyle( TH1* sig, TH1* bkg, TH1* any = 0 );
42 
43  TH1* GetMvaSpdf(){return fmvaSpdf;}
44  TH1* GetMvaBpdf(){return fmvaBpdf;}
45 
46  private:
49  Int_t fMaxIter; // maximum number of iterations
50  Double_t fAbsTol; // absolute tolerance deviation
51 
54 
55  TH1* fmvaS, *fmvaB; // the input mva distributions
56  TH1* fmvaSpdf, *fmvaBpdf; // the normalized (and rebinned) input mva distributions
57  Float_t fXmin, fXmax; // min and max of the mva distribution
58  Double_t fNevtS; // number of signal events (used in error calculation)
59  Int_t fCutOrientation; //+1 if larger mva value means more signal like, -1 otherwise
61  TSpline* fSplmvaCumS, *fSplmvaCumB; // spline of cumulated mva distributions
67 
68  Double_t fSignalCut; // MVA cut value for last demanded background rejection or signal efficiency
69 
70  mutable MsgLogger* fLogger; //! message logger
71  MsgLogger& Log() const { return *fLogger; }
72 
73  };
74 }
75 #endif
TSpline * fSplB
Definition: ROCCalc.h:60
MsgLogger & Log() const
message logger
Definition: ROCCalc.h:71
TSpline * fSplS
Definition: ROCCalc.h:60
Int_t fnStot
Definition: ROCCalc.h:64
float Float_t
Definition: RtypesCore.h:53
TH1 * fmvaSpdf
Definition: ROCCalc.h:56
Int_t fMaxIter
Definition: ROCCalc.h:49
Base class for spline implementation containing the Draw/Paint methods //.
Definition: TSpline.h:22
ROCCalc(TH1 *mvaS, TH1 *mvaB)
Definition: ROCCalc.cxx:56
TH1 * fmvaBpdf
Definition: ROCCalc.h:56
UInt_t fNbins
Definition: ROCCalc.h:52
Basic string class.
Definition: TString.h:137
TH1 * GetMvaSpdf()
Definition: ROCCalc.h:43
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TSpline * fSplmvaCumB
Definition: ROCCalc.h:61
TH1 * fmvaS
Definition: ROCCalc.h:55
TSpline * fSplmvaCumS
Definition: ROCCalc.h:61
TH1 * fSignificance
Definition: ROCCalc.h:65
Double_t fAbsTol
Definition: ROCCalc.h:50
TH1D * GetROC()
get the ROC curve
Definition: ROCCalc.cxx:180
TH1 * fmvaB
Definition: ROCCalc.h:55
Double_t GetEffSForEffBof(Double_t effBref, Double_t &effSerr)
get the signal efficiency for a particular backgroud efficiency that will be the value of the efficie...
Definition: ROCCalc.cxx:293
Double_t Root(Double_t)
Root finding using Brents algorithm; taken from CERNLIB function RZERO.
Definition: ROCCalc.cxx:349
Bool_t fUseSplines
Definition: ROCCalc.h:53
MsgLogger * fLogger
Definition: ROCCalc.h:70
Double_t GetEffForRoot(Double_t theCut)
returns efficiency as function of cut
Definition: ROCCalc.cxx:324
Float_t fXmin
Definition: ROCCalc.h:57
TH1 * GetPurity(Int_t nStot, Int_t nBtot)
Definition: ROCCalc.cxx:430
TH1 * fmvaScumul
Definition: ROCCalc.h:63
A doubly linked list.
Definition: TList.h:47
Double_t GetSignalReferenceCut()
Definition: ROCCalc.h:34
Service class for 2-Dim histogram classes.
Definition: TH2.h:36
Float_t fXmax
Definition: ROCCalc.h:57
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:256
TH1 * fPurity
Definition: ROCCalc.h:66
TH1 * GetSignificance(Int_t nStot, Int_t nBtot)
Definition: ROCCalc.cxx:441
unsigned int UInt_t
Definition: RtypesCore.h:42
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:613
Double_t fSignalCut
Definition: ROCCalc.h:68
TH1 * fmvaBcumul
Definition: ROCCalc.h:63
double Double_t
Definition: RtypesCore.h:55
Int_t fCutOrientation
Definition: ROCCalc.h:59
The TH1 histogram class.
Definition: TH1.h:80
void ApplySignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *any=0)
Int_t c_Canvas = TColor::GetColor( "#f0f0f0" ); Int_t c_FrameFill = TColor::GetColor( "#fffffd" ); In...
Definition: ROCCalc.cxx:116
Abstract ClassifierFactory template that handles arbitrary types.
TH1 * GetMvaBpdf()
Definition: ROCCalc.h:44
Double_t fNevtS
Definition: ROCCalc.h:58
Int_t fnBtot
Definition: ROCCalc.h:64
A TTree object has a header with a name and a title.
Definition: TTree.h:94
Double_t GetROCIntegral()
code to compute the area under the ROC ( rej-vs-eff ) curve
Definition: ROCCalc.cxx:269
TSpline * fSpleffBvsS
Definition: ROCCalc.h:62
~ROCCalc()
destructor
Definition: ROCCalc.cxx:164