1 |
sixie |
1.55 |
// $Id: ElectronIDMod.cc,v 1.54 2010/04/09 22:51:57 ceballos Exp $
|
2 |
loizides |
1.1 |
|
3 |
|
|
#include "MitPhysics/Mods/interface/ElectronIDMod.h"
|
4 |
loizides |
1.26 |
#include "MitAna/DataTree/interface/StableData.h"
|
5 |
|
|
#include "MitAna/DataTree/interface/ElectronCol.h"
|
6 |
|
|
#include "MitAna/DataTree/interface/VertexCol.h"
|
7 |
|
|
#include "MitAna/DataTree/interface/DecayParticleCol.h"
|
8 |
loizides |
1.5 |
#include "MitPhysics/Init/interface/ModNames.h"
|
9 |
loizides |
1.1 |
|
10 |
|
|
using namespace mithep;
|
11 |
|
|
|
12 |
|
|
ClassImp(mithep::ElectronIDMod)
|
13 |
|
|
|
14 |
|
|
//--------------------------------------------------------------------------------------------------
|
15 |
loizides |
1.5 |
ElectronIDMod::ElectronIDMod(const char *name, const char *title) :
|
16 |
loizides |
1.1 |
BaseMod(name,title),
|
17 |
loizides |
1.5 |
fElectronBranchName(Names::gkElectronBrn),
|
18 |
ceballos |
1.12 |
fConversionBranchName(Names::gkMvfConversionBrn),
|
19 |
loizides |
1.5 |
fGoodElectronsName(ModNames::gkGoodElectronsName),
|
20 |
ceballos |
1.54 |
fVertexName(string("PrimaryVertexes").c_str()),
|
21 |
ceballos |
1.31 |
fElectronIDType("CustomTight"),
|
22 |
ceballos |
1.8 |
fElectronIsoType("TrackJuraSliding"),
|
23 |
loizides |
1.1 |
fElectronPtMin(10),
|
24 |
|
|
fIDLikelihoodCut(0.9),
|
25 |
|
|
fTrackIsolationCut(5.0),
|
26 |
|
|
fCaloIsolationCut(5.0),
|
27 |
loizides |
1.5 |
fEcalJuraIsoCut(5.0),
|
28 |
|
|
fHcalIsolationCut(5.0),
|
29 |
ceballos |
1.49 |
fCombIsolationCut(5.0),
|
30 |
loizides |
1.14 |
fApplyConvFilter(kTRUE),
|
31 |
bendavid |
1.38 |
fWrongHitsRequirement(kTRUE),
|
32 |
ceballos |
1.18 |
fApplyD0Cut(kTRUE),
|
33 |
ceballos |
1.45 |
fChargeFilter(kTRUE),
|
34 |
ceballos |
1.54 |
fD0Cut(0.25),
|
35 |
loizides |
1.25 |
fReverseIsoCut(kFALSE),
|
36 |
|
|
fReverseD0Cut(kFALSE),
|
37 |
loizides |
1.5 |
fElIdType(kIdUndef),
|
38 |
ceballos |
1.12 |
fElIsoType(kIsoUndef),
|
39 |
loizides |
1.14 |
fElectrons(0),
|
40 |
|
|
fConversions(0),
|
41 |
loizides |
1.25 |
fVertices(0)
|
42 |
loizides |
1.1 |
{
|
43 |
|
|
// Constructor.
|
44 |
|
|
}
|
45 |
|
|
|
46 |
|
|
//--------------------------------------------------------------------------------------------------
|
47 |
loizides |
1.30 |
Bool_t ElectronIDMod::PassCustomID(const Electron *ele) const
|
48 |
|
|
{
|
49 |
loizides |
1.32 |
// Based on RecoEgamma/ElectronIdentification/src/CutBasedElectronID.cc.
|
50 |
loizides |
1.30 |
Double_t eOverP = ele->ESuperClusterOverP();
|
51 |
|
|
Double_t fBrem = ele->FBrem();
|
52 |
|
|
|
53 |
|
|
if ((eOverP < fCuts[5][0]) && (fBrem < fCuts[5][1]))
|
54 |
|
|
return kFALSE;
|
55 |
|
|
|
56 |
|
|
if (eOverP < fCuts[5][2]*(1-fBrem))
|
57 |
|
|
return kFALSE;
|
58 |
|
|
|
59 |
|
|
Int_t cat = 2;
|
60 |
|
|
if ((ele->IsEB() && fBrem<0.06) || (ele->IsEE() && fBrem<0.1))
|
61 |
|
|
cat=1;
|
62 |
|
|
else if (eOverP < 1.2 && eOverP > 0.8)
|
63 |
|
|
cat=0;
|
64 |
|
|
|
65 |
|
|
Double_t eSeedOverPin = ele->ESeedClusterOverPIn();
|
66 |
|
|
Double_t hOverE = ele->HadronicOverEm();
|
67 |
|
|
Double_t sigmaee = ele->CoviEtaiEta();
|
68 |
|
|
Double_t deltaPhiIn = TMath::Abs(ele->DeltaPhiSuperClusterTrackAtVtx());
|
69 |
|
|
Double_t deltaEtaIn = TMath::Abs(ele->DeltaEtaSuperClusterTrackAtVtx());
|
70 |
|
|
|
71 |
|
|
Int_t eb = 1;
|
72 |
|
|
if (ele->IsEB())
|
73 |
|
|
eb = 0;
|
74 |
|
|
|
75 |
|
|
if (hOverE>fCuts[0][cat+4*eb])
|
76 |
|
|
return kFALSE;
|
77 |
|
|
|
78 |
|
|
if (sigmaee>fCuts[1][cat+4*eb])
|
79 |
|
|
return kFALSE;
|
80 |
|
|
|
81 |
ceballos |
1.40 |
if (deltaPhiIn>fCuts[2][cat+4*eb])
|
82 |
|
|
return kFALSE;
|
83 |
loizides |
1.30 |
|
84 |
|
|
if(deltaEtaIn>fCuts[3][cat+4*eb])
|
85 |
|
|
return kFALSE;
|
86 |
|
|
|
87 |
|
|
if(eSeedOverPin<fCuts[4][cat+4*eb])
|
88 |
|
|
return kFALSE;
|
89 |
|
|
|
90 |
|
|
return kTRUE;
|
91 |
|
|
}
|
92 |
|
|
|
93 |
|
|
//--------------------------------------------------------------------------------------------------
|
94 |
sixie |
1.51 |
Bool_t ElectronIDMod::PassCustomIso(const Electron *ele) const
|
95 |
|
|
{
|
96 |
|
|
Bool_t pass = kTRUE;
|
97 |
|
|
|
98 |
|
|
Double_t trkIso = ele->TrackIsolationDr03();
|
99 |
|
|
Double_t ecalIso = ele->EcalRecHitIsoDr04();
|
100 |
|
|
Double_t hcalIso = ele->HcalIsolation();
|
101 |
|
|
Double_t combinedIso = ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr04() - 1.5;
|
102 |
|
|
|
103 |
|
|
Int_t eb = 1;
|
104 |
|
|
if (ele->IsEB())
|
105 |
|
|
eb = 0;
|
106 |
|
|
|
107 |
ceballos |
1.54 |
if (trkIso>fIsoCuts[0][eb])
|
108 |
sixie |
1.51 |
pass = kFALSE;
|
109 |
ceballos |
1.54 |
if (ecalIso>fIsoCuts[1][eb])
|
110 |
sixie |
1.51 |
pass = kFALSE;
|
111 |
ceballos |
1.54 |
if (hcalIso>fIsoCuts[2][eb])
|
112 |
sixie |
1.51 |
pass = kFALSE;
|
113 |
ceballos |
1.54 |
if (combinedIso>fIsoCuts[3][eb])
|
114 |
sixie |
1.51 |
pass = kFALSE;
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
return pass;
|
118 |
|
|
}
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
//--------------------------------------------------------------------------------------------------
|
122 |
sixie |
1.42 |
Bool_t ElectronIDMod::PassIDCut(const Electron *ele, EElIdType idType) const
|
123 |
|
|
{
|
124 |
|
|
|
125 |
|
|
Bool_t idcut = kFALSE;
|
126 |
|
|
switch (idType) {
|
127 |
|
|
case kTight:
|
128 |
|
|
idcut = ele->PassTightID();
|
129 |
|
|
break;
|
130 |
|
|
case kLoose:
|
131 |
|
|
idcut = ele->PassLooseID();
|
132 |
|
|
break;
|
133 |
|
|
case kLikelihood:
|
134 |
|
|
idcut = (ele->IDLikelihood() > fIDLikelihoodCut);
|
135 |
|
|
break;
|
136 |
|
|
case kNoId:
|
137 |
|
|
idcut = kTRUE;
|
138 |
|
|
break;
|
139 |
|
|
case kCustomIdLoose:
|
140 |
|
|
idcut = ElectronIDMod::PassCustomID(ele);
|
141 |
|
|
break;
|
142 |
|
|
case kCustomIdTight:
|
143 |
|
|
idcut = ElectronIDMod::PassCustomID(ele);
|
144 |
|
|
break;
|
145 |
ceballos |
1.54 |
case kVBTFWorkingPoint90Id:
|
146 |
|
|
idcut = ElectronIDMod::PassCustomID(ele);
|
147 |
|
|
break;
|
148 |
|
|
case kVBTFWorkingPoint80Id:
|
149 |
|
|
idcut = ElectronIDMod::PassCustomID(ele);
|
150 |
|
|
break;
|
151 |
|
|
case kVBTFWorkingPoint70Id:
|
152 |
|
|
idcut = ElectronIDMod::PassCustomID(ele);
|
153 |
|
|
break;
|
154 |
sixie |
1.42 |
default:
|
155 |
|
|
break;
|
156 |
|
|
}
|
157 |
|
|
|
158 |
|
|
return idcut;
|
159 |
|
|
}
|
160 |
|
|
|
161 |
|
|
|
162 |
|
|
//--------------------------------------------------------------------------------------------------
|
163 |
|
|
Bool_t ElectronIDMod::PassIsolationCut(const Electron *ele, EElIsoType isoType) const
|
164 |
|
|
{
|
165 |
|
|
|
166 |
|
|
Bool_t isocut = kFALSE;
|
167 |
|
|
switch (isoType) {
|
168 |
|
|
case kTrackCalo:
|
169 |
|
|
isocut = (ele->TrackIsolationDr03() < fTrackIsolationCut) &&
|
170 |
|
|
(ele->CaloIsolation() < fCaloIsolationCut);
|
171 |
|
|
break;
|
172 |
|
|
case kTrackJura:
|
173 |
|
|
isocut = (ele->TrackIsolationDr03() < fTrackIsolationCut) &&
|
174 |
|
|
(ele->EcalRecHitIsoDr04() < fEcalJuraIsoCut) &&
|
175 |
|
|
(ele->HcalIsolation() < fHcalIsolationCut);
|
176 |
|
|
break;
|
177 |
ceballos |
1.49 |
case kTrackJuraCombined:
|
178 |
|
|
isocut = (ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr04()
|
179 |
|
|
- 1.5 < fCombIsolationCut);
|
180 |
|
|
break;
|
181 |
sixie |
1.42 |
case kTrackJuraSliding:
|
182 |
|
|
{
|
183 |
|
|
Double_t totalIso = ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr04() - 1.5;
|
184 |
|
|
if (totalIso < (ele->Pt()-10.0)*4.5/20.0 ||
|
185 |
|
|
totalIso <= 0)
|
186 |
|
|
isocut = kTRUE;
|
187 |
|
|
|
188 |
|
|
if (fReverseIsoCut == kTRUE &&
|
189 |
|
|
isocut == kFALSE && totalIso < 10)
|
190 |
|
|
isocut = kTRUE;
|
191 |
|
|
else if(fReverseIsoCut == kTRUE)
|
192 |
|
|
isocut = kFALSE;
|
193 |
|
|
}
|
194 |
|
|
break;
|
195 |
sixie |
1.51 |
case kVBTFWorkingPoint90Iso:
|
196 |
|
|
isocut = ElectronIDMod::PassCustomIso(ele);
|
197 |
|
|
break;
|
198 |
|
|
case kVBTFWorkingPoint80Iso:
|
199 |
|
|
isocut = ElectronIDMod::PassCustomIso(ele);
|
200 |
|
|
break;
|
201 |
|
|
case kVBTFWorkingPoint70Iso:
|
202 |
|
|
isocut = ElectronIDMod::PassCustomIso(ele);
|
203 |
|
|
break;
|
204 |
sixie |
1.42 |
case kNoIso:
|
205 |
|
|
isocut = kTRUE;
|
206 |
|
|
break;
|
207 |
|
|
case kCustomIso:
|
208 |
|
|
default:
|
209 |
|
|
break;
|
210 |
|
|
}
|
211 |
|
|
|
212 |
|
|
return isocut;
|
213 |
|
|
}
|
214 |
|
|
|
215 |
|
|
|
216 |
|
|
//--------------------------------------------------------------------------------------------------
|
217 |
|
|
Bool_t ElectronIDMod::PassConversionFilter(const Electron *ele, const DecayParticleCol *conversions) const
|
218 |
|
|
{
|
219 |
|
|
Bool_t isGoodConversion = kFALSE;
|
220 |
|
|
|
221 |
|
|
for (UInt_t ifc=0; ifc<conversions->GetEntries(); ifc++) {
|
222 |
|
|
Bool_t ConversionMatchFound = kFALSE;
|
223 |
|
|
for (UInt_t d=0; d<conversions->At(ifc)->NDaughters(); d++) {
|
224 |
|
|
const Track *trk = dynamic_cast<const ChargedParticle*>
|
225 |
|
|
(conversions->At(ifc)->Daughter(d))->Trk();
|
226 |
|
|
if (ele->GsfTrk() == trk) {
|
227 |
|
|
ConversionMatchFound = kTRUE;
|
228 |
|
|
break;
|
229 |
|
|
}
|
230 |
|
|
}
|
231 |
sixie |
1.52 |
|
232 |
sixie |
1.42 |
// if match between the e-track and one of the conversion legs
|
233 |
|
|
if (ConversionMatchFound == kTRUE){
|
234 |
|
|
isGoodConversion = (conversions->At(ifc)->Prob() > 1e-6) &&
|
235 |
|
|
(conversions->At(ifc)->Lxy() > 0) &&
|
236 |
|
|
(conversions->At(ifc)->Position().Rho() > 2.0);
|
237 |
sixie |
1.52 |
|
238 |
sixie |
1.42 |
if (isGoodConversion == kTRUE) {
|
239 |
|
|
for (UInt_t d=0; d<conversions->At(ifc)->NDaughters(); d++) {
|
240 |
|
|
const Track *trk = dynamic_cast<const ChargedParticle*>
|
241 |
|
|
(conversions->At(ifc)->Daughter(d))->Trk();
|
242 |
|
|
if (trk) {
|
243 |
|
|
// These requirements are not used for the GSF track
|
244 |
|
|
if (!(trk->NHits() >= 3 && trk->Prob() > 1e-6) && trk!=ele->GsfTrk())
|
245 |
|
|
isGoodConversion = kFALSE;
|
246 |
|
|
const StableData *sd = dynamic_cast<const StableData*>
|
247 |
|
|
(conversions->At(ifc)->DaughterDat(d));
|
248 |
|
|
if (fWrongHitsRequirement && sd->NWrongHits() != 0)
|
249 |
|
|
isGoodConversion = kFALSE;
|
250 |
|
|
} else {
|
251 |
|
|
isGoodConversion = kFALSE;
|
252 |
|
|
}
|
253 |
|
|
}
|
254 |
|
|
}
|
255 |
|
|
}
|
256 |
|
|
if (isGoodConversion == kTRUE) break;
|
257 |
|
|
|
258 |
|
|
} // loop over all conversions
|
259 |
sixie |
1.52 |
|
260 |
ceballos |
1.46 |
return !isGoodConversion;
|
261 |
sixie |
1.42 |
}
|
262 |
|
|
|
263 |
|
|
//--------------------------------------------------------------------------------------------------
|
264 |
|
|
Bool_t ElectronIDMod::PassD0Cut(const Electron *ele, const VertexCol *vertices) const
|
265 |
|
|
{
|
266 |
|
|
Bool_t d0cut = kFALSE;
|
267 |
|
|
// d0 cut
|
268 |
|
|
Double_t d0_real = 99999;
|
269 |
|
|
for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
|
270 |
|
|
Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
|
271 |
|
|
if(TMath::Abs(pD0) < TMath::Abs(d0_real)) d0_real = TMath::Abs(pD0);
|
272 |
|
|
}
|
273 |
|
|
if(d0_real < fD0Cut) d0cut = kTRUE;
|
274 |
|
|
|
275 |
|
|
if (fReverseD0Cut == kTRUE &&
|
276 |
|
|
d0cut == kFALSE && d0_real < 0.05)
|
277 |
|
|
d0cut = kTRUE;
|
278 |
|
|
else if(fReverseD0Cut == kTRUE)
|
279 |
|
|
d0cut = kFALSE;
|
280 |
|
|
|
281 |
|
|
return d0cut;
|
282 |
|
|
}
|
283 |
|
|
|
284 |
|
|
//--------------------------------------------------------------------------------------------------
|
285 |
|
|
Bool_t ElectronIDMod::PassChargeFilter(const Electron *ele) const
|
286 |
|
|
{
|
287 |
|
|
Bool_t passChargeFilter = kTRUE;
|
288 |
|
|
if(ele->TrackerTrk() &&
|
289 |
|
|
ele->TrackerTrk()->Charge() != ele->Charge()) passChargeFilter = kFALSE;
|
290 |
|
|
|
291 |
|
|
return passChargeFilter;
|
292 |
|
|
}
|
293 |
|
|
|
294 |
|
|
//--------------------------------------------------------------------------------------------------
|
295 |
sixie |
1.51 |
Bool_t ElectronIDMod::PassSpikeRemovalFilter(const Electron *ele) const
|
296 |
|
|
{
|
297 |
|
|
Bool_t passSpikeRemovalFilter = kTRUE;
|
298 |
|
|
if(ele->SCluster()->Seed()->Energy() > 5.0 &&
|
299 |
|
|
ele->SCluster()->Seed()->EMax() / ele->SCluster()->Seed()->E3x3() > 0.95
|
300 |
|
|
) {
|
301 |
|
|
passSpikeRemovalFilter = kFALSE;
|
302 |
|
|
}
|
303 |
|
|
|
304 |
|
|
// For Now Only use the EMax/E3x3 prescription.
|
305 |
|
|
// if(ele->SCluster()->Seed()->Energy() > 5.0 &&
|
306 |
|
|
// (1 - (ele->SCluster()->Seed()->E1x3() + ele->SCluster()->Seed()->E3x1() - 2*ele->SCluster()->Seed()->EMax())) > 0.95
|
307 |
|
|
// ) {
|
308 |
|
|
// passSpikeRemovalFilter = kFALSE;
|
309 |
|
|
// }
|
310 |
|
|
|
311 |
|
|
return passSpikeRemovalFilter;
|
312 |
|
|
}
|
313 |
|
|
|
314 |
|
|
//--------------------------------------------------------------------------------------------------
|
315 |
loizides |
1.1 |
void ElectronIDMod::Process()
|
316 |
|
|
{
|
317 |
|
|
// Process entries of the tree.
|
318 |
|
|
|
319 |
loizides |
1.23 |
LoadEventObject(fElectronBranchName, fElectrons);
|
320 |
loizides |
1.1 |
|
321 |
loizides |
1.6 |
ElectronOArr *GoodElectrons = new ElectronOArr;
|
322 |
|
|
GoodElectrons->SetName(fGoodElectronsName);
|
323 |
loizides |
1.1 |
|
324 |
ceballos |
1.18 |
for (UInt_t i=0; i<fElectrons->GetEntries(); ++i) {
|
325 |
loizides |
1.5 |
const Electron *e = fElectrons->At(i);
|
326 |
loizides |
1.1 |
|
327 |
loizides |
1.5 |
if (e->Pt() <= fElectronPtMin)
|
328 |
|
|
continue;
|
329 |
loizides |
1.1 |
|
330 |
sixie |
1.55 |
//apply ECAL spike removal
|
331 |
|
|
Bool_t spikecut = PassSpikeRemovalFilter(e);
|
332 |
|
|
if (!spikecut)
|
333 |
|
|
continue;
|
334 |
|
|
|
335 |
sixie |
1.42 |
//apply id cut
|
336 |
|
|
Bool_t idcut = PassIDCut(e, fElIdType);
|
337 |
loizides |
1.5 |
if (!idcut)
|
338 |
|
|
continue;
|
339 |
|
|
|
340 |
sixie |
1.42 |
//apply Isolation Cut
|
341 |
|
|
Bool_t isocut = PassIsolationCut(e, fElIsoType);
|
342 |
|
|
if (!isocut)
|
343 |
loizides |
1.5 |
continue;
|
344 |
|
|
|
345 |
loizides |
1.14 |
// apply conversion filter
|
346 |
ceballos |
1.47 |
Bool_t passConvVeto = kFALSE;
|
347 |
loizides |
1.14 |
if (fApplyConvFilter) {
|
348 |
sixie |
1.42 |
LoadEventObject(fConversionBranchName, fConversions);
|
349 |
ceballos |
1.47 |
passConvVeto = PassConversionFilter(e, fConversions);
|
350 |
sixie |
1.48 |
} else {
|
351 |
|
|
passConvVeto = kTRUE;
|
352 |
ceballos |
1.12 |
}
|
353 |
ceballos |
1.47 |
if (passConvVeto == kFALSE) continue;
|
354 |
sixie |
1.42 |
|
355 |
|
|
// apply d0 cut
|
356 |
ceballos |
1.15 |
if (fApplyD0Cut) {
|
357 |
sixie |
1.42 |
LoadEventObject(fVertexName, fVertices);
|
358 |
ceballos |
1.46 |
Bool_t passD0cut = PassD0Cut(e, fVertices);
|
359 |
sixie |
1.42 |
if (!passD0cut)
|
360 |
ceballos |
1.24 |
continue;
|
361 |
ceballos |
1.12 |
}
|
362 |
|
|
|
363 |
sixie |
1.42 |
//apply charge filter
|
364 |
|
|
if(fChargeFilter == kTRUE) {
|
365 |
|
|
Bool_t passChargeFilter = PassChargeFilter(e);
|
366 |
|
|
if (!passChargeFilter) continue;
|
367 |
ceballos |
1.45 |
}
|
368 |
|
|
|
369 |
loizides |
1.5 |
// add good electron
|
370 |
ceballos |
1.12 |
GoodElectrons->Add(e);
|
371 |
loizides |
1.5 |
}
|
372 |
loizides |
1.1 |
|
373 |
loizides |
1.9 |
// sort according to pt
|
374 |
|
|
GoodElectrons->Sort();
|
375 |
|
|
|
376 |
loizides |
1.5 |
// add to event for other modules to use
|
377 |
loizides |
1.6 |
AddObjThisEvt(GoodElectrons);
|
378 |
loizides |
1.1 |
}
|
379 |
|
|
|
380 |
|
|
//--------------------------------------------------------------------------------------------------
|
381 |
|
|
void ElectronIDMod::SlaveBegin()
|
382 |
|
|
{
|
383 |
|
|
// Run startup code on the computer (slave) doing the actual analysis. Here,
|
384 |
loizides |
1.5 |
// we just request the electron collection branch.
|
385 |
loizides |
1.1 |
|
386 |
loizides |
1.23 |
ReqEventObject(fElectronBranchName, fElectrons, kTRUE);
|
387 |
loizides |
1.17 |
|
388 |
ceballos |
1.16 |
if (fApplyConvFilter)
|
389 |
loizides |
1.23 |
ReqEventObject(fConversionBranchName, fConversions, kTRUE);
|
390 |
loizides |
1.17 |
|
391 |
ceballos |
1.15 |
if (fApplyD0Cut)
|
392 |
loizides |
1.23 |
ReqEventObject(fVertexName, fVertices, kTRUE);
|
393 |
loizides |
1.1 |
|
394 |
sixie |
1.42 |
Setup();
|
395 |
|
|
}
|
396 |
|
|
|
397 |
|
|
//--------------------------------------------------------------------------------------------------
|
398 |
|
|
void ElectronIDMod::Setup()
|
399 |
|
|
{
|
400 |
|
|
// Set all options properly before execution.
|
401 |
|
|
|
402 |
loizides |
1.5 |
if (fElectronIDType.CompareTo("Tight") == 0)
|
403 |
|
|
fElIdType = kTight;
|
404 |
|
|
else if (fElectronIDType.CompareTo("Loose") == 0)
|
405 |
|
|
fElIdType = kLoose;
|
406 |
|
|
else if (fElectronIDType.CompareTo("Likelihood") == 0)
|
407 |
|
|
fElIdType = kLikelihood;
|
408 |
loizides |
1.10 |
else if (fElectronIDType.CompareTo("NoId") == 0)
|
409 |
|
|
fElIdType = kNoId;
|
410 |
sixie |
1.42 |
else if (fElectronIDType.CompareTo("ZeeId") == 0)
|
411 |
|
|
fElIdType = kZeeId;
|
412 |
sixie |
1.51 |
else if (fElectronIDType.CompareTo("CustomLoose") == 0)
|
413 |
peveraer |
1.29 |
fElIdType = kCustomIdLoose;
|
414 |
sixie |
1.51 |
else if (fElectronIDType.CompareTo("CustomTight") == 0)
|
415 |
peveraer |
1.29 |
fElIdType = kCustomIdTight;
|
416 |
sixie |
1.55 |
else if (fElectronIDType.CompareTo("VBTFWorkingPoint95Id") == 0)
|
417 |
|
|
fElIdType = kVBTFWorkingPoint95Id;
|
418 |
sixie |
1.51 |
else if (fElectronIDType.CompareTo("VBTFWorkingPoint90Id") == 0)
|
419 |
|
|
fElIdType = kVBTFWorkingPoint90Id;
|
420 |
|
|
else if (fElectronIDType.CompareTo("VBTFWorkingPoint80Id") == 0)
|
421 |
|
|
fElIdType = kVBTFWorkingPoint80Id;
|
422 |
|
|
else if (fElectronIDType.CompareTo("VBTFWorkingPoint70Id") == 0)
|
423 |
|
|
fElIdType = kVBTFWorkingPoint70Id;
|
424 |
|
|
|
425 |
peveraer |
1.29 |
else {
|
426 |
loizides |
1.5 |
SendError(kAbortAnalysis, "SlaveBegin",
|
427 |
|
|
"The specified electron identification %s is not defined.",
|
428 |
|
|
fElectronIDType.Data());
|
429 |
|
|
return;
|
430 |
|
|
}
|
431 |
sixie |
1.51 |
SetCustomIDCuts(fElIdType);
|
432 |
|
|
|
433 |
loizides |
1.5 |
if (fElectronIsoType.CompareTo("TrackCalo") == 0 )
|
434 |
|
|
fElIsoType = kTrackCalo;
|
435 |
|
|
else if (fElectronIsoType.CompareTo("TrackJura") == 0)
|
436 |
|
|
fElIsoType = kTrackJura;
|
437 |
ceballos |
1.49 |
else if(fElectronIsoType.CompareTo("TrackJuraCombined") == 0)
|
438 |
|
|
fElIsoType = kTrackJuraCombined;
|
439 |
loizides |
1.5 |
else if(fElectronIsoType.CompareTo("TrackJuraSliding") == 0)
|
440 |
|
|
fElIsoType = kTrackJuraSliding;
|
441 |
|
|
else if (fElectronIsoType.CompareTo("NoIso") == 0 )
|
442 |
|
|
fElIsoType = kNoIso;
|
443 |
sixie |
1.42 |
else if (fElectronIsoType.CompareTo("ZeeIso") == 0 )
|
444 |
|
|
fElIsoType = kZeeIso;
|
445 |
sixie |
1.55 |
else if (fElectronIsoType.CompareTo("VBTFWorkingPoint95Iso") == 0 )
|
446 |
|
|
fElIsoType = kVBTFWorkingPoint95Iso;
|
447 |
sixie |
1.51 |
else if (fElectronIsoType.CompareTo("VBTFWorkingPoint90Iso") == 0 )
|
448 |
|
|
fElIsoType = kVBTFWorkingPoint90Iso;
|
449 |
|
|
else if (fElectronIsoType.CompareTo("VBTFWorkingPoint80Iso") == 0 )
|
450 |
|
|
fElIsoType = kVBTFWorkingPoint80Iso;
|
451 |
|
|
else if (fElectronIsoType.CompareTo("VBTFWorkingPoint70Iso") == 0 )
|
452 |
|
|
fElIsoType = kVBTFWorkingPoint70Iso;
|
453 |
loizides |
1.5 |
else if (fElectronIsoType.CompareTo("Custom") == 0 ) {
|
454 |
|
|
fElIsoType = kCustomIso;
|
455 |
|
|
SendError(kWarning, "SlaveBegin",
|
456 |
|
|
"Custom electron isolation is not yet implemented.");
|
457 |
|
|
} else {
|
458 |
|
|
SendError(kAbortAnalysis, "SlaveBegin",
|
459 |
|
|
"The specified electron isolation %s is not defined.",
|
460 |
|
|
fElectronIsoType.Data());
|
461 |
|
|
return;
|
462 |
|
|
}
|
463 |
sixie |
1.51 |
SetCustomIsoCuts(fElIsoType);
|
464 |
|
|
|
465 |
sixie |
1.42 |
|
466 |
loizides |
1.1 |
}
|
467 |
loizides |
1.30 |
|
468 |
|
|
//--------------------------------------------------------------------------------------------------
|
469 |
|
|
void ElectronIDMod::SetCustomIDCuts(EElIdType idt)
|
470 |
|
|
{
|
471 |
loizides |
1.32 |
// Set cut values based on RecoEgamma/ElectronIdentification/python/electronIdCutBasedExt_cfi.py.
|
472 |
|
|
// The following changes are in sigmaetaeta for endcups and deltaetain.
|
473 |
loizides |
1.30 |
|
474 |
|
|
Double_t tightcuts[6][8]={
|
475 |
ceballos |
1.40 |
{0.086, 0.1, 0.052, 0.0, 0.050, 0.059, 0.061, 0.0}, //hovere
|
476 |
sixie |
1.44 |
{0.011, 0.011, 0.011, 0.0, 0.033, 0.029, 0.030, 0.0}, //sigmaetaeta
|
477 |
|
|
{0.038, 0.024, 0.045, 0.0, 0.034, 0.017, 0.026, 0.0}, //deltaphiin
|
478 |
|
|
{0.0081, 0.0029, 0.0051, 0.0, 0.0070, 0.0062, 0.0088, 0.0}, //deltaetain
|
479 |
sixie |
1.51 |
{0.0, 0.9, 0.0, 0.0, 0.0, 0.78, 0.0, 0.0}, //eoverp
|
480 |
ceballos |
1.40 |
{0.8,0.2,0.9,0,0,0,0,0}}; //extra cuts fbrem and E_Over_P
|
481 |
loizides |
1.30 |
|
482 |
|
|
Double_t loosecuts[6][8]={
|
483 |
loizides |
1.39 |
{0.076, 0.033, 0.07, 0.0, 0.083,0.148, 0.033, 0.0}, //hovere
|
484 |
|
|
{0.0101, 0.0095, 0.0097, 0.0, 0.03, 0.03, 0.03, 0.0}, //sigmaetaeta
|
485 |
|
|
{0.053, 0.0189, 0.059, 0.099, 0.0278,0.0157, 0.042, 0.080}, //deltaphiin
|
486 |
|
|
{0.0078, 0.00259, 0.0062, 0.0, 0.0078,0.0061, 0.0061, 0.0}, //deltaetain
|
487 |
|
|
{0.3, 0.92, 0.211, 0.0, 0.42, 0.88, 0.68, 0.0}, //eoverp
|
488 |
|
|
{0.8,0.2,0,0,0,0,0,0}}; //extra cuts fbrem and E_Over_P
|
489 |
loizides |
1.30 |
|
490 |
sixie |
1.55 |
Double_t VBTFWorkingPoint95[6][8] = {
|
491 |
|
|
{0.05, 0.05, 0.05, 0.05, 0.04, 0.04, 0.04, 0.04 }, //hovere
|
492 |
|
|
{0.01, 0.01, 0.01, 0.01, 0.03, 0.03, 0.03, 0.03 }, //sigmaetaeta
|
493 |
|
|
{0.08, 0.08, 0.08, 0.08, 0.07, 0.07, 0.07, 0.07 }, //deltaphiin
|
494 |
|
|
{0.006, 0.006, 0.006, 0.006, 0.008, 0.008, 0.008, 0.008 }, //deltaetain
|
495 |
|
|
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, //eoverp
|
496 |
|
|
{0.0, 0.0, 0, 0, 0, 0, 0, 0 } //extra cuts fbrem and E_Over_P
|
497 |
|
|
};
|
498 |
|
|
|
499 |
|
|
|
500 |
sixie |
1.51 |
Double_t VBTFWorkingPoint90[6][8] = {
|
501 |
sixie |
1.53 |
{0.05, 0.05, 0.05, 0.05, 0.025, 0.025, 0.025, 0.025 }, //hovere
|
502 |
|
|
{0.01, 0.01, 0.01, 0.01, 0.03, 0.03, 0.03, 0.03 }, //sigmaetaeta
|
503 |
|
|
{0.04, 0.04, 0.04, 0.04, 0.025, 0.025, 0.025, 0.025 }, //deltaphiin
|
504 |
|
|
{0.006, 0.006, 0.006, 0.006, 0.008, 0.008, 0.008, 0.008 }, //deltaetain
|
505 |
|
|
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, //eoverp
|
506 |
|
|
{0.0, 0.0, 0, 0, 0, 0, 0, 0 } //extra cuts fbrem and E_Over_P
|
507 |
sixie |
1.51 |
};
|
508 |
|
|
|
509 |
|
|
Double_t VBTFWorkingPoint80[6][8] = {
|
510 |
sixie |
1.53 |
{0.05, 0.05, 0.05, 0.05, 0.025, 0.025, 0.025, 0.025}, //hovere
|
511 |
|
|
{0.01, 0.01, 0.01, 0.01, 0.03, 0.03, 0.03, 0.03 }, //sigmaetaeta
|
512 |
|
|
{0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02 }, //deltaphiin
|
513 |
|
|
{0.006, 0.006, 0.006, 0.006, 0.006, 0.006, 0.006, 0.006}, //deltaetain
|
514 |
|
|
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, //eoverp
|
515 |
|
|
{0.0, 0.0, 0, 0, 0, 0, 0, 0 } //extra cuts fbrem and E_Over_P
|
516 |
sixie |
1.51 |
};
|
517 |
|
|
|
518 |
|
|
Double_t VBTFWorkingPoint70[6][8] = {
|
519 |
sixie |
1.53 |
{0.02, 0.02, 0.02, 0.02, 0.025, 0.025, 0.025, 0.025}, //hovere
|
520 |
|
|
{0.01, 0.01, 0.01, 0.01, 0.03, 0.03, 0.03, 0.03 }, //sigmaetaeta
|
521 |
|
|
{0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02 }, //deltaphiin
|
522 |
|
|
{0.006, 0.006, 0.006, 0.006, 0.003, 0.003, 0.003, 0.003}, //deltaetain
|
523 |
|
|
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, //eoverp
|
524 |
|
|
{0.0, 0.0, 0, 0, 0, 0, 0, 0 } //extra cuts fbrem and E_Over_P
|
525 |
sixie |
1.51 |
};
|
526 |
sixie |
1.42 |
|
527 |
loizides |
1.30 |
switch (idt) {
|
528 |
|
|
case kCustomIdTight:
|
529 |
|
|
memcpy(fCuts,tightcuts,sizeof(fCuts));
|
530 |
|
|
break;
|
531 |
|
|
case kCustomIdLoose:
|
532 |
|
|
memcpy(fCuts,loosecuts,sizeof(fCuts));
|
533 |
|
|
break;
|
534 |
sixie |
1.55 |
case kVBTFWorkingPoint95Id:
|
535 |
|
|
memcpy(fCuts,VBTFWorkingPoint95,sizeof(fCuts));
|
536 |
|
|
break;
|
537 |
sixie |
1.51 |
case kVBTFWorkingPoint90Id:
|
538 |
|
|
memcpy(fCuts,VBTFWorkingPoint90,sizeof(fCuts));
|
539 |
|
|
break;
|
540 |
|
|
case kVBTFWorkingPoint80Id:
|
541 |
|
|
memcpy(fCuts,VBTFWorkingPoint80,sizeof(fCuts));
|
542 |
|
|
break;
|
543 |
|
|
case kVBTFWorkingPoint70Id:
|
544 |
|
|
memcpy(fCuts,VBTFWorkingPoint70,sizeof(fCuts));
|
545 |
|
|
break;
|
546 |
loizides |
1.30 |
default:
|
547 |
|
|
memset(fCuts,0,sizeof(fCuts));
|
548 |
|
|
break;
|
549 |
|
|
}
|
550 |
|
|
}
|
551 |
sixie |
1.51 |
|
552 |
|
|
//--------------------------------------------------------------------------------------------------
|
553 |
|
|
void ElectronIDMod::SetCustomIsoCuts(EElIsoType idt)
|
554 |
|
|
{
|
555 |
|
|
|
556 |
|
|
//From Georgios Daskalakis email:
|
557 |
|
|
// WP90 (90%) ======= EB -- track_iso 5.0 GeV ecal_iso 5.0 GeV hcal_iso 5.0 GeV sihih 0.012 Dphi@vtx 0.04 Deta@vtx 0.007 H/E 0.05
|
558 |
|
|
// EE -- track_iso 5.0 GeV ecal_iso 5.0 GeV hcal_iso 5.0 GeV sihih 0.03 Dphi@vtx 0.04 Deta@vtx 0.007 H/E 0.05
|
559 |
|
|
// WP80 (80%) ======= EB -- track_iso 3.0 GeV ecal_iso 4.0 GeV hcal_iso 5.0 GeV sihih 0.01 Dphi@vtx 0.02 Deta@vtx 0.006 H/E 0.05
|
560 |
|
|
// EE -- track_iso 1.5 GeV ecal_iso 2.5 GeV hcal_iso 0.7 GeV sihih 0.03 Dphi@vtx 0.02 Deta@vtx 0.006 H/E 0.025
|
561 |
|
|
// WP70 (70%) ======= EB -- track_iso 2.5 GeV ecal_iso 3.0 GeV hcal_iso 5.0 GeV sihih 0.01 Dphi@vtx 0.02 Deta@vtx 0.006 H/E 0.02
|
562 |
|
|
// EE -- track_iso 0.8 GeV ecal_iso 2.5 GeV hcal_iso 0.25 GeV sihih 0.03 Dphi@vtx 0.02 Deta@vtx 0.003 H/E 0.0025
|
563 |
|
|
|
564 |
sixie |
1.55 |
Double_t VBTFWorkingPoint95[4][2] = {
|
565 |
|
|
{7.0 , 8.0 }, //TrkIso
|
566 |
|
|
{5.0 , 3.0 }, //ECALIso
|
567 |
|
|
{5.0 , 2.0 }, //HCALIso
|
568 |
|
|
{9999, 9999 } //Combined
|
569 |
|
|
};
|
570 |
|
|
|
571 |
|
|
Double_t VBTFWorkingPoint90[4][2] = {
|
572 |
sixie |
1.53 |
{6.0 , 6.0 }, //TrkIso
|
573 |
|
|
{5.0 , 2.5 }, //ECALIso
|
574 |
|
|
{5.0 , 1.5 }, //HCALIso
|
575 |
sixie |
1.51 |
{9999, 9999 } //Combined
|
576 |
|
|
};
|
577 |
|
|
|
578 |
sixie |
1.55 |
Double_t VBTFWorkingPoint80[4][2] = {
|
579 |
sixie |
1.51 |
{3.0 , 1.5 }, //TrkIso
|
580 |
|
|
{4.0 , 2.5 }, //ECALIso
|
581 |
|
|
{5.0 , 0.7 }, //HCALIso
|
582 |
|
|
{9999, 9999 } //Combined
|
583 |
|
|
};
|
584 |
|
|
|
585 |
sixie |
1.55 |
Double_t VBTFWorkingPoint70[4][2] = {
|
586 |
sixie |
1.51 |
{2.5 , 0.8 }, //TrkIso
|
587 |
|
|
{3.0 , 2.5 }, //ECALIso
|
588 |
|
|
{5.0 , 0.25 }, //HCALIso
|
589 |
|
|
{9999, 9999 } //Combined
|
590 |
|
|
};
|
591 |
|
|
|
592 |
|
|
switch (idt) {
|
593 |
sixie |
1.55 |
case kVBTFWorkingPoint95Iso:
|
594 |
|
|
memcpy(fIsoCuts,VBTFWorkingPoint95,sizeof(fIsoCuts));
|
595 |
|
|
break;
|
596 |
sixie |
1.51 |
case kVBTFWorkingPoint90Iso:
|
597 |
sixie |
1.52 |
memcpy(fIsoCuts,VBTFWorkingPoint90,sizeof(fIsoCuts));
|
598 |
sixie |
1.51 |
break;
|
599 |
|
|
case kVBTFWorkingPoint80Iso:
|
600 |
sixie |
1.52 |
memcpy(fIsoCuts,VBTFWorkingPoint80,sizeof(fIsoCuts));
|
601 |
sixie |
1.51 |
break;
|
602 |
|
|
case kVBTFWorkingPoint70Iso:
|
603 |
sixie |
1.52 |
memcpy(fIsoCuts,VBTFWorkingPoint70,sizeof(fIsoCuts));
|
604 |
sixie |
1.51 |
break;
|
605 |
|
|
default:
|
606 |
sixie |
1.52 |
memset(fIsoCuts,0,sizeof(fIsoCuts));
|
607 |
sixie |
1.51 |
break;
|
608 |
|
|
}
|
609 |
|
|
}
|