CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
EGammaMvaEleEstimatorCSA14.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------------------------------
2 // $Id $
3 //
4 // EGammaMvaEleEstimatorCSA14
5 //
6 // Helper Class for applying MVA electron ID selection
7 //
8 // Authors: D.Benedetti, E.DiMaro, S.Xie
9 //--------------------------------------------------------------------------------------------------
10 
11 #ifndef EGammaMvaEleEstimatorCSA14_H
12 #define EGammaMvaEleEstimatorCSA14_H
13 
14 #include <vector>
15 #include <TROOT.h>
16 #include "TMVA/Factory.h"
17 #include "TMVA/Tools.h"
18 #include "TMVA/Reader.h"
19 
35 
37 
39 public:
42 
43  enum MVAType {
44  kTrig = 0, // MVA for triggering electrons
45  kNonTrig = 1, // MVA for non-triggering electrons
46  kNonTrigPhys14 = 2, // MVA for non-triggering electrons in Phys14
47  };
48 
50  void initialize(std::string methodName,
52  Bool_t useBinnedVersion,
53  std::vector<std::string> weightsfiles);
54 
55  Bool_t isInitialized() const { return fisInitialized; }
56  UInt_t GetMVABin(double eta, double pt) const;
57 
58  void bindVariables();
59 
60  // for kTrig and kNonTrig algorithm
61  Double_t mvaValue(const reco::GsfElectron& ele,
62  const reco::Vertex& vertex,
63  const TransientTrackBuilder& transientTrackBuilder,
64  noZS::EcalClusterLazyTools myEcalCluster,
65  bool printDebug = kFALSE);
66 
67  Double_t mvaValue(const pat::Electron& ele, bool printDebug);
68 
69 private:
70  std::vector<TMVA::Reader*> fTMVAReader;
71  std::vector<TMVA::MethodBase*> fTMVAMethod;
76  UInt_t fNMVABins;
77 
78  Float_t fMVAVar_fbrem;
79  Float_t fMVAVar_kfchi2;
80  Float_t fMVAVar_kfhits; //number of layers
81  Float_t fMVAVar_kfhitsall; //number of hits
82  Float_t fMVAVar_gsfchi2;
83 
84  Float_t fMVAVar_deta;
85  Float_t fMVAVar_dphi;
87 
88  Float_t fMVAVar_see;
89  Float_t fMVAVar_spp;
93  Float_t fMVAVar_R9;
94 
95  Float_t fMVAVar_HoE;
96  Float_t fMVAVar_EoP;
97  Float_t fMVAVar_IoEmIoP;
99  Float_t fMVAVar_EoPout;
101 
102  Float_t fMVAVar_d0;
103  Float_t fMVAVar_ip3d;
105 
106  Float_t fMVAVar_eta;
107  Float_t fMVAVar_abseta;
108  Float_t fMVAVar_pt;
109  Float_t fMVAVar_rho;
112  Float_t fMVAVar_SCeta;
113 
129 };
130 
131 #endif
void initialize(std::string methodName, std::string weightsfile, EGammaMvaEleEstimatorCSA14::MVAType type)
std::vector< TMVA::MethodBase * > fTMVAMethod
UInt_t GetMVABin(double eta, double pt) const
Double_t mvaValue(const reco::GsfElectron &ele, const reco::Vertex &vertex, const TransientTrackBuilder &transientTrackBuilder, noZS::EcalClusterLazyTools myEcalCluster, bool printDebug=kFALSE)
std::vector< TMVA::Reader * > fTMVAReader
Analysis-level electron class.
Definition: Electron.h:51