CMS 3D CMS Logo

heepElectronID_tools.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # Define eta constants
4 ebMax = 1.4442
5 eeMin = 1.566
6 ebCutOff=1.479
7 
8 
9 # ===============================================
10 # Define containers used by cut definitions
11 # ===============================================
12 
14  """
15  This is a container class to hold numerical cut values for either
16  the barrel or endcap set of cuts
17  """
18  def __init__(self,
19  idName,
20  dEtaInSeedCut,
21  dPhiInCut,
22  full5x5SigmaIEtaIEtaCut,
23  # Two constants for the GsfEleFull5x5E2x5OverE5x5Cut
24  minE1x5OverE5x5Cut,
25  minE2x5OverE5x5Cut,
26  # Three constants for the GsfEleHadronicOverEMLinearCut:
27  # cut = constTerm if value < slopeStart
28  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
29  hOverESlopeTerm,
30  hOverESlopeStart,
31  hOverEConstTerm,
32  # Three constants for the GsfEleTrkPtIsoCut:
33  # cut = constTerm if value < slopeStart
34  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
35  trkIsoSlopeTerm,
36  trkIsoSlopeStart,
37  trkIsoConstTerm,
38  # Three constants for the GsfEleEmHadD1IsoRhoCut:
39  # cut = constTerm if value < slopeStart
40  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
41  # Also for the same cut, the effective area for the rho correction of the isolation
42  ehIsoSlopeTerm,
43  ehIsoSlopeStart,
44  ehIsoConstTerm,
45  effAreaForEHIso,
46  # other cuts:
47  dxyCut,
48  maxMissingHitsCut,
49  ecalDrivenCut
50  ):
51  # assign values taken from all the arguments above
52  self.idName = idName
53  self.dEtaInSeedCut = dEtaInSeedCut
54  self.dPhiInCut = dPhiInCut
55  self.full5x5SigmaIEtaIEtaCut = full5x5SigmaIEtaIEtaCut
56  self.minE1x5OverE5x5Cut = minE1x5OverE5x5Cut
57  self.minE2x5OverE5x5Cut = minE2x5OverE5x5Cut
58  self.hOverESlopeTerm = hOverESlopeTerm
59  self.hOverESlopeStart = hOverESlopeStart
60  self.hOverEConstTerm = hOverEConstTerm
61  self.trkIsoSlopeTerm = trkIsoSlopeTerm
62  self.trkIsoSlopeStart = trkIsoSlopeStart
63  self.trkIsoConstTerm = trkIsoConstTerm
64  self.ehIsoSlopeTerm = ehIsoSlopeTerm
65  self.ehIsoSlopeStart = ehIsoSlopeStart
66  self.ehIsoConstTerm = ehIsoConstTerm
67  self.effAreaForEHIso = effAreaForEHIso
68  self.dxyCut = dxyCut
69  self.maxMissingHitsCut = maxMissingHitsCut
70  self.ecalDrivenCut = ecalDrivenCut
71 
73  """
74  This is a container class to hold numerical cut values for either
75  the barrel or endcap set of cuts
76  """
77  def __init__(self,
78  idName,
79  dEtaInSeedCut,
80  dPhiInCut,
81  full5x5SigmaIEtaIEtaCut,
82  # Two constants for the GsfEleFull5x5E2x5OverE5x5Cut
83  minE1x5OverE5x5Cut,
84  minE2x5OverE5x5Cut,
85  # Three constants for the GsfEleHadronicOverEMLinearCut:
86  # cut = constTerm if value < slopeStart
87  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
88  hOverESlopeTerm,
89  hOverESlopeStart,
90  hOverEConstTerm,
91  # Three constants for the GsfEleTrkPtIsoCut:
92  # cut = constTerm if value < slopeStart
93  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
94  trkIsoSlopeTerm,
95  trkIsoSlopeStart,
96  trkIsoConstTerm,
97  trkIsoRhoCorrStart,
98  trkIsoEffArea,
99  # Three constants for the GsfEleEmHadD1IsoRhoCut:
100  # cut = constTerm if value < slopeStart
101  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
102  # Also for the same cut, the effective area for the rho correction of the isolation
103  ehIsoSlopeTerm,
104  ehIsoSlopeStart,
105  ehIsoConstTerm,
106  effAreaForEHIso,
107  # other cuts:
108  dxyCut,
109  maxMissingHitsCut,
110  ecalDrivenCut
111  ):
112  # assign values taken from all the arguments above
113  self.idName = idName
114  self.dEtaInSeedCut = dEtaInSeedCut
115  self.dPhiInCut = dPhiInCut
116  self.full5x5SigmaIEtaIEtaCut = full5x5SigmaIEtaIEtaCut
117  self.minE1x5OverE5x5Cut = minE1x5OverE5x5Cut
118  self.minE2x5OverE5x5Cut = minE2x5OverE5x5Cut
119  self.hOverESlopeTerm = hOverESlopeTerm
120  self.hOverESlopeStart = hOverESlopeStart
121  self.hOverEConstTerm = hOverEConstTerm
122  self.trkIsoSlopeTerm = trkIsoSlopeTerm
123  self.trkIsoSlopeStart = trkIsoSlopeStart
124  self.trkIsoConstTerm = trkIsoConstTerm
125  self.trkIsoRhoCorrStart = trkIsoRhoCorrStart
126  self.trkIsoEffArea = trkIsoEffArea
127  self.ehIsoSlopeTerm = ehIsoSlopeTerm
128  self.ehIsoSlopeStart = ehIsoSlopeStart
129  self.ehIsoConstTerm = ehIsoConstTerm
130  self.effAreaForEHIso = effAreaForEHIso
131  self.dxyCut = dxyCut
132  self.maxMissingHitsCut = maxMissingHitsCut
133  self.ecalDrivenCut = ecalDrivenCut
134 # ==============================================================
135 # Define individual cut configurations used by complete cut sets
136 # ==============================================================
137 
138 # The mininum pt cut is set to 35 GeV
139 def psetMinPtCut(cutValue=35.):
140  return cms.PSet(
141  cutName = cms.string("MinPtCut"),
142  minPt = cms.double(cutValue),
143  needsAdditionalProducts = cms.bool(False),
144  isIgnored = cms.bool(False)
145  )
146 
147 # The mininum pt cut is set to 5 GeV
148 def psetMinEcalEtCut(cutValue=5.):
149  return cms.PSet(
150  cutName = cms.string("GsfEleMinEcalEtCut"),
151  minEt = cms.double(cutValue),
152  needsAdditionalProducts = cms.bool(False),
153  isIgnored = cms.bool(False)
154  )
155 
156 # Take all particles in the eta ranges 0-ebMax and eeMin-2.5
158  return cms.PSet(
159  cutName = cms.string("GsfEleSCEtaMultiRangeCut"),
160  useAbsEta = cms.bool(True),
161  allowedEtaRanges = cms.VPSet(
162  cms.PSet( minEta = cms.double(0.0),
163  maxEta = cms.double(ebMax) ),
164  cms.PSet( minEta = cms.double(eeMin),
165  maxEta = cms.double(2.5) )
166  ),
167  needsAdditionalProducts = cms.bool(False),
168  isIgnored = cms.bool(False)
169  )
170 
171 # Configure the cut on the dEtaIn for the seed
172 def psetGsfEleDEtaInSeedCut(wpEB, wpEE):
173  return cms.PSet(
174  cutName = cms.string('GsfEleEBEECut'),
175  cutString = cms.string("abs(deltaEtaSeedClusterTrackAtVtx)"),
176  cutValueEB = cms.double( wpEB.dEtaInSeedCut ),
177  cutValueEE = cms.double( wpEE.dEtaInSeedCut ),
178  needsAdditionalProducts = cms.bool(False),
179  isIgnored = cms.bool(False)
180  )
181 
182 # Configure the cut on the dPhiIn
183 def psetGsfEleDPhiInCut(wpEB, wpEE):
184  return cms.PSet(
185  cutName = cms.string('GsfEleEBEECut'),
186  cutString = cms.string("abs(deltaPhiSuperClusterTrackAtVtx)"),
187  cutValueEB = cms.double( wpEB.dPhiInCut ),
188  cutValueEE = cms.double( wpEE.dPhiInCut ),
189  needsAdditionalProducts = cms.bool(False),
190  isIgnored = cms.bool(False)
191  )
192 
193 # Confugure the full 5x5 sigmaIEtaIEta cut
195  return cms.PSet(
196  cutName = cms.string('GsfEleEBEECut'),
197  cutString = cms.string("full5x5_sigmaIetaIeta"),
198  cutValueEB = cms.double( wpEB.full5x5SigmaIEtaIEtaCut ),
199  cutValueEE = cms.double( wpEE.full5x5SigmaIEtaIEtaCut ),
200  needsAdditionalProducts = cms.bool(False),
201  isIgnored = cms.bool(False)
202  )
203 
205  return cms.PSet(
206  cutName = cms.string('GsfEleFull5x5SigmaIEtaIEtaWithSatCut'),
207  maxSigmaIEtaIEtaEB = cms.double( wpEB.full5x5SigmaIEtaIEtaCut ),
208  maxSigmaIEtaIEtaEE = cms.double( wpEE.full5x5SigmaIEtaIEtaCut ),
209  maxNrSatCrysIn5x5EB =cms.int32( 0 ),
210  maxNrSatCrysIn5x5EE =cms.int32( 0 ),
211  needsAdditionalProducts = cms.bool(False),
212 
213  isIgnored = cms.bool(False)
214  )
215 # Configure XxX shower shape cuts
217  return cms.PSet(
218  cutName = cms.string('GsfEleFull5x5E2x5OverE5x5Cut'),
219  # E1x5 / E5x5
220  minE1x5OverE5x5EB = cms.double( wpEB.minE1x5OverE5x5Cut ),
221  minE1x5OverE5x5EE = cms.double( wpEE.minE1x5OverE5x5Cut ),
222  # E2x5 / E5x5
223  minE2x5OverE5x5EB = cms.double( wpEB.minE2x5OverE5x5Cut ),
224  minE2x5OverE5x5EE = cms.double( wpEE.minE2x5OverE5x5Cut ),
225  needsAdditionalProducts = cms.bool(False),
226  isIgnored = cms.bool(False)
227  )
228 # Configure XxX shower shape cuts
230  return cms.PSet(
231  cutName = cms.string('GsfEleFull5x5E2x5OverE5x5WithSatCut'),
232  # E1x5 / E5x5
233  minE1x5OverE5x5EB = cms.double( wpEB.minE1x5OverE5x5Cut ),
234  minE1x5OverE5x5EE = cms.double( wpEE.minE1x5OverE5x5Cut ),
235  # E2x5 / E5x5
236  minE2x5OverE5x5EB = cms.double( wpEB.minE2x5OverE5x5Cut ),
237  minE2x5OverE5x5EE = cms.double( wpEE.minE2x5OverE5x5Cut ),
238  maxNrSatCrysIn5x5EB =cms.int32( 0 ),
239  maxNrSatCrysIn5x5EE =cms.int32( 0 ),
240  needsAdditionalProducts = cms.bool(False),
241  isIgnored = cms.bool(False)
242  )
243 # Configure the cut of E/H
245  return cms.PSet(
246  cutName = cms.string('GsfEleHadronicOverEMLinearCut'),
247  # Three constants for the GsfEleHadronicOverEMLinearCut
248  # cut = constTerm if value < slopeStart
249  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
250  slopeTermEB = cms.double( wpEB.hOverESlopeTerm ),
251  slopeTermEE = cms.double( wpEE.hOverESlopeTerm ),
252  slopeStartEB = cms.double( wpEB.hOverESlopeStart ),
253  slopeStartEE = cms.double( wpEE.hOverESlopeStart ),
254  constTermEB = cms.double( wpEB.hOverEConstTerm ),
255  constTermEE = cms.double( wpEE.hOverEConstTerm ),
256  needsAdditionalProducts = cms.bool(False),
257  isIgnored = cms.bool(False)
258  )
259 
260 # Configure the cut on the tracker isolation
261 def psetGsfEleTrkPtIsoCut(wpEB, wpEE, useHEEPIso = False):
262  return cms.PSet(
263  cutName = cms.string('GsfEleTrkPtIsoCut'),
264  # Three constants for the GsfEleTrkPtIsoCut
265  # cut = constTerm if value < slopeStart
266  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
267  slopeTermEB = cms.double( wpEB.trkIsoSlopeTerm ),
268  slopeTermEE = cms.double( wpEE.trkIsoSlopeTerm ),
269  slopeStartEB = cms.double( wpEB.trkIsoSlopeStart ),
270  slopeStartEE = cms.double( wpEE.trkIsoSlopeStart ),
271  constTermEB = cms.double( wpEB.trkIsoConstTerm ),
272  constTermEE = cms.double( wpEE.trkIsoConstTerm ),
273  useHEEPIso = cms.bool(useHEEPIso),
274  needsAdditionalProducts = cms.bool(False),
275  isIgnored = cms.bool(False)
276  )
277 # Configure the cut on the tracker isolation with a rho correction (hack for 76X)
278 def psetGsfEleTrkPtIsoRhoCut(wpEB, wpEE):
279  return cms.PSet(
280  cutName = cms.string('GsfEleTrkPtIsoRhoCut'),
281  # Three constants for the GsfEleTrkPtIsoCut
282  # cut = constTerm if value < slopeStart
283  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
284  slopeTermEB = cms.double( wpEB.trkIsoSlopeTerm ),
285  slopeTermEE = cms.double( wpEE.trkIsoSlopeTerm ),
286  slopeStartEB = cms.double( wpEB.trkIsoSlopeStart ),
287  slopeStartEE = cms.double( wpEE.trkIsoSlopeStart ),
288  constTermEB = cms.double( wpEB.trkIsoConstTerm ),
289  constTermEE = cms.double( wpEE.trkIsoConstTerm ),
290  rhoEtStartEB = cms.double( wpEB.trkIsoRhoCorrStart),
291  rhoEtStartEE = cms.double( wpEE.trkIsoRhoCorrStart),
292  rhoEAEB = cms.double( wpEB.trkIsoEffArea),
293  rhoEAEE = cms.double( wpEE.trkIsoEffArea),
294  rho = cms.InputTag("fixedGridRhoFastjetAll"),
295  needsAdditionalProducts = cms.bool(True),
296  isIgnored = cms.bool(False)
297  )
299  return cms.PSet(
300  cutName = cms.string('GsfEleValueMapIsoRhoCut'),
301  # Three constants for the GsfEleTrkPtIsoCut
302  # cut = constTerm if value < slopeStart
303  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
304  slopeTermEB = cms.double( wpEB.trkIsoSlopeTerm ),
305  slopeTermEE = cms.double( wpEE.trkIsoSlopeTerm ),
306  slopeStartEB = cms.double( wpEB.trkIsoSlopeStart ),
307  slopeStartEE = cms.double( wpEE.trkIsoSlopeStart ),
308  constTermEB = cms.double( wpEB.trkIsoConstTerm ),
309  constTermEE = cms.double( wpEE.trkIsoConstTerm ),
310  #no rho so we zero it out, if the input tag is empty, its ignored anyways
311  rhoEtStartEB = cms.double( 999999.),
312  rhoEtStartEE = cms.double( 999999.),
313  rhoEAEB = cms.double( 0. ),
314  rhoEAEE = cms.double( 0. ),
315  rho = cms.InputTag(""),
316  value = cms.InputTag("heepIDVarValueMaps","eleTrkPtIsoNoJetCore"),
317  needsAdditionalProducts = cms.bool(True),
318  isIgnored = cms.bool(False)
319  )
321  return cms.PSet(
322  cutName = cms.string('GsfEleValueMapIsoRhoCut'),
323  # Three constants for the GsfEleTrkPtIsoCut
324  # cut = constTerm if value < slopeStart
325  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
326  slopeTermEB = cms.double( wpEB.trkIsoSlopeTerm ),
327  slopeTermEE = cms.double( wpEE.trkIsoSlopeTerm ),
328  slopeStartEB = cms.double( wpEB.trkIsoSlopeStart ),
329  slopeStartEE = cms.double( wpEE.trkIsoSlopeStart ),
330  constTermEB = cms.double( wpEB.trkIsoConstTerm ),
331  constTermEE = cms.double( wpEE.trkIsoConstTerm ),
332  #no rho so we zero it out, if the input tag is empty, its ignored anyways
333  rhoEtStartEB = cms.double( 999999.),
334  rhoEtStartEE = cms.double( 999999.),
335  rhoEAEB = cms.double( 0. ),
336  rhoEAEE = cms.double( 0. ),
337  rho = cms.InputTag(""),
338  value = cms.InputTag("heepIDVarValueMaps","eleTrkPtIso"),
339  needsAdditionalProducts = cms.bool(True),
340  isIgnored = cms.bool(False)
341  )
342 # Configure the cut on the EM + Had_depth_1 isolation with rho correction
343 def psetGsfEleEmHadD1IsoRhoCut(wpEB, wpEE,energyType="EcalTrk"):
344  return cms.PSet(
345  cutName = cms.string('GsfEleEmHadD1IsoRhoCut'),
346  slopeTermEB = cms.double( wpEB.ehIsoSlopeTerm ),
347  slopeTermEE = cms.double( wpEE.ehIsoSlopeTerm ),
348  slopeStartEB = cms.double( wpEB.ehIsoSlopeStart ),
349  slopeStartEE = cms.double( wpEE.ehIsoSlopeStart ),
350  constTermEB = cms.double( wpEB.ehIsoConstTerm ),
351  constTermEE = cms.double( wpEE.ehIsoConstTerm ),
352  energyType = cms.string( energyType ),
353  rhoConstant = cms.double( wpEB.effAreaForEHIso), # expected to be the same for EB and EE
354  rho = cms.InputTag("fixedGridRhoFastjetAll"),
355  needsAdditionalProducts = cms.bool(True),
356  isIgnored = cms.bool(False)
357  )
358 
359 # Configure the dxy cut
360 def psetGsfEleDxyCut(wpEB, wpEE):
361  return cms.PSet(
362  cutName = cms.string('GsfEleDxyCut'),
363  dxyCutValueEB = cms.double( wpEB.dxyCut ),
364  dxyCutValueEE = cms.double( wpEE.dxyCut ),
365  vertexSrc = cms.InputTag("offlinePrimaryVertices"),
366  vertexSrcMiniAOD = cms.InputTag("offlineSlimmedPrimaryVertices"),
367  barrelCutOff = cms.double(ebCutOff),
368  needsAdditionalProducts = cms.bool(True),
369  isIgnored = cms.bool(False)
370  )
371 
372 # Configure the cut on missing hits
373 def psetGsfEleMissingHitsCut(wpEB, wpEE):
374  return cms.PSet(
375  cutName = cms.string('GsfEleMissingHitsCut'),
376  maxMissingHitsEB = cms.uint32( wpEB.maxMissingHitsCut ),
377  maxMissingHitsEE = cms.uint32( wpEE.maxMissingHitsCut ),
378  barrelCutOff = cms.double(ebCutOff),
379  needsAdditionalProducts = cms.bool(False),
380  isIgnored = cms.bool(False)
381  )
382 def psetGsfEleEcalDrivenCut(wpEB, wpEE):
383  return cms.PSet(
384  cutName = cms.string('GsfEleEcalDrivenCut'),
385  ecalDrivenEB = cms.int32( wpEB.ecalDrivenCut ),
386  ecalDrivenEE = cms.int32( wpEE.ecalDrivenCut ),
387  barrelCutOff = cms.double(ebCutOff),
388  needsAdditionalProducts = cms.bool(False),
389  isIgnored = cms.bool(False)
390  )
391 
392 # ==============================================================
393 # Define the complete cut sets
394 # ==============================================================
395 
397  """
398  This function configures the full cms.PSet for a VID ID and returns it.
399  The inputs: two objects of the type HEEP_WorkingPoint_V1, one
400  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
401  """
402  parameterSet = cms.PSet(
403  idName = cms.string("heepElectronID-HEEPV51"),
404  cutFlow = cms.VPSet(
405  psetMinPtCut(cutValue=35.), #0
407  psetGsfEleDEtaInSeedCut(wpEB,wpEE), #2
408  psetGsfEleDPhiInCut(wpEB,wpEE), #3
409  psetGsfEleFull5x5SigmaIEtaIEtaCut(wpEB,wpEE), #4
410  psetGsfEleFull5x5E2x5OverE5x5Cut(wpEB,wpEE), #5
411  psetGsfEleHadronicOverEMLinearCut(wpEB,wpEE), #6
412  psetGsfEleTrkPtIsoCut(wpEB,wpEE), #7
413  psetGsfEleEmHadD1IsoRhoCut(wpEB,wpEE), #8
414  psetGsfEleDxyCut(wpEB,wpEE), #9
415  psetGsfEleMissingHitsCut(wpEB,wpEE), #10,
416  psetGsfEleEcalDrivenCut(wpEB,wpEE) #11
417  )
418  )
419  return parameterSet
420 
422  """
423  This function configures the full cms.PSet for a VID ID and returns it.
424  The inputs: two objects of the type HEEP_WorkingPoint_V1, one
425  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
426  """
427  parameterSet = cms.PSet(
428  idName = cms.string("heepElectronID-HEEPV60"),
429  cutFlow = cms.VPSet(
430  psetMinPtCut(cutValue=35.), #0
432  psetGsfEleDEtaInSeedCut(wpEB,wpEE), #2
433  psetGsfEleDPhiInCut(wpEB,wpEE), #3
434  psetGsfEleFull5x5SigmaIEtaIEtaCut(wpEB,wpEE), #4
435  psetGsfEleFull5x5E2x5OverE5x5Cut(wpEB,wpEE), #5
436  psetGsfEleHadronicOverEMLinearCut(wpEB,wpEE), #6
437  psetGsfEleTrkPtIsoCut(wpEB,wpEE), #7
438  psetGsfEleEmHadD1IsoRhoCut(wpEB,wpEE), #8
439  psetGsfEleDxyCut(wpEB,wpEE), #9
440  psetGsfEleMissingHitsCut(wpEB,wpEE), #10,
441  psetGsfEleEcalDrivenCut(wpEB,wpEE) #11
442  )
443  )
444  return parameterSet
445 
446 
447 def configureHEEPElectronID_V70(idName, wpEB, wpEE):
448  """
449  This function configures the full cms.PSet for a VID ID and returns it.
450  The inputs: two objects of the type HEEP_WorkingPoint_V1, one
451  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
452  """
453  parameterSet = cms.PSet(
454  idName = cms.string(idName),
455  cutFlow = cms.VPSet(
456  psetMinPtCut(cutValue=35.), #0
458  psetGsfEleDEtaInSeedCut(wpEB,wpEE), #2
459  psetGsfEleDPhiInCut(wpEB,wpEE), #3
462  psetGsfEleHadronicOverEMLinearCut(wpEB,wpEE), #6
463  psetGsfEleTrkPtIsoCut(wpEB,wpEE,useHEEPIso=True),#7
464  psetGsfEleEmHadD1IsoRhoCut(wpEB,wpEE), #8
465  psetGsfEleDxyCut(wpEB,wpEE), #9
466  psetGsfEleMissingHitsCut(wpEB,wpEE), #10,
467  psetGsfEleEcalDrivenCut(wpEB,wpEE) #11
468  )
469  )
470  return parameterSet
471 
472 def configureHEEPElectronID_V71(idName, wpEB, wpEE,minEt):
473  """
474  This function configures the full cms.PSet for a VID ID and returns it.
475  The inputs: two objects of the type HEEP_WorkingPoint_V1, one
476  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
477  """
478  parameterSet = cms.PSet(
479  idName = cms.string(idName),
480  cutFlow = cms.VPSet(
481  psetMinEcalEtCut(cutValue=minEt), #0
483  psetGsfEleDEtaInSeedCut(wpEB,wpEE), #2
484  psetGsfEleDPhiInCut(wpEB,wpEE), #3
487  psetGsfEleHadronicOverEMLinearCut(wpEB,wpEE), #6
488  psetGsfEleTrkPtIsoCut(wpEB,wpEE,useHEEPIso=True),#7
489  psetGsfEleEmHadD1IsoRhoCut(wpEB,wpEE,energyType="Ecal"), #8
490  psetGsfEleDxyCut(wpEB,wpEE), #9
491  psetGsfEleMissingHitsCut(wpEB,wpEE), #10,
492  psetGsfEleEcalDrivenCut(wpEB,wpEE) #11
493  )
494  )
495  return parameterSet
496 
497 
498 def configureHEEPElectronID_V60_80XAOD(idName, wpEB, wpEE):
499  """
500  This function configures the full cms.PSet for a VID ID and returns it.
501  The inputs: two objects of the type HEEP_WorkingPoint_V1, one
502  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
503  """
504  parameterSet = cms.PSet(
505  idName = cms.string(idName),
506  cutFlow = cms.VPSet(
507  psetMinPtCut(cutValue=35.), #0
509  psetGsfEleDEtaInSeedCut(wpEB,wpEE), #2
510  psetGsfEleDPhiInCut(wpEB,wpEE), #3
513  psetGsfEleHadronicOverEMLinearCut(wpEB,wpEE), #6
514  psetGsfEleTrkPtNoJetCoreIsoCut(wpEB,wpEE), #7
515  psetGsfEleEmHadD1IsoRhoCut(wpEB,wpEE), #8
516  psetGsfEleDxyCut(wpEB,wpEE), #9
517  psetGsfEleMissingHitsCut(wpEB,wpEE), #10,
518  psetGsfEleEcalDrivenCut(wpEB,wpEE) #11
519  )
520  )
521  return parameterSet
522 
524  """
525  This function configures the full cms.PSet for a VID ID and returns it.
526  The inputs: two objects of the type HEEP_WorkingPoint_V2, one
527  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
528  """
529  parameterSet = cms.PSet(
530  idName = cms.string("heepElectronID-HEEPV61"),
531  cutFlow = cms.VPSet(
532  psetMinPtCut(cutValue=35.), #0
534  psetGsfEleDEtaInSeedCut(wpEB,wpEE), #2
535  psetGsfEleDPhiInCut(wpEB,wpEE), #3
536  psetGsfEleFull5x5SigmaIEtaIEtaCut(wpEB,wpEE), #4
537  psetGsfEleFull5x5E2x5OverE5x5Cut(wpEB,wpEE), #5
538  psetGsfEleHadronicOverEMLinearCut(wpEB,wpEE), #6
539  psetGsfEleTrkPtIsoRhoCut(wpEB,wpEE), #7
540  psetGsfEleEmHadD1IsoRhoCut(wpEB,wpEE), #8
541  psetGsfEleDxyCut(wpEB,wpEE), #9
542  psetGsfEleMissingHitsCut(wpEB,wpEE), #10,
543  psetGsfEleEcalDrivenCut(wpEB,wpEE) #11
544  )
545  )
546  return parameterSet
547 
548 def addHEEPVMProducerToSeq(process,seq,useMiniAOD, task=None):
549  newTask = cms.Task()
550  seq.associate(newTask)
551  if task is not None:
552  task.add(newTask)
553 
554  process.load("RecoEgamma.ElectronIdentification.heepIdVarValueMapProducer_cfi")
555  newTask.add(process.heepIDVarValueMaps)
556 
557  if useMiniAOD==False:
558  process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi")
559  process.load("PhysicsTools.PatAlgos.slimming.primaryVertexAssociation_cfi")
560  process.load("PhysicsTools.PatAlgos.slimming.offlineSlimmedPrimaryVertices_cfi")
561  process.load("PhysicsTools.PatAlgos.slimming.packedPFCandidates_cfi")
562  from PhysicsTools.PatAlgos.slimming.packedPFCandidates_cfi import packedPFCandidates
563  process.packedCandsForTkIso = packedPFCandidates.clone()
564  process.packedCandsForTkIso.PuppiSrc=cms.InputTag("")
565  process.packedCandsForTkIso.PuppiNoLepSrc=cms.InputTag("")
566 
567  process.load("PhysicsTools.PatAlgos.slimming.lostTracks_cfi")
568  from PhysicsTools.PatAlgos.slimming.lostTracks_cfi import lostTracks
569  process.lostTracksForTkIso = lostTracks.clone()
570  process.lostTracksForTkIso.packedPFCandidates =cms.InputTag("packedCandsForTkIso")
571  newTask.add(process.primaryVertexAssociation,
572  process.offlineSlimmedPrimaryVertices,
573  process.packedCandsForTkIso,
574  process.lostTracksForTkIso)
575 
576 def addHEEPProducersToSeq(process,seq,useMiniAOD, task=None):
577  '''currently no additional products are needed to run the HEEP ID so this
578  function simply remains as a placeholder
579  '''
580  return
heepElectronID_tools.HEEP_WorkingPoint_V1.ehIsoConstTerm
ehIsoConstTerm
Definition: heepElectronID_tools.py:34
heepElectronID_tools.HEEP_WorkingPoint_V2.effAreaForEHIso
effAreaForEHIso
Definition: heepElectronID_tools.py:96
heepElectronID_tools.psetGsfEleFull5x5E2x5OverE5x5Cut
def psetGsfEleFull5x5E2x5OverE5x5Cut(wpEB, wpEE)
Definition: heepElectronID_tools.py:216
heepElectronID_tools.HEEP_WorkingPoint_V1.dPhiInCut
dPhiInCut
Definition: heepElectronID_tools.py:22
heepElectronID_tools.HEEP_WorkingPoint_V2.dxyCut
dxyCut
Definition: heepElectronID_tools.py:97
heepElectronID_tools.configureHEEPElectronID_V61
def configureHEEPElectronID_V61(wpEB, wpEE)
Definition: heepElectronID_tools.py:523
heepElectronID_tools.psetGsfEleSCEtaMultiRangeCut
def psetGsfEleSCEtaMultiRangeCut()
Definition: heepElectronID_tools.py:157
heepElectronID_tools.HEEP_WorkingPoint_V1.trkIsoConstTerm
trkIsoConstTerm
Definition: heepElectronID_tools.py:31
heepElectronID_tools.HEEP_WorkingPoint_V1.hOverESlopeStart
hOverESlopeStart
Definition: heepElectronID_tools.py:27
heepElectronID_tools.HEEP_WorkingPoint_V2.hOverEConstTerm
hOverEConstTerm
Definition: heepElectronID_tools.py:87
heepElectronID_tools.psetGsfEleFull5x5SigmaIEtaIEtaCut
def psetGsfEleFull5x5SigmaIEtaIEtaCut(wpEB, wpEE)
Definition: heepElectronID_tools.py:194
heepElectronID_tools.HEEP_WorkingPoint_V2.ehIsoSlopeTerm
ehIsoSlopeTerm
Definition: heepElectronID_tools.py:93
heepElectronID_tools.psetGsfEleEmHadD1IsoRhoCut
def psetGsfEleEmHadD1IsoRhoCut(wpEB, wpEE, energyType="EcalTrk")
Definition: heepElectronID_tools.py:343
heepElectronID_tools.psetGsfEleDEtaInSeedCut
def psetGsfEleDEtaInSeedCut(wpEB, wpEE)
Definition: heepElectronID_tools.py:172
heepElectronID_tools.HEEP_WorkingPoint_V2.ehIsoSlopeStart
ehIsoSlopeStart
Definition: heepElectronID_tools.py:94
heepElectronID_tools.HEEP_WorkingPoint_V1.full5x5SigmaIEtaIEtaCut
full5x5SigmaIEtaIEtaCut
Definition: heepElectronID_tools.py:23
heepElectronID_tools.configureHEEPElectronID_V70
def configureHEEPElectronID_V70(idName, wpEB, wpEE)
Definition: heepElectronID_tools.py:447
heepElectronID_tools.HEEP_WorkingPoint_V2.hOverESlopeTerm
hOverESlopeTerm
Definition: heepElectronID_tools.py:85
heepElectronID_tools.HEEP_WorkingPoint_V1.ehIsoSlopeStart
ehIsoSlopeStart
Definition: heepElectronID_tools.py:33
heepElectronID_tools.HEEP_WorkingPoint_V1.__init__
def __init__(self, idName, dEtaInSeedCut, dPhiInCut, full5x5SigmaIEtaIEtaCut, minE1x5OverE5x5Cut, minE2x5OverE5x5Cut, hOverESlopeTerm, hOverESlopeStart, hOverEConstTerm, trkIsoSlopeTerm, trkIsoSlopeStart, trkIsoConstTerm, ehIsoSlopeTerm, ehIsoSlopeStart, ehIsoConstTerm, effAreaForEHIso, dxyCut, maxMissingHitsCut, ecalDrivenCut)
Definition: heepElectronID_tools.py:18
heepElectronID_tools.psetGsfEleEcalDrivenCut
def psetGsfEleEcalDrivenCut(wpEB, wpEE)
Definition: heepElectronID_tools.py:382
heepElectronID_tools.HEEP_WorkingPoint_V2.trkIsoConstTerm
trkIsoConstTerm
Definition: heepElectronID_tools.py:90
heepElectronID_tools.HEEP_WorkingPoint_V2.trkIsoSlopeStart
trkIsoSlopeStart
Definition: heepElectronID_tools.py:89
heepElectronID_tools.HEEP_WorkingPoint_V2.dPhiInCut
dPhiInCut
Definition: heepElectronID_tools.py:81
heepElectronID_tools.psetGsfEleTrkPtIsoCut
def psetGsfEleTrkPtIsoCut(wpEB, wpEE, useHEEPIso=False)
Definition: heepElectronID_tools.py:261
heepElectronID_tools.HEEP_WorkingPoint_V1.hOverEConstTerm
hOverEConstTerm
Definition: heepElectronID_tools.py:28
heepElectronID_tools.HEEP_WorkingPoint_V1.idName
idName
Definition: heepElectronID_tools.py:20
heepElectronID_tools.HEEP_WorkingPoint_V2.minE1x5OverE5x5Cut
minE1x5OverE5x5Cut
Definition: heepElectronID_tools.py:83
heepElectronID_tools.HEEP_WorkingPoint_V2.trkIsoRhoCorrStart
trkIsoRhoCorrStart
Definition: heepElectronID_tools.py:91
heepElectronID_tools.psetMinEcalEtCut
def psetMinEcalEtCut(cutValue=5.)
Definition: heepElectronID_tools.py:148
heepElectronID_tools.HEEP_WorkingPoint_V2.dEtaInSeedCut
dEtaInSeedCut
Definition: heepElectronID_tools.py:80
heepElectronID_tools.HEEP_WorkingPoint_V2.full5x5SigmaIEtaIEtaCut
full5x5SigmaIEtaIEtaCut
Definition: heepElectronID_tools.py:82
heepElectronID_tools.psetGsfEleDxyCut
def psetGsfEleDxyCut(wpEB, wpEE)
Definition: heepElectronID_tools.py:360
heepElectronID_tools.HEEP_WorkingPoint_V1
Definition: heepElectronID_tools.py:13
heepElectronID_tools.configureHEEPElectronID_V60_80XAOD
def configureHEEPElectronID_V60_80XAOD(idName, wpEB, wpEE)
Definition: heepElectronID_tools.py:498
heepElectronID_tools.HEEP_WorkingPoint_V2.hOverESlopeStart
hOverESlopeStart
Definition: heepElectronID_tools.py:86
heepElectronID_tools.psetGsfEleFull5x5SigmaIEtaIEtaWithSatCut
def psetGsfEleFull5x5SigmaIEtaIEtaWithSatCut(wpEB, wpEE)
Definition: heepElectronID_tools.py:204
heepElectronID_tools.HEEP_WorkingPoint_V1.dEtaInSeedCut
dEtaInSeedCut
Definition: heepElectronID_tools.py:21
heepElectronID_tools.addHEEPVMProducerToSeq
def addHEEPVMProducerToSeq(process, seq, useMiniAOD, task=None)
Definition: heepElectronID_tools.py:548
heepElectronID_tools.psetGsfEleTrkPtFall16IsoCut
def psetGsfEleTrkPtFall16IsoCut(wpEB, wpEE)
Definition: heepElectronID_tools.py:320
lostTracks_cfi
heepElectronID_tools.HEEP_WorkingPoint_V1.trkIsoSlopeStart
trkIsoSlopeStart
Definition: heepElectronID_tools.py:30
packedPFCandidates_cfi
heepElectronID_tools.HEEP_WorkingPoint_V1.minE2x5OverE5x5Cut
minE2x5OverE5x5Cut
Definition: heepElectronID_tools.py:25
heepElectronID_tools.HEEP_WorkingPoint_V1.ehIsoSlopeTerm
ehIsoSlopeTerm
Definition: heepElectronID_tools.py:32
heepElectronID_tools.HEEP_WorkingPoint_V1.minE1x5OverE5x5Cut
minE1x5OverE5x5Cut
Definition: heepElectronID_tools.py:24
heepElectronID_tools.HEEP_WorkingPoint_V2.trkIsoEffArea
trkIsoEffArea
Definition: heepElectronID_tools.py:92
heepElectronID_tools.psetGsfEleMissingHitsCut
def psetGsfEleMissingHitsCut(wpEB, wpEE)
Definition: heepElectronID_tools.py:373
heepElectronID_tools.psetGsfEleDPhiInCut
def psetGsfEleDPhiInCut(wpEB, wpEE)
Definition: heepElectronID_tools.py:183
heepElectronID_tools.HEEP_WorkingPoint_V2
Definition: heepElectronID_tools.py:72
heepElectronID_tools.HEEP_WorkingPoint_V1.trkIsoSlopeTerm
trkIsoSlopeTerm
Definition: heepElectronID_tools.py:29
heepElectronID_tools.configureHEEPElectronID_V60
def configureHEEPElectronID_V60(wpEB, wpEE)
Definition: heepElectronID_tools.py:421
heepElectronID_tools.configureHEEPElectronID_V71
def configureHEEPElectronID_V71(idName, wpEB, wpEE, minEt)
Definition: heepElectronID_tools.py:472
heepElectronID_tools.HEEP_WorkingPoint_V2.trkIsoSlopeTerm
trkIsoSlopeTerm
Definition: heepElectronID_tools.py:88
heepElectronID_tools.psetGsfEleTrkPtNoJetCoreIsoCut
def psetGsfEleTrkPtNoJetCoreIsoCut(wpEB, wpEE)
Definition: heepElectronID_tools.py:298
heepElectronID_tools.psetGsfEleFull5x5E2x5OverE5x5WithSatCut
def psetGsfEleFull5x5E2x5OverE5x5WithSatCut(wpEB, wpEE)
Definition: heepElectronID_tools.py:229
heepElectronID_tools.HEEP_WorkingPoint_V2.idName
idName
Definition: heepElectronID_tools.py:79
heepElectronID_tools.HEEP_WorkingPoint_V2.__init__
def __init__(self, idName, dEtaInSeedCut, dPhiInCut, full5x5SigmaIEtaIEtaCut, minE1x5OverE5x5Cut, minE2x5OverE5x5Cut, hOverESlopeTerm, hOverESlopeStart, hOverEConstTerm, trkIsoSlopeTerm, trkIsoSlopeStart, trkIsoConstTerm, trkIsoRhoCorrStart, trkIsoEffArea, ehIsoSlopeTerm, ehIsoSlopeStart, ehIsoConstTerm, effAreaForEHIso, dxyCut, maxMissingHitsCut, ecalDrivenCut)
Definition: heepElectronID_tools.py:77
heepElectronID_tools.HEEP_WorkingPoint_V1.dxyCut
dxyCut
Definition: heepElectronID_tools.py:36
heepElectronID_tools.addHEEPProducersToSeq
def addHEEPProducersToSeq(process, seq, useMiniAOD, task=None)
Definition: heepElectronID_tools.py:576
heepElectronID_tools.HEEP_WorkingPoint_V1.ecalDrivenCut
ecalDrivenCut
Definition: heepElectronID_tools.py:38
heepElectronID_tools.HEEP_WorkingPoint_V1.maxMissingHitsCut
maxMissingHitsCut
Definition: heepElectronID_tools.py:37
heepElectronID_tools.psetGsfEleHadronicOverEMLinearCut
def psetGsfEleHadronicOverEMLinearCut(wpEB, wpEE)
Definition: heepElectronID_tools.py:244
heepElectronID_tools.HEEP_WorkingPoint_V2.maxMissingHitsCut
maxMissingHitsCut
Definition: heepElectronID_tools.py:98
heepElectronID_tools.psetMinPtCut
def psetMinPtCut(cutValue=35.)
Definition: heepElectronID_tools.py:139
heepElectronID_tools.HEEP_WorkingPoint_V1.effAreaForEHIso
effAreaForEHIso
Definition: heepElectronID_tools.py:35
heepElectronID_tools.configureHEEPElectronID_V51
def configureHEEPElectronID_V51(wpEB, wpEE)
Definition: heepElectronID_tools.py:396
heepElectronID_tools.psetGsfEleTrkPtIsoRhoCut
def psetGsfEleTrkPtIsoRhoCut(wpEB, wpEE)
Definition: heepElectronID_tools.py:278
heepElectronID_tools.HEEP_WorkingPoint_V1.hOverESlopeTerm
hOverESlopeTerm
Definition: heepElectronID_tools.py:26
heepElectronID_tools.HEEP_WorkingPoint_V2.minE2x5OverE5x5Cut
minE2x5OverE5x5Cut
Definition: heepElectronID_tools.py:84
heepElectronID_tools.HEEP_WorkingPoint_V2.ecalDrivenCut
ecalDrivenCut
Definition: heepElectronID_tools.py:99
heepElectronID_tools.HEEP_WorkingPoint_V2.ehIsoConstTerm
ehIsoConstTerm
Definition: heepElectronID_tools.py:95