CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AntiElectronIDMVA2.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------------------------------
2 // $Id $
3 //
4 // AntiElectronIDMVA2
5 //
6 // Helper Class for applying MVA anti-electron discrimination
7 //
8 // Authors: I.Naranjo
9 //--------------------------------------------------------------------------------------------------
10 
11 #ifndef RECOTAUTAG_RECOTAU_AntiElectronIDMVA2_H
12 #define RECOTAUTAG_RECOTAU_AntiElectronIDMVA2_H
13 
19 
20 #include "TMVA/Tools.h"
21 #include "TMVA/Reader.h"
22 
24 
25 #include <vector>
26 
28 {
29  public:
30 
33 
34  void Initialize_from_file(const std::string& methodName,
35  const std::string& oneProngNoEleMatch_BL,
36  const std::string& oneProng0Pi0_BL,
37  const std::string& oneProng1pi0woGSF_BL,
38  const std::string& oneProng1pi0wGSFwoPfEleMva_BL,
39  const std::string& oneProng1pi0wGSFwPfEleMva_BL,
40  const std::string& oneProngNoEleMatch_EC,
41  const std::string& oneProng0Pi0_EC,
42  const std::string& oneProng1pi0woGSF_EC,
43  const std::string& oneProng1pi0wGSFwoPfEleMva_EC,
44  const std::string& oneProng1pi0wGSFwPfEleMva_EC);
45 
46  void Initialize_from_string(const std::string& methodName,
47  const std::string& oneProngNoEleMatch_BL,
48  const std::string& oneProng0Pi0_BL,
49  const std::string& oneProng1pi0woGSF_BL,
50  const std::string& oneProng1pi0wGSFwoPfEleMva_BL,
51  const std::string& oneProng1pi0wGSFwPfEleMva_BL,
52  const std::string& oneProngNoEleMatch_EC,
53  const std::string& oneProng0Pi0_EC,
54  const std::string& oneProng1pi0woGSF_EC,
55  const std::string& oneProng1pi0wGSFwoPfEleMva_EC,
56  const std::string& oneProng1pi0wGSFwPfEleMva_EC);
57 
58  // RECOMMENDED:
59  double MVAValue(Float_t TauEtaAtEcalEntrance,
60  Float_t TauPhi,
61  Float_t TauPt,
62  Float_t TauSignalPFChargedCands,
63  Float_t TauSignalPFGammaCands,
64  Float_t TauLeadPFChargedHadrHoP,
65  Float_t TauLeadPFChargedHadrEoP,
66  Float_t TauHasGsf,
67  Float_t TauVisMass,
68  Float_t TauEmFraction,
69  const std::vector<Float_t>& GammasdEta,
70  const std::vector<Float_t>& GammasdPhi,
71  const std::vector<Float_t>& GammasPt,
72  Float_t ElecEta,
73  Float_t ElecPhi,
74  Float_t ElecPt,
75  Float_t ElecPFMvaOutput,
76  Float_t ElecEe,
77  Float_t ElecEgamma,
78  Float_t ElecPin,
79  Float_t ElecPout,
80  Float_t ElecEarlyBrem,
81  Float_t ElecLateBrem,
82  Float_t ElecFbrem,
83  Float_t ElecChi2KF,
84  Float_t ElecChi2GSF,
85  Float_t ElecNumHits,
86  Float_t ElecGSFTrackResol,
87  Float_t ElecGSFTracklnPt,
88  Float_t ElecGSFTrackEta);
89 
90  double MVAValue(Float_t TauEtaAtEcalEntrance,
91  Float_t TauPhi,
92  Float_t TauPt,
93  Float_t TauSignalPFChargedCands,
94  Float_t TauSignalPFGammaCands,
95  Float_t TauLeadPFChargedHadrHoP,
96  Float_t TauLeadPFChargedHadrEoP,
97  Float_t TauHasGsf,
98  Float_t TauVisMass,
99  Float_t TauEmFraction,
100  Float_t GammaEtaMom,
101  Float_t GammaPhiMom,
102  Float_t GammaEnFrac,
103  Float_t ElecEta,
104  Float_t ElecPhi,
105  Float_t ElecPt,
106  Float_t ElecPFMvaOutput,
107  Float_t ElecEe,
108  Float_t ElecEgamma,
109  Float_t ElecPin,
110  Float_t ElecPout,
111  Float_t ElecEarlyBrem,
112  Float_t ElecLateBrem,
113  Float_t ElecFbrem,
114  Float_t ElecChi2KF,
115  Float_t ElecChi2GSF,
116  Float_t ElecNumHits,
117  Float_t ElecGSFTrackResol,
118  Float_t ElecGSFTracklnPt,
119  Float_t ElecGSFTrackEta);
120 
121  // CV: this function can be called for all categories
122  double MVAValue(const reco::PFTau& thePFTau,
123  const reco::GsfElectron& theGsfEle);
124  // CV: this function can be called for category 1 only !!
125  double MVAValue(const reco::PFTau& thePFTau);
126 
127  private:
128 
129  void bookMVAs();
130 
132  std::string methodName_;
133  TMVA::Reader* fTMVAReader_[10];
134 
135  Float_t GammadEta_;
136  Float_t GammadPhi_;
137  Float_t GammadPt_;
138 
140  Float_t Tau_Pt_;
141  Float_t Tau_HasGsf_;
142  Float_t Tau_EmFraction_;
145  Float_t Tau_HadrHoP_;
146  Float_t Tau_HadrEoP_;
147  Float_t Tau_VisMass_;
151  Float_t Tau_HadrMva_;
152 
153  Float_t Elec_Eta_;
154  Float_t Elec_Pt_;
156  Float_t Elec_Ee_;
157  Float_t Elec_Egamma_;
158  Float_t Elec_Pin_;
159  Float_t Elec_Pout_;
164  Float_t Elec_LateBrem_;
165  Float_t Elec_Fbrem_;
166  Float_t Elec_Chi2KF_;
167  Float_t Elec_Chi2GSF_;
168  Float_t Elec_NumHits_;
172 
174 };
175 
176 #endif
void Initialize_from_string(const std::string &methodName, const std::string &oneProngNoEleMatch_BL, const std::string &oneProng0Pi0_BL, const std::string &oneProng1pi0woGSF_BL, const std::string &oneProng1pi0wGSFwoPfEleMva_BL, const std::string &oneProng1pi0wGSFwPfEleMva_BL, const std::string &oneProngNoEleMatch_EC, const std::string &oneProng0Pi0_EC, const std::string &oneProng1pi0woGSF_EC, const std::string &oneProng1pi0wGSFwoPfEleMva_EC, const std::string &oneProng1pi0wGSFwPfEleMva_EC)
TMVA::Reader * fTMVAReader_[10]
void Initialize_from_file(const std::string &methodName, const std::string &oneProngNoEleMatch_BL, const std::string &oneProng0Pi0_BL, const std::string &oneProng1pi0woGSF_BL, const std::string &oneProng1pi0wGSFwoPfEleMva_BL, const std::string &oneProng1pi0wGSFwPfEleMva_BL, const std::string &oneProngNoEleMatch_EC, const std::string &oneProng0Pi0_EC, const std::string &oneProng1pi0woGSF_EC, const std::string &oneProng1pi0wGSFwoPfEleMva_EC, const std::string &oneProng1pi0wGSFwPfEleMva_EC)
double MVAValue(Float_t TauEtaAtEcalEntrance, Float_t TauPhi, Float_t TauPt, Float_t TauSignalPFChargedCands, Float_t TauSignalPFGammaCands, Float_t TauLeadPFChargedHadrHoP, Float_t TauLeadPFChargedHadrEoP, Float_t TauHasGsf, Float_t TauVisMass, Float_t TauEmFraction, const std::vector< Float_t > &GammasdEta, const std::vector< Float_t > &GammasdPhi, const std::vector< Float_t > &GammasPt, Float_t ElecEta, Float_t ElecPhi, Float_t ElecPt, Float_t ElecPFMvaOutput, Float_t ElecEe, Float_t ElecEgamma, Float_t ElecPin, Float_t ElecPout, Float_t ElecEarlyBrem, Float_t ElecLateBrem, Float_t ElecFbrem, Float_t ElecChi2KF, Float_t ElecChi2GSF, Float_t ElecNumHits, Float_t ElecGSFTrackResol, Float_t ElecGSFTracklnPt, Float_t ElecGSFTrackEta)