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