1 |
//--------------------------------------------------------------------------------------------------
|
2 |
// $Id $
|
3 |
//
|
4 |
// AntiElectronIDMVA3
|
5 |
//
|
6 |
// Helper Class for applying MVA anti-electron discrimination
|
7 |
//
|
8 |
// Authors: I.Naranjo
|
9 |
// Ported to BAMBU by Matthew Chan (11/30/12)
|
10 |
//--------------------------------------------------------------------------------------------------
|
11 |
|
12 |
#ifndef MITPHYSICS_UTILS_AntiElectronIDMVA3_H
|
13 |
#define MITPHYSICS_UTILS_AntiElectronIDMVA3_H
|
14 |
|
15 |
#include "MitAna/DataTree/interface/ElectronFwd.h"
|
16 |
#include "MitAna/DataTree/interface/VertexFwd.h"
|
17 |
#include "MitAna/DataTree/interface/TrackFwd.h"
|
18 |
#include "MitAna/DataTree/interface/Electron.h"
|
19 |
#include "MitAna/DataTree/interface/ElectronCol.h"
|
20 |
#include "MitAna/DataTree/interface/MuonCol.h"
|
21 |
#include "MitAna/DataTree/interface/PFTauCol.h"
|
22 |
#include "MitAna/DataTree/interface/PFCandidateCol.h"
|
23 |
#include "MitCommon/MathTools/interface/MathUtils.h"
|
24 |
|
25 |
#include "TMVA/Tools.h"
|
26 |
#include "TMVA/Reader.h"
|
27 |
|
28 |
#include <vector>
|
29 |
|
30 |
namespace mithep
|
31 |
{
|
32 |
class AntiElectronIDMVA3
|
33 |
{
|
34 |
public:
|
35 |
enum Level
|
36 |
{
|
37 |
Loose = 0,
|
38 |
Medium,
|
39 |
Tight,
|
40 |
VTight
|
41 |
};
|
42 |
|
43 |
AntiElectronIDMVA3();
|
44 |
~AntiElectronIDMVA3();
|
45 |
|
46 |
void Initialize_from_string(const std::string& methodName,
|
47 |
const std::string& oneProngNoEleMatch0Pi0woGSF_BL,
|
48 |
const std::string& oneProngNoEleMatch0Pi0wGSF_BL,
|
49 |
const std::string& oneProngNoEleMatch1Pi0woGSF_BL,
|
50 |
const std::string& oneProngNoEleMatch1Pi0wGSF_BL,
|
51 |
const std::string& oneProng0Pi0woGSF_BL,
|
52 |
const std::string& oneProng0Pi0wGSF_BL,
|
53 |
const std::string& oneProng1Pi0woGSF_BL,
|
54 |
const std::string& oneProng1Pi0wGSF_BL,
|
55 |
const std::string& oneProngNoEleMatch0Pi0woGSF_EC,
|
56 |
const std::string& oneProngNoEleMatch0Pi0wGSF_EC,
|
57 |
const std::string& oneProngNoEleMatch1Pi0woGSF_EC,
|
58 |
const std::string& oneProngNoEleMatch1Pi0wGSF_EC,
|
59 |
const std::string& oneProng0Pi0woGSF_EC,
|
60 |
const std::string& oneProng0Pi0wGSF_EC,
|
61 |
const std::string& oneProng1Pi0woGSF_EC,
|
62 |
const std::string& oneProng1Pi0wGSF_EC);
|
63 |
|
64 |
double MVAValue(Float_t TauEtaAtEcalEntrance,
|
65 |
Float_t TauPt,
|
66 |
Float_t TaudCrackEta,
|
67 |
Float_t TaudCrackPhi,
|
68 |
Float_t TauEmFraction,
|
69 |
Float_t TauSignalPFGammaCands,
|
70 |
Float_t TauLeadPFChargedHadrHoP,
|
71 |
Float_t TauLeadPFChargedHadrEoP,
|
72 |
Float_t TauVisMass,
|
73 |
Float_t TauHadrMva,
|
74 |
const std::vector<Float_t>& GammasdEta,
|
75 |
const std::vector<Float_t>& GammasdPhi,
|
76 |
const std::vector<Float_t>& GammasPt,
|
77 |
Float_t TauKFNumHits,
|
78 |
Float_t TauGSFNumHits,
|
79 |
Float_t TauGSFChi2,
|
80 |
Float_t TauGSFTrackResol,
|
81 |
Float_t TauGSFTracklnPt,
|
82 |
Float_t TauGSFTrackEta,
|
83 |
Float_t TauPhi,
|
84 |
Float_t TauSignalPFChargedCands,
|
85 |
Float_t TauHasGsf,
|
86 |
Float_t ElecEta,
|
87 |
Float_t ElecPhi,
|
88 |
Float_t ElecPt,
|
89 |
Float_t ElecEe,
|
90 |
Float_t ElecEgamma,
|
91 |
Float_t ElecPin,
|
92 |
Float_t ElecPout,
|
93 |
Float_t ElecFbrem,
|
94 |
Float_t ElecChi2GSF,
|
95 |
Float_t ElecGSFNumHits,
|
96 |
Float_t ElecGSFTrackResol,
|
97 |
Float_t ElecGSFTracklnPt,
|
98 |
Float_t ElecGSFTrackEta);
|
99 |
|
100 |
double MVAValue(Float_t TauEtaAtEcalEntrance,
|
101 |
Float_t TauPt,
|
102 |
Float_t TaudCrackEta,
|
103 |
Float_t TaudCrackPhi,
|
104 |
Float_t TauEmFraction,
|
105 |
Float_t TauSignalPFGammaCands,
|
106 |
Float_t TauLeadPFChargedHadrHoP,
|
107 |
Float_t TauLeadPFChargedHadrEoP,
|
108 |
Float_t TauVisMass,
|
109 |
Float_t TauHadrMva,
|
110 |
Float_t TauGammaEtaMom,
|
111 |
Float_t TauGammaPhiMom,
|
112 |
Float_t TauGammaEnFrac,
|
113 |
Float_t TauKFNumHits,
|
114 |
Float_t TauGSFNumHits,
|
115 |
Float_t TauGSFChi2,
|
116 |
Float_t TauGSFTrackResol,
|
117 |
Float_t TauGSFTracklnPt,
|
118 |
Float_t TauGSFTrackEta,
|
119 |
Float_t TauPhi,
|
120 |
Float_t TauSignalPFChargedCands,
|
121 |
Float_t TauHasGsf,
|
122 |
Float_t ElecEta,
|
123 |
Float_t ElecPhi,
|
124 |
Float_t ElecPt,
|
125 |
Float_t ElecEe,
|
126 |
Float_t ElecEgamma,
|
127 |
Float_t ElecPin,
|
128 |
Float_t ElecPout,
|
129 |
Float_t ElecFbrem,
|
130 |
Float_t ElecChi2GSF,
|
131 |
Float_t ElecGSFNumHits,
|
132 |
Float_t ElecGSFTrackResol,
|
133 |
Float_t ElecGSFTracklnPt,
|
134 |
Float_t ElecGSFTrackEta);
|
135 |
|
136 |
// CV: this function can be called for all categories
|
137 |
double MVAValue(const PFTau& thePFTau,
|
138 |
const Electron& theGsfEle);
|
139 |
// CV: this function can be called for category 1 only !!
|
140 |
double MVAValue(const PFTau& thePFTau);
|
141 |
|
142 |
bool Pass(double mva, int category, Level level=Loose);
|
143 |
bool Pass(const PFTau *thePFTauRef, const ElectronCol *electrons, double &mva, int &category, Level level=Loose);
|
144 |
bool Pass(const PFTau *thePFTauRef, const ElectronCol *electrons, Level level=Loose);
|
145 |
bool isInEcalCrack(double) const;
|
146 |
|
147 |
private:
|
148 |
|
149 |
void bookMVAs();
|
150 |
double dCrackEta(double eta);
|
151 |
double minimum(double a,double b);
|
152 |
double dCrackPhi(double phi, double eta);
|
153 |
Bool_t isInitialized_;
|
154 |
std::string methodName_;
|
155 |
TMVA::Reader* fTMVAReader_[16];
|
156 |
|
157 |
Float_t GammadEta_;
|
158 |
Float_t GammadPhi_;
|
159 |
Float_t GammadPt_;
|
160 |
|
161 |
Float_t Tau_EtaAtEcalEntrance_;
|
162 |
Float_t Tau_Pt_;
|
163 |
Float_t Tau_dCrackEta_;
|
164 |
Float_t Tau_dCrackPhi_;
|
165 |
Float_t Tau_EmFraction_;
|
166 |
Float_t Tau_NumGammaCands_;
|
167 |
Float_t Tau_HadrHoP_;
|
168 |
Float_t Tau_HadrEoP_;
|
169 |
Float_t Tau_VisMass_;
|
170 |
Float_t Tau_HadrMva_;
|
171 |
Float_t Tau_GammaEtaMom_;
|
172 |
Float_t Tau_GammaPhiMom_;
|
173 |
Float_t Tau_GammaEnFrac_;
|
174 |
Float_t Tau_GSFChi2_;
|
175 |
Float_t Tau_NumHitsVariable_;
|
176 |
Float_t Tau_GSFTrackResol_;
|
177 |
Float_t Tau_GSFTracklnPt_;
|
178 |
Float_t Tau_GSFTrackEta_;
|
179 |
|
180 |
Float_t Elec_EtotOverPin_;
|
181 |
Float_t Elec_EgammaOverPdif_;
|
182 |
Float_t Elec_Fbrem_;
|
183 |
Float_t Elec_Chi2GSF_;
|
184 |
Float_t Elec_GSFNumHits_;
|
185 |
Float_t Elec_GSFTrackResol_;
|
186 |
Float_t Elec_GSFTracklnPt_;
|
187 |
Float_t Elec_GSFTrackEta_;
|
188 |
|
189 |
std::vector<std::vector<double> > cuts_;
|
190 |
|
191 |
int verbosity_;
|
192 |
};
|
193 |
}
|
194 |
#endif
|