Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROCCalc.h
Go to the documentation of this file.
1#ifndef ROOT_TMVA_ROCCalc
2#define ROOT_TMVA_ROCCalc
3
4#include "RtypesCore.h"
5
6class TList;
7class TTree;
8class TString;
9class TH1;
10class TH1D;
11class TH2;
12class TH2F;
13class TSpline;
14
15namespace TMVA {
16
17 class MsgLogger;
18
19
20 class ROCCalc {
21
22 public:
24
25 ~ROCCalc();
26
27
28 TH1D* GetROC();
29 // return the signal eff for a given backgr. efficiency
31 // return the cut value
33 // return the area under the ROC curve
35 // return the statistical significance as function of the mva cut value
38
39 void ApplySignalAndBackgroundStyle( TH1* sig, TH1* bkg, TH1* any = nullptr );
40
41 /// Get a pointer to the signal Pdf as an histogram.
42 /// The histogram is owned by the ROCCalc instance, so it will only live as long as the ROCCalc.
43 /// If you want a new histogram object that you manage yourself, please use `GetMvaSpdf()->Clone()`.
45 /// Get a pointer to the background Pdf as a histogram.
46 /// The histogram is owned by the ROCCalc instance, so it will only live as long as the ROCCalc.
47 /// If you want a new histogram object that you manage yourself, please use `GetMvaBpdf()->Clone()`.
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
float Float_t
Definition RtypesCore.h:57
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
1-D histogram with a double per channel (see TH1 documentation)
Definition TH1.h:693
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
2-D histogram with a float per channel (see TH1 documentation)
Definition TH2.h:307
Service class for 2-D histogram classes.
Definition TH2.h:30
A doubly linked list.
Definition TList.h:38
ostringstream derivative to redirect and format output
Definition MsgLogger.h:57
TH1 * GetMvaSpdf()
Get a pointer to the signal Pdf as an histogram.
Definition ROCCalc.h:44
Double_t fSignalCut
MVA cut value for last demanded background rejection or signal efficiency.
Definition ROCCalc.h:81
Double_t Root(Double_t)
Root finding using Brents algorithm; taken from CERNLIB function RZERO.
Definition ROCCalc.cxx:348
TH1 * fmvaScumul
Definition ROCCalc.h:73
void ResetStatus()
Definition ROCCalc.h:52
TH1 * fmvaBcumul
Definition ROCCalc.h:73
TSpline * fSplS
Definition ROCCalc.h:70
TH1 * fPurity
Definition ROCCalc.h:76
Bool_t GetStatus()
Definition ROCCalc.h:51
void ApplySignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *any=nullptr)
Definition ROCCalc.cxx:113
Double_t GetROCIntegral()
code to compute the area under the ROC ( rej-vs-eff ) curve
Definition ROCCalc.cxx:268
Float_t fXmax
min and max of the mva distribution
Definition ROCCalc.h:67
Float_t fXmin
Definition ROCCalc.h:67
TSpline * fSplmvaCumB
spline of cumulated mva distributions
Definition ROCCalc.h:71
TH1D * rejBvsS
Definition ROCCalc.h:78
Int_t fnBtot
Definition ROCCalc.h:74
TSpline * fSplmvaCumS
Definition ROCCalc.h:71
Int_t fnStot
Definition ROCCalc.h:74
Int_t fMaxIter
maximum number of iterations
Definition ROCCalc.h:57
TSpline * fSpleffBvsS
Definition ROCCalc.h:72
Bool_t fStatus
false if is found some error in mvaS or mvaB
Definition ROCCalc.h:60
Double_t GetSignalReferenceCut()
Definition ROCCalc.h:32
Int_t fCutOrientation
+1 if larger mva value means more signal like, -1 otherwise
Definition ROCCalc.h:69
TH1 * GetPurity(Int_t nStot, Int_t nBtot)
Definition ROCCalc.cxx:429
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:292
ROCCalc(TH1 *mvaS, TH1 *mvaB)
Definition ROCCalc.cxx:42
TH1 * GetSignificance(Int_t nStot, Int_t nBtot)
Definition ROCCalc.cxx:440
TH1D * effBvsS
Definition ROCCalc.h:77
MsgLogger & Log() const
message logger
Definition ROCCalc.h:84
TH1 * fmvaSpdf
Definition ROCCalc.h:66
TH1D * GetROC()
get the ROC curve
Definition ROCCalc.cxx:178
TH1 * fmvaS
Definition ROCCalc.h:65
~ROCCalc()
destructor
Definition ROCCalc.cxx:160
TH1 * fmvaB
the input mva distributions
Definition ROCCalc.h:65
TH1 * GetMvaBpdf()
Get a pointer to the background Pdf as a histogram.
Definition ROCCalc.h:48
TH1D * inveffBvsS
Definition ROCCalc.h:79
TSpline * fSplB
Definition ROCCalc.h:70
Bool_t fUseSplines
Definition ROCCalc.h:63
TH1 * fSignificance
Definition ROCCalc.h:75
UInt_t fNbins
Definition ROCCalc.h:62
MsgLogger * fLogger
Definition ROCCalc.h:83
Double_t fAbsTol
absolute tolerance deviation
Definition ROCCalc.h:58
TH1 * fmvaBpdf
the normalized (and rebinned) input mva distributions
Definition ROCCalc.h:66
Double_t GetEffForRoot(Double_t theCut)
returns efficiency as function of cut
Definition ROCCalc.cxx:323
Double_t fNevtS
number of signal events (used in error calculation)
Definition ROCCalc.h:68
Base class for spline implementation containing the Draw/Paint methods.
Definition TSpline.h:31
Basic string class.
Definition TString.h:139
A TTree represents a columnar dataset.
Definition TTree.h:79
create variable transformations