Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
20 namespace TMVA {
21 
22  class MsgLogger;
23 
24 
25  class ROCCalc {
26 
27  public:
28  ROCCalc(TH1* mvaS, TH1* mvaB);
29 
30  ~ROCCalc();
31 
32 
33  TH1D* GetROC();
34  // return the signal eff for a given backgr. efficiency
35  Double_t GetEffSForEffBof(Double_t effBref, Double_t &effSerr);
36  // return the cut value
37  Double_t GetSignalReferenceCut(){return fSignalCut;}
38  // return the area under the ROC curve
39  Double_t GetROCIntegral();
40  // return the statistical significance as function of the mva cut value
41  TH1* GetSignificance( Int_t nStot, Int_t nBtot);
42  TH1* GetPurity(Int_t nStot, Int_t nBtot);
43 
44  void ApplySignalAndBackgroundStyle( TH1* sig, TH1* bkg, TH1* any = 0 );
45 
46  TH1* GetMvaSpdf(){return fmvaSpdf;}
47  TH1* GetMvaBpdf(){return fmvaBpdf;}
48 
49  //false if is found some error in mvaS or mvaB
50  Bool_t GetStatus(){return fStatus;}
51  void ResetStatus(){fStatus=kTRUE;}
52 
53  private:
54  Double_t Root(Double_t);
55  Double_t GetEffForRoot( Double_t theCut );
56  Int_t fMaxIter; // maximum number of iterations
57  Double_t fAbsTol; // absolute tolerance deviation
58 
59  Bool_t fStatus; //false if is found some error in mvaS or mvaB
60 
61  UInt_t fNbins;
62  Bool_t fUseSplines;
63 
64  TH1* fmvaS, *fmvaB; // the input mva distributions
65  TH1* fmvaSpdf, *fmvaBpdf; // the normalized (and rebinned) input mva distributions
66  Float_t fXmin, fXmax; // min and max of the mva distribution
67  Double_t fNevtS; // number of signal events (used in error calculation)
68  Int_t fCutOrientation; //+1 if larger mva value means more signal like, -1 otherwise
69  TSpline* fSplS, *fSplB;
70  TSpline* fSplmvaCumS, *fSplmvaCumB; // spline of cumulated mva distributions
71  TSpline* fSpleffBvsS;
72  TH1* fmvaScumul, *fmvaBcumul;
73  Int_t fnStot, fnBtot;
74  TH1* fSignificance;
75  TH1* fPurity;
76  TH1D* effBvsS;
77  TH1D* rejBvsS;
78  TH1D* inveffBvsS;
79 
80  Double_t fSignalCut; // MVA cut value for last demanded background rejection or signal efficiency
81 
82  mutable MsgLogger* fLogger; //! message logger
83  MsgLogger& Log() const { return *fLogger; }
84 
85  };
86 }
87 #endif