1 |
+ |
#include "Array.h" |
2 |
|
#include "Electron.h" |
3 |
|
#include "Muon.h" |
4 |
|
#include "Vertex.h" |
6 |
|
#include "PFCandidateCol.h" |
7 |
|
#include "PileupEnergyDensity.h" |
8 |
|
|
9 |
+ |
#include "TLorentzVector.h" |
10 |
+ |
|
11 |
|
#include "MuonTools.h" |
12 |
|
#include "ElectronTools.h" |
13 |
|
|
15 |
|
#include "SelectionStatus.h" |
16 |
|
#include "SimpleLepton.h" |
17 |
|
|
18 |
+ |
using namespace std; |
19 |
+ |
using namespace mithep; |
20 |
+ |
|
21 |
|
#define MUON_ISOMVA_CUT_BIN0 -0.615 |
22 |
|
#define MUON_ISOMVA_CUT_BIN1 0.235 |
23 |
|
#define MUON_ISOMVA_CUT_BIN2 -0.825 |
150 |
|
#define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5 -0.9946 |
151 |
|
#endif |
152 |
|
|
153 |
< |
/* #define ELECTRON_REFERENCE_PFISO_CUT 0.25 */ |
154 |
< |
/* #define MUON_REFERENCE_PFISO_CUT 0.25 */ |
155 |
< |
#define ELECTRON_REFERENCE_PFISO_CUT 0.4 |
156 |
< |
#define MUON_REFERENCE_PFISO_CUT 0.4 |
153 |
> |
/* #define ELECTRON_REFERENCE_PFISO_CUT 0.25 */ |
154 |
> |
/* #define MUON_REFERENCE_PFISO_CUT 0.25 */ |
155 |
> |
#define ELECTRON_REFERENCE_PFISO_CUT 0.4 |
156 |
> |
#define MUON_REFERENCE_PFISO_CUT 0.4 |
157 |
|
|
158 |
|
Float_t computePFMuonIso(const mithep::Muon *muon, |
159 |
< |
const mithep::Vertex & vtx, |
159 |
> |
const mithep::Vertex * vtx, |
160 |
|
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
161 |
|
const Double_t dRMax); |
162 |
|
|
163 |
|
Float_t computePFEleIso(const mithep::Electron *electron, |
164 |
< |
const mithep::Vertex & fVertex, |
164 |
> |
const mithep::Vertex * fVertex, |
165 |
|
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
166 |
|
const Double_t dRMax); |
167 |
|
|
168 |
|
SelectionStatus electronIsoSelection(ControlFlags &, const mithep::Electron *, const mithep::Vertex &, const mithep::Array<mithep::PFCandidate> * fPFCandidateCol ); |
169 |
< |
SelectionStatus muonIsoSelection(ControlFlags &, const mithep::Muon *, const mithep::Vertex &, const mithep::Array<mithep::PFCandidate> * fPFCandidateCol ); |
164 |
< |
bool pairwiseIsoSelection( ControlFlags &, vector<SimpleLepton> &, float rho ); |
169 |
> |
SelectionStatus muonIsoSelection(ControlFlags &, const mithep::Muon *, const mithep::Vertex *, const mithep::Array<mithep::PFCandidate> * fPFCandidateCol ); |
170 |
|
bool noIso(ControlFlags &, vector<SimpleLepton> &, float rho); |
171 |
|
|
172 |
|
void initMuonIsoMVA(); |
173 |
|
SelectionStatus muonIsoMVASelection(ControlFlags &ctrl, |
174 |
|
const mithep::Muon * mu, |
175 |
< |
const mithep::Vertex & vtx, |
175 |
> |
const mithep::Vertex * vtx, |
176 |
|
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
177 |
|
const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity, |
178 |
|
mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion, |
181 |
|
//hacked version |
182 |
|
SelectionStatus muonIsoMVASelection(ControlFlags &ctrl, |
183 |
|
const mithep::Muon * mu, |
184 |
< |
const mithep::Vertex & vtx, |
184 |
> |
const mithep::Vertex * vtx, |
185 |
|
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
186 |
|
float rho, |
187 |
|
mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion, |
189 |
|
vector<const mithep::Electron*> electronsToVeto); |
190 |
|
double muonPFIso04(ControlFlags &ctrl, |
191 |
|
const mithep::Muon * mu, |
192 |
< |
const mithep::Vertex & vtx, |
192 |
> |
const mithep::Vertex * vtx, |
193 |
|
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
194 |
|
const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity, |
195 |
|
mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion, |
196 |
< |
vector<const mithep::Muon*> muonsToVeto, |
197 |
< |
vector<const mithep::Electron*> electronsToVeto); |
193 |
< |
// hacked version |
194 |
< |
double muonPFIso04(ControlFlags &ctrl, |
195 |
< |
const mithep::Muon * mu, |
196 |
< |
const mithep::Vertex & vtx, |
197 |
< |
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
198 |
< |
float rho, // the hack |
199 |
< |
mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion, |
200 |
< |
vector<const mithep::Muon*> muonsToVeto, |
201 |
< |
vector<const mithep::Electron*> electronsToVeto); |
202 |
< |
// |
196 |
> |
vector<const mithep::PFCandidate*> photonsToVeto); |
197 |
> |
|
198 |
|
SelectionStatus muonReferenceIsoSelection(ControlFlags &ctrl, |
199 |
|
const mithep::Muon * mu, |
200 |
< |
const mithep::Vertex & vtx, |
200 |
> |
const mithep::Vertex * vtx, |
201 |
|
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
202 |
|
const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity, |
203 |
|
mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion, |
204 |
< |
vector<const mithep::Muon*> muonsToVeto, |
210 |
< |
vector<const mithep::Electron*> electronsToVeto); |
211 |
< |
// hacked version |
212 |
< |
SelectionStatus muonReferenceIsoSelection(ControlFlags &ctrl, |
213 |
< |
const mithep::Muon * mu, |
214 |
< |
const mithep::Vertex & vtx, |
215 |
< |
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
216 |
< |
float, |
217 |
< |
mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion, |
218 |
< |
vector<const mithep::Muon*> muonsToVeto, |
219 |
< |
vector<const mithep::Electron*> electronsToVeto); |
204 |
> |
vector<const mithep::PFCandidate*> photonsToVeto); |
205 |
|
|
206 |
|
void initElectronIsoMVA(); |
207 |
|
SelectionStatus electronIsoMVASelection(ControlFlags &ctrl, |
208 |
|
const mithep::Electron * ele, |
209 |
< |
const mithep::Vertex & vtx, |
209 |
> |
const mithep::Vertex * vtx, |
210 |
|
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
211 |
|
const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity, |
212 |
|
mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion, |
215 |
|
//hacked version |
216 |
|
SelectionStatus electronIsoMVASelection(ControlFlags &ctrl, |
217 |
|
const mithep::Electron * ele, |
218 |
< |
const mithep::Vertex & vtx, |
218 |
> |
const mithep::Vertex * vtx, |
219 |
|
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
220 |
|
float rho, |
221 |
|
mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion, |
227 |
|
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
228 |
|
const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity, |
229 |
|
mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion, |
230 |
< |
vector<const mithep::Muon*> muonsToVeto, |
231 |
< |
vector<const mithep::Electron*> electronsToVeto) ; |
247 |
< |
// hacked version |
248 |
< |
float electronPFIso04(ControlFlags &ctrl, |
249 |
< |
const mithep::Electron * ele, |
250 |
< |
const mithep::Vertex & vtx, |
251 |
< |
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
252 |
< |
float rho, // the hack |
253 |
< |
mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion, |
254 |
< |
vector<const mithep::Muon*> muonsToVeto, |
255 |
< |
vector<const mithep::Electron*> electronsToVeto) ; |
256 |
< |
// |
230 |
> |
vector<const mithep::PFCandidate*> photonsToVeto); |
231 |
> |
|
232 |
|
SelectionStatus electronReferenceIsoSelection(ControlFlags &ctrl, |
233 |
|
const mithep::Electron * ele, |
234 |
< |
const mithep::Vertex & vtx, |
234 |
> |
const mithep::Vertex * vtx, |
235 |
|
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
236 |
|
const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity, |
237 |
|
mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion, |
238 |
< |
vector<const mithep::Muon*> muonsToVeto, |
239 |
< |
vector<const mithep::Electron*> electronsToVeto); |
240 |
< |
// hacked version |
241 |
< |
SelectionStatus electronReferenceIsoSelection(ControlFlags &ctrl, |
242 |
< |
const mithep::Electron * ele, |
243 |
< |
const mithep::Vertex & vtx, |
244 |
< |
const mithep::Array<mithep::PFCandidate> * fPFCandidates, |
245 |
< |
float, |
246 |
< |
mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion, |
247 |
< |
vector<const mithep::Muon*> muonsToVeto, |
248 |
< |
vector<const mithep::Electron*> electronsToVeto); |
238 |
> |
vector<const mithep::PFCandidate*> photonsToVeto); |
239 |
> |
|
240 |
> |
double dbetaCorrectedIsoDr03(ControlFlags & ctrl, |
241 |
> |
const mithep::PFCandidate * photon, |
242 |
> |
const mithep::Muon * mu, // need to veto |
243 |
> |
const mithep::Array<mithep::PFCandidate> * fPFCandidates); |
244 |
> |
|
245 |
> |
double dbetaCorrectedIsoDr03(ControlFlags & ctrl, |
246 |
> |
const mithep::PFCandidate * photon, |
247 |
> |
const mithep::Electron * el, // need to veto |
248 |
> |
const mithep::Array<mithep::PFCandidate> * fPFCandidates); |
249 |
> |
|
250 |
> |
double nonCorrectedIsoDr03(ControlFlags & ctrl, |
251 |
> |
const mithep::PFCandidate * photon, |
252 |
> |
const mithep::Muon * mu, // need to veto |
253 |
> |
const mithep::Array<mithep::PFCandidate> * fPFCandidates); |
254 |
> |
|
255 |
> |
double nonCorrectedIsoDr03(ControlFlags & ctrl, |
256 |
> |
const mithep::PFCandidate * photon, |
257 |
> |
const mithep::Electron * el, // need to veto |
258 |
> |
const mithep::Array<mithep::PFCandidate> * fPFCandidates); |
259 |
> |
|