CMS 3D CMS Logo

AntiElectronIDMVA6.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------------------------------
2 // AntiElectronIDMVA6
3 //
4 // Helper Class for applying MVA anti-electron discrimination
5 //
6 // Authors: F.Colombo, C.Veelken
7 //--------------------------------------------------------------------------------------------------
8 
9 #ifndef RECOTAUTAG_RECOTAU_AntiElectronIDMVA6_H
10 #define RECOTAUTAG_RECOTAU_AntiElectronIDMVA6_H
11 
16 
27 
28 #include "TMVA/Tools.h"
29 #include "TMVA/Reader.h"
30 
32 
33 #include <vector>
34 
36 public:
39 
40  void beginEvent(const edm::Event&, const edm::EventSetup&);
41 
42  double MVAValue(Float_t TauPt,
43  Float_t TauEtaAtEcalEntrance,
44  Float_t TauPhi,
45  Float_t TauLeadChargedPFCandPt,
46  Float_t TauLeadChargedPFCandEtaAtEcalEntrance,
47  Float_t TauEmFraction,
48  Float_t TauLeadPFChargedHadrHoP,
49  Float_t TauLeadPFChargedHadrEoP,
50  Float_t TauVisMassIn,
51  Float_t TaudCrackEta,
52  Float_t TaudCrackPhi,
53  Float_t TauHasGsf,
54  Int_t TauSignalPFGammaCandsIn,
55  Int_t TauSignalPFGammaCandsOut,
56  const std::vector<Float_t>& GammasdEtaInSigCone,
57  const std::vector<Float_t>& GammasdPhiInSigCone,
58  const std::vector<Float_t>& GammasPtInSigCone,
59  const std::vector<Float_t>& GammasdEtaOutSigCone,
60  const std::vector<Float_t>& GammasdPhiOutSigCone,
61  const std::vector<Float_t>& GammasPtOutSigCone,
62  Float_t ElecEta,
63  Float_t ElecPhi,
64  Float_t ElecEtotOverPin,
65  Float_t ElecChi2NormGSF,
66  Float_t ElecChi2NormKF,
67  Float_t ElecGSFNumHits,
68  Float_t ElecKFNumHits,
69  Float_t ElecGSFTrackResol,
70  Float_t ElecGSFTracklnPt,
71  Float_t ElecPin,
72  Float_t ElecPout,
73  Float_t ElecEecal,
74  Float_t ElecDeltaEta,
75  Float_t ElecDeltaPhi,
76  Float_t ElecMvaInSigmaEtaEta,
77  Float_t ElecMvaInHadEnergy,
78  Float_t ElecMvaInDeltaEta);
79 
80  double MVAValue(Float_t TauPt,
81  Float_t TauEtaAtEcalEntrance,
82  Float_t TauPhi,
83  Float_t TauLeadChargedPFCandPt,
84  Float_t TauLeadChargedPFCandEtaAtEcalEntrance,
85  Float_t TauEmFraction,
86  Float_t TauLeadPFChargedHadrHoP,
87  Float_t TauLeadPFChargedHadrEoP,
88  Float_t TauVisMassIn,
89  Float_t TaudCrackEta,
90  Float_t TaudCrackPhi,
91  Float_t TauHasGsf,
92  Int_t TauSignalPFGammaCandsIn,
93  Int_t TauSignalPFGammaCandsOut,
94  Float_t TauGammaEtaMomIn,
95  Float_t TauGammaEtaMomOut,
96  Float_t TauGammaPhiMomIn,
97  Float_t TauGammaPhiMomOut,
98  Float_t TauGammaEnFracIn,
99  Float_t TauGammaEnFracOut,
100  Float_t ElecEta,
101  Float_t ElecPhi,
102  Float_t ElecEtotOverPin,
103  Float_t ElecChi2NormGSF,
104  Float_t ElecChi2NormKF,
105  Float_t ElecGSFNumHits,
106  Float_t ElecKFNumHits,
107  Float_t ElecGSFTrackResol,
108  Float_t ElecGSFTracklnPt,
109  Float_t ElecPin,
110  Float_t ElecPout,
111  Float_t ElecEecal,
112  Float_t ElecDeltaEta,
113  Float_t ElecDeltaPhi,
114  Float_t ElecMvaInSigmaEtaEta,
115  Float_t ElecMvaInHadEnergy,
116  Float_t ElecMvaInDeltaEta);
117 
118  // this function can be called for all categories
119  double MVAValue(const reco::PFTau& thePFTau, const reco::GsfElectron& theGsfEle);
120  // this function can be called for category 1 only !!
121  double MVAValue(const reco::PFTau& thePFTau);
122 
123  // this function can be called for all categories
124  double MVAValue(const pat::Tau& theTau, const pat::Electron& theEle);
125  // this function can be called for category 1 only !!
126  double MVAValue(const pat::Tau& theTau);
127  // track extrapolation to ECAL entrance (used to re-calculate variables that might not be available on miniAOD)
129 
130 private:
131  double dCrackEta(double eta);
132  double minimum(double a, double b);
133  double dCrackPhi(double phi, double eta);
134 
138 
147 
149 
158 
167 
168  std::vector<TFile*> inputFilesToDelete_;
169 
171 
173 };
174 
175 #endif
AntiElectronIDMVA6
Definition: AntiElectronIDMVA6.h:35
AntiElectronIDMVA6::inputFilesToDelete_
std::vector< TFile * > inputFilesToDelete_
Definition: AntiElectronIDMVA6.h:168
AntiElectronIDMVA6::positionAtECalEntrance_
PositionAtECalEntranceComputer positionAtECalEntrance_
Definition: AntiElectronIDMVA6.h:170
AntiElectronIDMVA6::mvaName_woGwGSF_EC_
std::string mvaName_woGwGSF_EC_
Definition: AntiElectronIDMVA6.h:145
GBRForest
Definition: GBRForest.h:25
pat::Tau
Analysis-level tau class.
Definition: Tau.h:53
pos
Definition: PixelAliasList.h:18
AntiElectronIDMVA6::mva_NoEleMatch_wGwoGSF_BL_
const GBRForest * mva_NoEleMatch_wGwoGSF_BL_
Definition: AntiElectronIDMVA6.h:160
reco::PFTau
Definition: PFTau.h:36
AntiElectronIDMVA6::~AntiElectronIDMVA6
~AntiElectronIDMVA6()
Definition: AntiElectronIDMVA6.cc:60
AntiElectronIDMVA6::verbosity_
int verbosity_
Definition: AntiElectronIDMVA6.h:172
AntiElectronIDMVA6::MVAValue
double MVAValue(Float_t TauPt, Float_t TauEtaAtEcalEntrance, Float_t TauPhi, Float_t TauLeadChargedPFCandPt, Float_t TauLeadChargedPFCandEtaAtEcalEntrance, Float_t TauEmFraction, Float_t TauLeadPFChargedHadrHoP, Float_t TauLeadPFChargedHadrEoP, Float_t TauVisMassIn, Float_t TaudCrackEta, Float_t TaudCrackPhi, Float_t TauHasGsf, Int_t TauSignalPFGammaCandsIn, Int_t TauSignalPFGammaCandsOut, const std::vector< Float_t > &GammasdEtaInSigCone, const std::vector< Float_t > &GammasdPhiInSigCone, const std::vector< Float_t > &GammasPtInSigCone, const std::vector< Float_t > &GammasdEtaOutSigCone, const std::vector< Float_t > &GammasdPhiOutSigCone, const std::vector< Float_t > &GammasPtOutSigCone, Float_t ElecEta, Float_t ElecPhi, Float_t ElecEtotOverPin, Float_t ElecChi2NormGSF, Float_t ElecChi2NormKF, Float_t ElecGSFNumHits, Float_t ElecKFNumHits, Float_t ElecGSFTrackResol, Float_t ElecGSFTracklnPt, Float_t ElecPin, Float_t ElecPout, Float_t ElecEecal, Float_t ElecDeltaEta, Float_t ElecDeltaPhi, Float_t ElecMvaInSigmaEtaEta, Float_t ElecMvaInHadEnergy, Float_t ElecMvaInDeltaEta)
Definition: AntiElectronIDMVA6.cc:136
GBRForest.h
Tau.h
AntiElectronIDMVA6::mvaName_NoEleMatch_wGwoGSF_BL_
std::string mvaName_NoEleMatch_wGwoGSF_BL_
Definition: AntiElectronIDMVA6.h:140
AntiElectronIDMVA6::mva_NoEleMatch_wGwoGSF_EC_
const GBRForest * mva_NoEleMatch_wGwoGSF_EC_
Definition: AntiElectronIDMVA6.h:164
PositionAtECalEntranceComputer
Definition: PositionAtECalEntranceComputer.h:19
FileInPath.h
AntiElectronIDMVA6::isInitialized_
bool isInitialized_
Definition: AntiElectronIDMVA6.h:135
deltaR.h
AntiElectronIDMVA6::atECalEntrance
bool atECalEntrance(const reco::Candidate *part, math::XYZPoint &pos)
edm::FileInPath
Definition: FileInPath.h:64
AntiElectronIDMVA6::mva_wGwGSF_BL_
const GBRForest * mva_wGwGSF_BL_
Definition: AntiElectronIDMVA6.h:162
part
part
Definition: HCALResponse.h:20
Track.h
AntiElectronIDMVA6::Var_wGwGSF_Endcap_
Float_t * Var_wGwGSF_Endcap_
Definition: AntiElectronIDMVA6.h:157
AntiElectronIDMVA6::mvaName_wGwGSF_BL_
std::string mvaName_wGwGSF_BL_
Definition: AntiElectronIDMVA6.h:142
TrackFwd.h
AntiElectronIDMVA6::mvaName_NoEleMatch_wGwoGSF_EC_
std::string mvaName_NoEleMatch_wGwoGSF_EC_
Definition: AntiElectronIDMVA6.h:144
PVValHelper::eta
Definition: PVValidationHelpers.h:69
AntiElectronIDMVA6::minimum
double minimum(double a, double b)
Definition: AntiElectronIDMVA6.cc:1241
AntiElectronIDMVA6::mvaName_NoEleMatch_woGwoGSF_BL_
std::string mvaName_NoEleMatch_woGwoGSF_BL_
Definition: AntiElectronIDMVA6.h:139
AntiElectronIDMVA6::Var_woGwGSF_Endcap_
Float_t * Var_woGwGSF_Endcap_
Definition: AntiElectronIDMVA6.h:156
reco::GsfElectron
Definition: GsfElectron.h:35
AntiElectronIDMVA6::Var_NoEleMatch_wGwoGSF_Barrel_
Float_t * Var_NoEleMatch_wGwoGSF_Barrel_
Definition: AntiElectronIDMVA6.h:151
b
double b
Definition: hdecay.h:118
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
AntiElectronIDMVA6::Var_NoEleMatch_woGwoGSF_Barrel_
Float_t * Var_NoEleMatch_woGwoGSF_Barrel_
Definition: AntiElectronIDMVA6.h:150
AntiElectronIDMVA6::mvaName_woGwGSF_BL_
std::string mvaName_woGwGSF_BL_
Definition: AntiElectronIDMVA6.h:141
edm::ParameterSet
Definition: ParameterSet.h:36
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
AntiElectronIDMVA6::Var_wGwGSF_Barrel_
Float_t * Var_wGwGSF_Barrel_
Definition: AntiElectronIDMVA6.h:153
a
double a
Definition: hdecay.h:119
Event.h
AntiElectronIDMVA6::mva_wGwGSF_EC_
const GBRForest * mva_wGwGSF_EC_
Definition: AntiElectronIDMVA6.h:166
AntiElectronIDMVA6::mva_woGwGSF_BL_
const GBRForest * mva_woGwGSF_BL_
Definition: AntiElectronIDMVA6.h:161
PackedCandidate.h
AntiElectronIDMVA6::loadMVAfromDB_
bool loadMVAfromDB_
Definition: AntiElectronIDMVA6.h:136
AntiElectronIDMVA6::Var_NoEleMatch_woGwoGSF_Endcap_
Float_t * Var_NoEleMatch_woGwoGSF_Endcap_
Definition: AntiElectronIDMVA6.h:154
AntiElectronIDMVA6::Var_NoEleMatch_wGwoGSF_Endcap_
Float_t * Var_NoEleMatch_wGwoGSF_Endcap_
Definition: AntiElectronIDMVA6.h:155
GsfTrack.h
AntiElectronIDMVA6::Var_woGwGSF_Barrel_
Float_t * Var_woGwGSF_Barrel_
Definition: AntiElectronIDMVA6.h:152
edm::EventSetup
Definition: EventSetup.h:57
reco::Candidate
Definition: Candidate.h:27
AntiElectronIDMVA6::dCrackPhi
double dCrackPhi(double phi, double eta)
Definition: AntiElectronIDMVA6.cc:1266
DDAxes::phi
AntiElectronIDMVA6::mva_NoEleMatch_woGwoGSF_EC_
const GBRForest * mva_NoEleMatch_woGwoGSF_EC_
Definition: AntiElectronIDMVA6.h:163
AntiElectronIDMVA6::inputFileName_
edm::FileInPath inputFileName_
Definition: AntiElectronIDMVA6.h:137
GsfTrackFwd.h
AntiElectronIDMVA6::mva_NoEleMatch_woGwoGSF_BL_
const GBRForest * mva_NoEleMatch_woGwoGSF_BL_
Definition: AntiElectronIDMVA6.h:159
AntiElectronIDMVA6::AntiElectronIDMVA6
AntiElectronIDMVA6(const edm::ParameterSet &)
Definition: AntiElectronIDMVA6.cc:18
AntiElectronIDMVA6::beginEvent
void beginEvent(const edm::Event &, const edm::EventSetup &)
Definition: AntiElectronIDMVA6.cc:104
PFTau.h
EventSetup.h
AntiElectronIDMVA6::mvaName_wGwGSF_EC_
std::string mvaName_wGwGSF_EC_
Definition: AntiElectronIDMVA6.h:146
Electron.h
AntiElectronIDMVA6::mvaName_NoEleMatch_woGwoGSF_EC_
std::string mvaName_NoEleMatch_woGwoGSF_EC_
Definition: AntiElectronIDMVA6.h:143
pat::Electron
Analysis-level electron class.
Definition: Electron.h:51
AntiElectronIDMVA6::usePhiAtEcalEntranceExtrapolation_
bool usePhiAtEcalEntranceExtrapolation_
Definition: AntiElectronIDMVA6.h:148
ParameterSet.h
edm::Event
Definition: Event.h:73
PositionAtECalEntranceComputer.h
AntiElectronIDMVA6::mva_woGwGSF_EC_
const GBRForest * mva_woGwGSF_EC_
Definition: AntiElectronIDMVA6.h:165
AntiElectronIDMVA6::dCrackEta
double dCrackEta(double eta)
Definition: AntiElectronIDMVA6.cc:1316