CMS 3D CMS Logo

cutBasedElectronID_tools.py
Go to the documentation of this file.
1 
2 import FWCore.ParameterSet.Config as cms
3 
4 # Barrel/endcap division in eta
5 ebCutOff = 1.479
6 
7 # ===============================================
8 # Define containers used by cut definitions
9 # ===============================================
10 
11 
13  """
14  This is a container class to hold numerical cut values for either
15  the barrel or endcap set of cuts for electron cut-based ID
16  """
17  def __init__(self,
18  idName,
19  dEtaInCut,
20  dPhiInCut,
21  full5x5_sigmaIEtaIEtaCut,
22  hOverECut,
23  dxyCut,
24  dzCut,
25  absEInverseMinusPInverseCut,
26  relCombIsolationWithEALowPtCut,
27  relCombIsolationWithEAHighPtCut,
28  # conversion veto cut needs no parameters, so not mentioned
29  missingHitsCut
30  ):
31  self.idName = idName
32  self.dEtaInCut = dEtaInCut
33  self.dPhiInCut = dPhiInCut
34  self.full5x5_sigmaIEtaIEtaCut = full5x5_sigmaIEtaIEtaCut
35  self.hOverECut = hOverECut
36  self.dxyCut = dxyCut
37  self.dzCut = dzCut
38  self.absEInverseMinusPInverseCut = absEInverseMinusPInverseCut
39  self.relCombIsolationWithEALowPtCut = relCombIsolationWithEALowPtCut
40  self.relCombIsolationWithEAHighPtCut = relCombIsolationWithEAHighPtCut
41  # conversion veto cut needs no parameters, so not mentioned
42  self.missingHitsCut = missingHitsCut
43 
45  """
46  This is a container class to hold numerical cut values for either
47  the barrel or endcap set of cuts for electron cut-based ID
48  With resepect to V2, the impact parameter cuts on dxy and dz are removed.
49  """
50  def __init__(self,
51  idName,
52  dEtaInSeedCut,
53  dPhiInCut,
54  full5x5_sigmaIEtaIEtaCut,
55  hOverECut,
56  absEInverseMinusPInverseCut,
57  relCombIsolationWithEALowPtCut,
58  relCombIsolationWithEAHighPtCut,
59  # conversion veto cut needs no parameters, so not mentioned
60  missingHitsCut
61  ):
62  self.idName = idName
63  self.dEtaInSeedCut = dEtaInSeedCut
64  self.dPhiInCut = dPhiInCut
65  self.full5x5_sigmaIEtaIEtaCut = full5x5_sigmaIEtaIEtaCut
66  self.hOverECut = hOverECut
67  self.absEInverseMinusPInverseCut = absEInverseMinusPInverseCut
68  self.relCombIsolationWithEALowPtCut = relCombIsolationWithEALowPtCut
69  self.relCombIsolationWithEAHighPtCut = relCombIsolationWithEAHighPtCut
70  # conversion veto cut needs no parameters, so not mentioned
71  self.missingHitsCut = missingHitsCut
72 
74  """
75  This is a container class to hold numerical cut values for either
76  the barrel or endcap set of cuts for electron cut-based ID
77  With respect to V3, the hOverE cut is made energy and pileup dependent as presented in
78  https://indico.cern.ch/event/662749/contributions/2763092/attachments/1545209/2425054/talk_electron_ID_2017.pdf
79  """
80  def __init__(self,
81  idName,
82  dEtaInSeedCut,
83  dPhiInCut,
84  full5x5_sigmaIEtaIEtaCut,
85  hOverECut_C0,
86  hOverECut_CE,
87  hOverECut_Cr,
88  absEInverseMinusPInverseCut,
89  relCombIsolationWithEALowPtCut,
90  relCombIsolationWithEAHighPtCut,
91  # conversion veto cut needs no parameters, so not mentioned
92  missingHitsCut
93  ):
94  self.idName = idName
95  self.dEtaInSeedCut = dEtaInSeedCut
96  self.dPhiInCut = dPhiInCut
97  self.full5x5_sigmaIEtaIEtaCut = full5x5_sigmaIEtaIEtaCut
98  self.hOverECut_C0 = hOverECut_C0
99  self.hOverECut_CE = hOverECut_CE
100  self.hOverECut_Cr = hOverECut_Cr
101  self.absEInverseMinusPInverseCut = absEInverseMinusPInverseCut
102  self.relCombIsolationWithEALowPtCut = relCombIsolationWithEALowPtCut
103  self.relCombIsolationWithEAHighPtCut = relCombIsolationWithEAHighPtCut
104  # conversion veto cut needs no parameters, so not mentioned
105  self.missingHitsCut = missingHitsCut
106 
107 
109  """
110  This is a container class to hold numerical cut values for either
111  the barrel or endcap set of cuts for electron cut-based ID
112  With respect to V4, the isolation cut is made pt dependent as presented in the following meeting: https://indico.cern.ch/event/697079/
113  """
114  def __init__(self,
115  idName,
116  dEtaInSeedCut,
117  dPhiInCut,
118  full5x5_sigmaIEtaIEtaCut,
119  hOverECut_C0,
120  hOverECut_CE,
121  hOverECut_Cr,
122  absEInverseMinusPInverseCut,
123  relCombIsolationWithEACut_C0,
124  relCombIsolationWithEACut_Cpt,
125  # conversion veto cut needs no parameters, so not mentioned
126  missingHitsCut
127  ):
128  self.idName = idName
129  self.dEtaInSeedCut = dEtaInSeedCut
130  self.dPhiInCut = dPhiInCut
131  self.full5x5_sigmaIEtaIEtaCut = full5x5_sigmaIEtaIEtaCut
132  self.hOverECut_C0 = hOverECut_C0
133  self.hOverECut_CE = hOverECut_CE
134  self.hOverECut_Cr = hOverECut_Cr
135  self.absEInverseMinusPInverseCut = absEInverseMinusPInverseCut
136  self.relCombIsolationWithEACut_C0 = relCombIsolationWithEACut_C0
137  self.relCombIsolationWithEACut_Cpt = relCombIsolationWithEACut_Cpt
138  # conversion veto cut needs no parameters, so not mentioned
139  self.missingHitsCut = missingHitsCut
140 
141 
142 
143 
145  """
146  This is a container class to hold numerical cut values for either
147  the barrel or endcap set of cuts for electron cut-based HLT-safe preselection
148  """
149  def __init__(self,
150  idName,
151  full5x5_sigmaIEtaIEtaCut,
152  dEtaInSeedCut,
153  dPhiInCut,
154  hOverECut,
155  absEInverseMinusPInverseCut,
156  # isolations
157  ecalPFClusterIsoLowPtCut,
158  ecalPFClusterIsoHighPtCut,
159  hcalPFClusterIsoLowPtCut,
160  hcalPFClusterIsoHighPtCut,
161  trkIsoSlopeTerm,
162  trkIsoSlopeStart,
163  trkIsoConstTerm,
164  #
165  normalizedGsfChi2Cut
166  ):
167  self.idName = idName
168  self.full5x5_sigmaIEtaIEtaCut = full5x5_sigmaIEtaIEtaCut
169  self.dEtaInSeedCut = dEtaInSeedCut
170  self.dPhiInCut = dPhiInCut
171  self.hOverECut = hOverECut
172  self.absEInverseMinusPInverseCut = absEInverseMinusPInverseCut
173  self.ecalPFClusterIsoLowPtCut = ecalPFClusterIsoLowPtCut
174  self.ecalPFClusterIsoHighPtCut = ecalPFClusterIsoHighPtCut
175  self.hcalPFClusterIsoLowPtCut = hcalPFClusterIsoLowPtCut
176  self.hcalPFClusterIsoHighPtCut = hcalPFClusterIsoHighPtCut
177  self.trkIsoSlopeTerm = trkIsoSlopeTerm
178  self.trkIsoSlopeStart = trkIsoSlopeStart
179  self.trkIsoConstTerm = trkIsoConstTerm
180  #
181  self.normalizedGsfChi2Cut = normalizedGsfChi2Cut
182 
183 
184 # ==============================================================
185 # Define individual cut configurations used by complete cut sets
186 # ==============================================================
187 
188 
189 # The mininum pt cut is set to 5 GeV
191  return cms.PSet(
192  cutName = cms.string("MinPtCut"),
193  minPt = cms.double(5.0),
194  needsAdditionalProducts = cms.bool(False),
195  isIgnored = cms.bool(False)
196  )
197 
198 # Take all particles in the eta ranges 0-ebCutOff and ebCutOff-2.5
200  return cms.PSet(
201  cutName = cms.string("GsfEleSCEtaMultiRangeCut"),
202  useAbsEta = cms.bool(True),
203  allowedEtaRanges = cms.VPSet(
204  cms.PSet( minEta = cms.double(0.0),
205  maxEta = cms.double(ebCutOff) ),
206  cms.PSet( minEta = cms.double(ebCutOff),
207  maxEta = cms.double(2.5) )
208  ),
209  needsAdditionalProducts = cms.bool(False),
210  isIgnored = cms.bool(False)
211  )
212 
213 # Configure the cut on full5x5 sigmaIEtaIEta
215  return cms.PSet(
216  cutName = cms.string('GsfEleEBEECut'),
217  cutString = cms.string("full5x5_sigmaIetaIeta"),
218  cutValueEB = cms.double( wpEB.full5x5_sigmaIEtaIEtaCut ),
219  cutValueEE = cms.double( wpEE.full5x5_sigmaIEtaIEtaCut ),
220  needsAdditionalProducts = cms.bool(False),
221  isIgnored = cms.bool(False)
222  )
223 
224 # Configure the cut on dEta seed
225 def psetDEtaInSeedCut(wpEB, wpEE):
226  valid_cut_condition = "? superCluster.isNonnull && superCluster.seed.isNonnull ?"
227  actual_cut_string = "abs(deltaEtaSuperClusterTrackAtVtx - superCluster.eta + superCluster.seed.eta)"
228  return cms.PSet(
229  cutName = cms.string('GsfEleEBEECut'),
230  cutString = cms.string(valid_cut_condition + actual_cut_string + " : 999999."),
231  cutValueEB = cms.double( wpEB.dEtaInSeedCut ),
232  cutValueEE = cms.double( wpEE.dEtaInSeedCut ),
233  needsAdditionalProducts = cms.bool(False),
234  isIgnored = cms.bool(False)
235  )
236 
237 # Configure dEtaIn cut
238 def psetDEtaInCut(wpEB, wpEE):
239  return cms.PSet(
240  cutName = cms.string('GsfEleEBEECut'),
241  cutString = cms.string("abs(deltaEtaSuperClusterTrackAtVtx)"),
242  cutValueEB = cms.double( wpEB.dEtaInCut ),
243  cutValueEE = cms.double( wpEE.dEtaInCut ),
244  needsAdditionalProducts = cms.bool(False),
245  isIgnored = cms.bool(False)
246  )
247 
248 # Configure dPhiIn cut
249 def psetDPhiInCut(wpEB, wpEE):
250  return cms.PSet(
251  cutName = cms.string('GsfEleEBEECut'),
252  cutString = cms.string("abs(deltaPhiSuperClusterTrackAtVtx)"),
253  cutValueEB = cms.double( wpEB.dPhiInCut ),
254  cutValueEE = cms.double( wpEE.dPhiInCut ),
255  needsAdditionalProducts = cms.bool(False),
256  isIgnored = cms.bool(False)
257  )
258 
259 # Configure H/E cut
260 def psetHadronicOverEMCut(wpEB, wpEE):
261  return cms.PSet(
262  cutName = cms.string('GsfEleEBEECut'),
263  cutString = cms.string("hadronicOverEm"),
264  cutValueEB = cms.double( wpEB.hOverECut ),
265  cutValueEE = cms.double( wpEE.hOverECut ),
266  needsAdditionalProducts = cms.bool(False),
267  isIgnored = cms.bool(False)
268  )
269 
270 # Configure energy and pileup dependent H/E cut
272  return cms.PSet(
273  cutName = cms.string('GsfEleHadronicOverEMEnergyScaledCut'),
274  barrelC0 = cms.double( wpEB.hOverECut_C0 ),
275  barrelCE = cms.double( wpEB.hOverECut_CE ),
276  barrelCr = cms.double( wpEB.hOverECut_Cr ),
277  endcapC0 = cms.double( wpEE.hOverECut_C0 ),
278  endcapCE = cms.double( wpEE.hOverECut_CE ),
279  endcapCr = cms.double( wpEE.hOverECut_Cr ),
280  rho = cms.InputTag("fixedGridRhoFastjetAll"),
281  barrelCutOff = cms.double(ebCutOff),
282  needsAdditionalProducts = cms.bool(True),
283  isIgnored = cms.bool(False)
284  )
285 
286 
287 # Configure |1/E-1/p| cut
289  return cms.PSet(
290  cutName = cms.string('GsfEleEBEECut'),
291  cutString = cms.string("abs(1. - eSuperClusterOverP) / ecalEnergy"),
292  cutValueEB = cms.double( wpEB.absEInverseMinusPInverseCut ),
293  cutValueEE = cms.double( wpEE.absEInverseMinusPInverseCut ),
294  needsAdditionalProducts = cms.bool(False),
295  isIgnored = cms.bool(False)
296  )
297 
298 # Configure ECAL PF Cluster isolation cut. Note that this cut requires
299 # effective area constants file as input
300 def psetEcalPFClusterIsoCut(wpEB, wpEE, ecalIsoInputs):
301  return cms.PSet(
302  cutName = cms.string('GsfEleCalPFClusterIsoCut'),
303  isoType = cms.int32( 0 ), # ECAL = 0, HCAL = 1, see cut class header for IsoType enum
304  isoCutEBLowPt = cms.double( wpEB.ecalPFClusterIsoLowPtCut ),
305  isoCutEBHighPt = cms.double( wpEB.ecalPFClusterIsoHighPtCut ),
306  isoCutEELowPt = cms.double( wpEE.ecalPFClusterIsoLowPtCut ),
307  isoCutEEHighPt = cms.double( wpEE.ecalPFClusterIsoHighPtCut ),
308  isRelativeIso = cms.bool(True),
309  ptCutOff = cms.double(20.0), # high pT above this value, low pT below
310  barrelCutOff = cms.double(ebCutOff),
311  rho = cms.InputTag("fixedGridRhoFastjetCentralCalo"), # This rho is best for emulation
312  # while HLT uses ...AllCalo
313  effAreasConfigFile = cms.FileInPath( ecalIsoInputs ),
314  needsAdditionalProducts = cms.bool(True),
315  isIgnored = cms.bool(False)
316  )
317 
318 # Configure HCAL PF Cluster isolation cut. Note that this cut requires
319 # effective area constants file as input
320 def psetHcalPFClusterIsoCut(wpEB, wpEE, hcalIsoInputs):
321  return cms.PSet(
322  cutName = cms.string('GsfEleCalPFClusterIsoCut'),
323  isoType = cms.int32( 1 ), # ECAL = 0, HCAL = 1, see cut class header for IsoType enum
324  isoCutEBLowPt = cms.double( wpEB.hcalPFClusterIsoLowPtCut ),
325  isoCutEBHighPt = cms.double( wpEB.hcalPFClusterIsoHighPtCut ),
326  isoCutEELowPt = cms.double( wpEE.hcalPFClusterIsoLowPtCut ),
327  isoCutEEHighPt = cms.double( wpEE.hcalPFClusterIsoHighPtCut ),
328  isRelativeIso = cms.bool(True),
329  ptCutOff = cms.double(20.0), # high pT above this value, low pT below
330  barrelCutOff = cms.double(ebCutOff),
331  rho = cms.InputTag("fixedGridRhoFastjetCentralCalo"), # This rho is best for emulation
332  # while HLT uses ...AllCalo
333  effAreasConfigFile = cms.FileInPath( hcalIsoInputs ),
334  needsAdditionalProducts = cms.bool(True),
335  isIgnored = cms.bool(False)
336  )
337 
338 # Configure tracker isolation cut
339 def psetTrkPtIsoCut(wpEB, wpEE):
340  return cms.PSet(
341  cutName = cms.string('GsfEleTrkPtIsoCut'),
342  # Three constants for the GsfEleTrkPtIsoCut
343  # cut = constTerm if Et < slopeStart
344  # cut = slopeTerm * (Et - slopeStart) + constTerm if Et >= slopeStart
345  slopeTermEB = cms.double( wpEB.trkIsoSlopeTerm ),
346  slopeTermEE = cms.double( wpEE.trkIsoSlopeTerm ),
347  slopeStartEB = cms.double( wpEB.trkIsoSlopeStart ),
348  slopeStartEE = cms.double( wpEE.trkIsoSlopeStart ),
349  constTermEB = cms.double( wpEB.trkIsoConstTerm ),
350  constTermEE = cms.double( wpEE.trkIsoConstTerm ),
351  useHEEPIso = cms.bool(False),
352  needsAdditionalProducts = cms.bool(False),
353  isIgnored = cms.bool(False)
354  )
355 
356 # Configure GsfTrack chi2/NDOF cut
357 def psetNormalizedGsfChi2Cut(wpEB, wpEE):
358  return cms.PSet(
359  cutName = cms.string('GsfEleEBEECut'),
360  cutString = cms.string("? gsfTrack.isNonnull ? gsfTrack.normalizedChi2 : 999990."),
361  cutValueEB = cms.double( wpEB.normalizedGsfChi2Cut ),
362  cutValueEE = cms.double( wpEE.normalizedGsfChi2Cut ),
363  needsAdditionalProducts = cms.bool(False),
364  isIgnored = cms.bool(False)
365  )
366 
367 def psetEffAreaPFIsoCut(wpEB, wpEE, isoInputs):
368  return cms.PSet(
369  cutName = cms.string('GsfEleEffAreaPFIsoCut'),
370  isoCutEBLowPt = cms.double( wpEB.relCombIsolationWithEALowPtCut ),
371  isoCutEBHighPt = cms.double( wpEB.relCombIsolationWithEAHighPtCut ),
372  isoCutEELowPt = cms.double( wpEE.relCombIsolationWithEALowPtCut ),
373  isoCutEEHighPt = cms.double( wpEE.relCombIsolationWithEAHighPtCut ),
374  isRelativeIso = cms.bool(True),
375  ptCutOff = cms.double(20.0), # high pT above this value, low pT below
376  barrelCutOff = cms.double(ebCutOff),
377  rho = cms.InputTag("fixedGridRhoFastjetAll"),
378  effAreasConfigFile = cms.FileInPath( isoInputs ),
379  needsAdditionalProducts = cms.bool(True),
380  isIgnored = cms.bool(False)
381  )
382 
383 def psetRelPFIsoScaledCut(wpEB, wpEE, isoInputs):
384  return cms.PSet(
385  cutName = cms.string('GsfEleRelPFIsoScaledCut'),
386  barrelC0 = cms.double(wpEB.relCombIsolationWithEACut_C0),
387  endcapC0 = cms.double(wpEE.relCombIsolationWithEACut_C0),
388  barrelCpt = cms.double(wpEB.relCombIsolationWithEACut_Cpt),
389  endcapCpt = cms.double(wpEE.relCombIsolationWithEACut_Cpt),
390  barrelCutOff = cms.double(ebCutOff),
391  rho = cms.InputTag("fixedGridRhoFastjetAll"),
392  effAreasConfigFile = cms.FileInPath( isoInputs ),
393  needsAdditionalProducts = cms.bool(True),
394  isIgnored = cms.bool(False)
395  )
396 
397 
399  return cms.PSet(
400  cutName = cms.string('GsfEleConversionVetoCut'),
401  conversionSrc = cms.InputTag('allConversions'),
402  conversionSrcMiniAOD = cms.InputTag('reducedEgamma:reducedConversions'),
403  beamspotSrc = cms.InputTag('offlineBeamSpot'),
404  needsAdditionalProducts = cms.bool(True),
405  isIgnored = cms.bool(False)
406  )
407 
408 def psetMissingHitsCut(wpEB, wpEE):
409  return cms.PSet(
410  cutName = cms.string('GsfEleMissingHitsCut'),
411  maxMissingHitsEB = cms.uint32( wpEB.missingHitsCut ),
412  maxMissingHitsEE = cms.uint32( wpEE.missingHitsCut ),
413  barrelCutOff = cms.double(ebCutOff),
414  needsAdditionalProducts = cms.bool(False),
415  isIgnored = cms.bool(False)
416  )
417 
418 def psetGsfEleDxyCut(wpEB, wpEE):
419  return cms.PSet( cutName = cms.string('GsfEleDxyCut'),
420  dxyCutValueEB = cms.double( wpEB.dxyCut ),
421  dxyCutValueEE = cms.double( wpEE.dxyCut ),
422  vertexSrc = cms.InputTag("offlinePrimaryVertices"),
423  vertexSrcMiniAOD = cms.InputTag("offlineSlimmedPrimaryVertices"),
424  barrelCutOff = cms.double(ebCutOff),
425  needsAdditionalProducts = cms.bool(True),
426  isIgnored = cms.bool(False))
427 
428 def psetGsfEleDzCut(wpEB, wpEE):
429  return cms.PSet( cutName = cms.string('GsfEleDzCut'),
430  dzCutValueEB = cms.double( wpEB.dzCut ),
431  dzCutValueEE = cms.double( wpEE.dzCut ),
432  vertexSrc = cms.InputTag("offlinePrimaryVertices"),
433  vertexSrcMiniAOD = cms.InputTag("offlineSlimmedPrimaryVertices"),
434  barrelCutOff = cms.double(ebCutOff),
435  needsAdditionalProducts = cms.bool(True),
436  isIgnored = cms.bool(False))
437 
438 # -----------------------------
439 # Version V2 common definitions
440 # -----------------------------
441 
442 # This cut set definition is in the old style, with everything configured
443 # in one go. It is kept to minimize changes. New definitions should use
444 # PSets defined above instead.
445 def configureVIDCutBasedEleID_V2( wpEB, wpEE, isoInputs ):
446  """
447  This function configures the full cms.PSet for a VID ID and returns it.
448  The inputs: two objects of the type WorkingPoint_V2, one
449  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
450  The third argument is an object that contains information necessary
451  for isolation calculations.
452  """
453  # print "VID: Configuring cut set %s" % wpEB.idName
454  parameterSet = cms.PSet(
455  #
456  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
457  cutFlow = cms.VPSet(
458  psetMinPtCut(),
460  psetDEtaInCut(wpEB, wpEE),
461  psetDPhiInCut(wpEB, wpEE),
462  psetFull5x5SigmaIEtaIEtaCut(wpEB, wpEE),
463  psetHadronicOverEMCut(wpEB, wpEE),
464  psetGsfEleDxyCut(wpEB, wpEE),
465  psetGsfEleDzCut(wpEB, wpEE),
466  psetEInerseMinusPInverseCut(wpEB, wpEE),
467  psetEffAreaPFIsoCut(wpEB, wpEE, isoInputs),
469  psetMissingHitsCut(wpEB, wpEE)
470  )
471  )
472  #
473  return parameterSet
474 
475 
476 # ==============================================================
477 # Define the complete cut sets
478 # ==============================================================
479 
480 def configureVIDCutBasedEleID_V3( wpEB, wpEE, isoInputs ):
481  """
482  This function configures the full cms.PSet for a VID ID and returns it.
483  The inputs: two objects of the type WorkingPoint_V3, one
484  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
485  The third argument is an object that contains information necessary
486  for isolation calculations.
487  In this version, the impact parameter cuts dxy and dz are not present
488  """
489  # print "VID: Configuring cut set %s" % wpEB.idName
490  parameterSet = cms.PSet(
491  #
492  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
493  cutFlow = cms.VPSet(
494  psetMinPtCut(),
495  psetPhoSCEtaMultiRangeCut(), # eta cut
496  psetDEtaInSeedCut(wpEB, wpEE), # dEtaIn seed cut
497  psetDPhiInCut(wpEB, wpEE), # dPhiIn cut
498  psetFull5x5SigmaIEtaIEtaCut(wpEB, wpEE), # full 5x5 sigmaIEtaIEta cut
499  psetHadronicOverEMCut(wpEB, wpEE), # H/E cut
500  psetEInerseMinusPInverseCut(wpEB, wpEE), # |1/e-1/p| cut
501  psetEffAreaPFIsoCut(wpEB, wpEE, isoInputs), # rel. comb. PF isolation cut
503  psetMissingHitsCut(wpEB, wpEE)
504  )
505  )
506  #
507  return parameterSet
508 
509 def configureVIDCutBasedEleID_V4( wpEB, wpEE, isoInputs ):
510  """
511  This function configures the full cms.PSet for a VID ID and returns it.
512  The inputs: two objects of the type WorkingPoint_V3, one
513  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
514  The third argument is an object that contains information necessary
515  for isolation calculations.
516  In this version, the energy and pileup dependent hOverE is introduced
517  """
518  # print "VID: Configuring cut set %s" % wpEB.idName
519  parameterSet = cms.PSet(
520  #
521  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
522  cutFlow = cms.VPSet(
523  psetMinPtCut(),
524  psetPhoSCEtaMultiRangeCut(), # eta cut
525  psetDEtaInSeedCut(wpEB, wpEE), # dEtaIn seed cut
526  psetDPhiInCut(wpEB, wpEE), # dPhiIn cut
527  psetFull5x5SigmaIEtaIEtaCut(wpEB, wpEE), # full 5x5 sigmaIEtaIEta cut
528  psetHadronicOverEMEnergyScaledCut(wpEB, wpEE), # H/E cut
529  psetEInerseMinusPInverseCut(wpEB, wpEE), # |1/e-1/p| cut
530  psetEffAreaPFIsoCut(wpEB, wpEE, isoInputs), # rel. comb. PF isolation cut
532  psetMissingHitsCut(wpEB, wpEE)
533  )
534  )
535  #
536  return parameterSet
537 
538 def configureVIDCutBasedEleID_V5( wpEB, wpEE, isoInputs ):
539  """
540  This function configures the full cms.PSet for a VID ID and returns it.
541  The inputs: two objects of the type WorkingPoint_V3, one
542  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
543  The third argument is an object that contains information necessary
544  for isolation calculations.
545  In this version, the pt dependent isolation is introduced
546  """
547  # print "VID: Configuring cut set %s" % wpEB.idName
548  parameterSet = cms.PSet(
549  #
550  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
551  cutFlow = cms.VPSet(
552  psetMinPtCut(),
553  psetPhoSCEtaMultiRangeCut(), # eta cut
554  psetDEtaInSeedCut(wpEB, wpEE), # dEtaIn seed cut
555  psetDPhiInCut(wpEB, wpEE), # dPhiIn cut
556  psetFull5x5SigmaIEtaIEtaCut(wpEB, wpEE), # full 5x5 sigmaIEtaIEta cut
557  psetHadronicOverEMEnergyScaledCut(wpEB, wpEE), # H/E cut
558  psetEInerseMinusPInverseCut(wpEB, wpEE), # |1/e-1/p| cut
559  psetRelPFIsoScaledCut(wpEB, wpEE, isoInputs), # rel. comb. PF isolation cut
561  psetMissingHitsCut(wpEB, wpEE)
562  )
563  )
564  #
565  return parameterSet
566 
567 
568 # -----------------------------
569 # HLT-safe common definitions
570 # -----------------------------
571 
572 
573 def configureVIDCutBasedEleHLTPreselection_V1( wpEB, wpEE, ecalIsoInputs, hcalIsoInputs ):
574  """
575  This function configures the full cms.PSet for a VID ID and returns it.
576  The inputs: two objects of the type EleHLTSelection_V1, one
577  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
578  The third and fourth arguments are objects that contain information necessary
579  for isolation calculations for ECAL and HCAL.
580  """
581  # print "VID: Configuring cut set %s" % wpEB.idName
582  parameterSet = cms.PSet(
583  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
584  cutFlow = cms.VPSet(
585  psetMinPtCut(), # min pt cut
586  psetPhoSCEtaMultiRangeCut(), # eta cut
587  psetFull5x5SigmaIEtaIEtaCut(wpEB, wpEE), # full 5x5 sigmaIEtaIEta cut
588  psetDEtaInSeedCut(wpEB, wpEE), # dEtaIn seed cut
589  psetDPhiInCut(wpEB, wpEE), # dPhiIn cut
590  psetHadronicOverEMCut(wpEB, wpEE), # H/E cut
591  psetEInerseMinusPInverseCut(wpEB, wpEE), # |1/e-1/p| cut
592  psetEcalPFClusterIsoCut(wpEB, wpEE, ecalIsoInputs), # ECAL PF Cluster isolation
593  psetHcalPFClusterIsoCut(wpEB, wpEE, hcalIsoInputs), # HCAL PF Cluster isolation
594  psetTrkPtIsoCut(wpEB, wpEE), # tracker isolation cut
595  psetNormalizedGsfChi2Cut(wpEB, wpEE) # GsfTrack chi2/NDOF cut
596  )
597  )
598  #
599  return parameterSet
600 
cutBasedElectronID_tools.EleWorkingPoint_V2.hOverECut
hOverECut
Definition: cutBasedElectronID_tools.py:22
cutBasedElectronID_tools.EleWorkingPoint_V2
Definition: cutBasedElectronID_tools.py:12
cutBasedElectronID_tools.EleHLTSelection_V1.hOverECut
hOverECut
Definition: cutBasedElectronID_tools.py:154
cutBasedElectronID_tools.EleWorkingPoint_V5.full5x5_sigmaIEtaIEtaCut
full5x5_sigmaIEtaIEtaCut
Definition: cutBasedElectronID_tools.py:118
cutBasedElectronID_tools.EleHLTSelection_V1.full5x5_sigmaIEtaIEtaCut
full5x5_sigmaIEtaIEtaCut
Definition: cutBasedElectronID_tools.py:151
cutBasedElectronID_tools.EleWorkingPoint_V5.dPhiInCut
dPhiInCut
Definition: cutBasedElectronID_tools.py:117
cutBasedElectronID_tools.EleHLTSelection_V1.dEtaInSeedCut
dEtaInSeedCut
Definition: cutBasedElectronID_tools.py:152
cutBasedElectronID_tools.psetHcalPFClusterIsoCut
def psetHcalPFClusterIsoCut(wpEB, wpEE, hcalIsoInputs)
Definition: cutBasedElectronID_tools.py:320
cutBasedElectronID_tools.psetMinPtCut
def psetMinPtCut()
Definition: cutBasedElectronID_tools.py:190
cutBasedElectronID_tools.configureVIDCutBasedEleID_V2
def configureVIDCutBasedEleID_V2(wpEB, wpEE, isoInputs)
Definition: cutBasedElectronID_tools.py:445
cutBasedElectronID_tools.EleWorkingPoint_V4.dEtaInSeedCut
dEtaInSeedCut
Definition: cutBasedElectronID_tools.py:82
cutBasedElectronID_tools.psetRelPFIsoScaledCut
def psetRelPFIsoScaledCut(wpEB, wpEE, isoInputs)
Definition: cutBasedElectronID_tools.py:383
cutBasedElectronID_tools.EleWorkingPoint_V3.hOverECut
hOverECut
Definition: cutBasedElectronID_tools.py:55
cutBasedElectronID_tools.EleWorkingPoint_V5.hOverECut_CE
hOverECut_CE
Definition: cutBasedElectronID_tools.py:120
cutBasedElectronID_tools.EleHLTSelection_V1.normalizedGsfChi2Cut
normalizedGsfChi2Cut
Definition: cutBasedElectronID_tools.py:164
cutBasedElectronID_tools.psetConversionVetoCut
def psetConversionVetoCut()
Definition: cutBasedElectronID_tools.py:398
cutBasedElectronID_tools.EleHLTSelection_V1.__init__
def __init__(self, idName, full5x5_sigmaIEtaIEtaCut, dEtaInSeedCut, dPhiInCut, hOverECut, absEInverseMinusPInverseCut, ecalPFClusterIsoLowPtCut, ecalPFClusterIsoHighPtCut, hcalPFClusterIsoLowPtCut, hcalPFClusterIsoHighPtCut, trkIsoSlopeTerm, trkIsoSlopeStart, trkIsoConstTerm, normalizedGsfChi2Cut)
Definition: cutBasedElectronID_tools.py:149
cutBasedElectronID_tools.EleWorkingPoint_V5.missingHitsCut
missingHitsCut
Definition: cutBasedElectronID_tools.py:126
cutBasedElectronID_tools.EleWorkingPoint_V5.idName
idName
Definition: cutBasedElectronID_tools.py:115
cutBasedElectronID_tools.EleWorkingPoint_V2.dzCut
dzCut
Definition: cutBasedElectronID_tools.py:24
cutBasedElectronID_tools.EleWorkingPoint_V3.__init__
def __init__(self, idName, dEtaInSeedCut, dPhiInCut, full5x5_sigmaIEtaIEtaCut, hOverECut, absEInverseMinusPInverseCut, relCombIsolationWithEALowPtCut, relCombIsolationWithEAHighPtCut, missingHitsCut)
Definition: cutBasedElectronID_tools.py:50
cutBasedElectronID_tools.EleWorkingPoint_V5.hOverECut_Cr
hOverECut_Cr
Definition: cutBasedElectronID_tools.py:121
cutBasedElectronID_tools.EleWorkingPoint_V4.relCombIsolationWithEALowPtCut
relCombIsolationWithEALowPtCut
Definition: cutBasedElectronID_tools.py:89
cutBasedElectronID_tools.EleHLTSelection_V1.ecalPFClusterIsoLowPtCut
ecalPFClusterIsoLowPtCut
Definition: cutBasedElectronID_tools.py:156
cutBasedElectronID_tools.configureVIDCutBasedEleID_V4
def configureVIDCutBasedEleID_V4(wpEB, wpEE, isoInputs)
Definition: cutBasedElectronID_tools.py:509
cutBasedElectronID_tools.psetGsfEleDzCut
def psetGsfEleDzCut(wpEB, wpEE)
Definition: cutBasedElectronID_tools.py:428
cutBasedElectronID_tools.psetMissingHitsCut
def psetMissingHitsCut(wpEB, wpEE)
Definition: cutBasedElectronID_tools.py:408
cutBasedElectronID_tools.EleWorkingPoint_V5
Definition: cutBasedElectronID_tools.py:108
cutBasedElectronID_tools.psetNormalizedGsfChi2Cut
def psetNormalizedGsfChi2Cut(wpEB, wpEE)
Definition: cutBasedElectronID_tools.py:357
cutBasedElectronID_tools.psetDPhiInCut
def psetDPhiInCut(wpEB, wpEE)
Definition: cutBasedElectronID_tools.py:249
cutBasedElectronID_tools.EleWorkingPoint_V2.absEInverseMinusPInverseCut
absEInverseMinusPInverseCut
Definition: cutBasedElectronID_tools.py:25
cutBasedElectronID_tools.EleWorkingPoint_V4.__init__
def __init__(self, idName, dEtaInSeedCut, dPhiInCut, full5x5_sigmaIEtaIEtaCut, hOverECut_C0, hOverECut_CE, hOverECut_Cr, absEInverseMinusPInverseCut, relCombIsolationWithEALowPtCut, relCombIsolationWithEAHighPtCut, missingHitsCut)
Definition: cutBasedElectronID_tools.py:80
cutBasedElectronID_tools.EleWorkingPoint_V5.relCombIsolationWithEACut_Cpt
relCombIsolationWithEACut_Cpt
Definition: cutBasedElectronID_tools.py:124
cutBasedElectronID_tools.psetDEtaInCut
def psetDEtaInCut(wpEB, wpEE)
Definition: cutBasedElectronID_tools.py:238
cutBasedElectronID_tools.EleWorkingPoint_V3.full5x5_sigmaIEtaIEtaCut
full5x5_sigmaIEtaIEtaCut
Definition: cutBasedElectronID_tools.py:54
cutBasedElectronID_tools.EleWorkingPoint_V3.dPhiInCut
dPhiInCut
Definition: cutBasedElectronID_tools.py:53
cutBasedElectronID_tools.EleWorkingPoint_V3.relCombIsolationWithEAHighPtCut
relCombIsolationWithEAHighPtCut
Definition: cutBasedElectronID_tools.py:58
cutBasedElectronID_tools.EleHLTSelection_V1.hcalPFClusterIsoLowPtCut
hcalPFClusterIsoLowPtCut
Definition: cutBasedElectronID_tools.py:158
cutBasedElectronID_tools.EleHLTSelection_V1
Definition: cutBasedElectronID_tools.py:144
cutBasedElectronID_tools.EleWorkingPoint_V2.relCombIsolationWithEALowPtCut
relCombIsolationWithEALowPtCut
Definition: cutBasedElectronID_tools.py:26
cutBasedElectronID_tools.EleHLTSelection_V1.hcalPFClusterIsoHighPtCut
hcalPFClusterIsoHighPtCut
Definition: cutBasedElectronID_tools.py:159
cutBasedElectronID_tools.EleWorkingPoint_V2.full5x5_sigmaIEtaIEtaCut
full5x5_sigmaIEtaIEtaCut
Definition: cutBasedElectronID_tools.py:21
cutBasedElectronID_tools.configureVIDCutBasedEleID_V3
def configureVIDCutBasedEleID_V3(wpEB, wpEE, isoInputs)
Definition: cutBasedElectronID_tools.py:480
cutBasedElectronID_tools.EleWorkingPoint_V4.hOverECut_C0
hOverECut_C0
Definition: cutBasedElectronID_tools.py:85
cutBasedElectronID_tools.EleWorkingPoint_V3.relCombIsolationWithEALowPtCut
relCombIsolationWithEALowPtCut
Definition: cutBasedElectronID_tools.py:57
cutBasedElectronID_tools.EleHLTSelection_V1.absEInverseMinusPInverseCut
absEInverseMinusPInverseCut
Definition: cutBasedElectronID_tools.py:155
cutBasedElectronID_tools.EleWorkingPoint_V3.dEtaInSeedCut
dEtaInSeedCut
Definition: cutBasedElectronID_tools.py:52
cutBasedElectronID_tools.psetFull5x5SigmaIEtaIEtaCut
def psetFull5x5SigmaIEtaIEtaCut(wpEB, wpEE)
Definition: cutBasedElectronID_tools.py:214
cutBasedElectronID_tools.psetPhoSCEtaMultiRangeCut
def psetPhoSCEtaMultiRangeCut()
Definition: cutBasedElectronID_tools.py:199
cutBasedElectronID_tools.EleHLTSelection_V1.trkIsoSlopeTerm
trkIsoSlopeTerm
Definition: cutBasedElectronID_tools.py:160
cutBasedElectronID_tools.EleWorkingPoint_V5.hOverECut_C0
hOverECut_C0
Definition: cutBasedElectronID_tools.py:119
cutBasedElectronID_tools.psetDEtaInSeedCut
def psetDEtaInSeedCut(wpEB, wpEE)
Definition: cutBasedElectronID_tools.py:225
cutBasedElectronID_tools.EleWorkingPoint_V4.absEInverseMinusPInverseCut
absEInverseMinusPInverseCut
Definition: cutBasedElectronID_tools.py:88
cutBasedElectronID_tools.EleWorkingPoint_V2.missingHitsCut
missingHitsCut
Definition: cutBasedElectronID_tools.py:29
cutBasedElectronID_tools.EleWorkingPoint_V4.hOverECut_Cr
hOverECut_Cr
Definition: cutBasedElectronID_tools.py:87
cutBasedElectronID_tools.EleWorkingPoint_V2.relCombIsolationWithEAHighPtCut
relCombIsolationWithEAHighPtCut
Definition: cutBasedElectronID_tools.py:27
cutBasedElectronID_tools.configureVIDCutBasedEleID_V5
def configureVIDCutBasedEleID_V5(wpEB, wpEE, isoInputs)
Definition: cutBasedElectronID_tools.py:538
cutBasedElectronID_tools.psetEInerseMinusPInverseCut
def psetEInerseMinusPInverseCut(wpEB, wpEE)
Definition: cutBasedElectronID_tools.py:288
cutBasedElectronID_tools.EleWorkingPoint_V2.dEtaInCut
dEtaInCut
Definition: cutBasedElectronID_tools.py:19
cutBasedElectronID_tools.EleWorkingPoint_V5.absEInverseMinusPInverseCut
absEInverseMinusPInverseCut
Definition: cutBasedElectronID_tools.py:122
cutBasedElectronID_tools.EleWorkingPoint_V4.missingHitsCut
missingHitsCut
Definition: cutBasedElectronID_tools.py:92
cutBasedElectronID_tools.psetHadronicOverEMCut
def psetHadronicOverEMCut(wpEB, wpEE)
Definition: cutBasedElectronID_tools.py:260
cutBasedElectronID_tools.configureVIDCutBasedEleHLTPreselection_V1
def configureVIDCutBasedEleHLTPreselection_V1(wpEB, wpEE, ecalIsoInputs, hcalIsoInputs)
Definition: cutBasedElectronID_tools.py:573
cutBasedElectronID_tools.EleWorkingPoint_V4
Definition: cutBasedElectronID_tools.py:73
cutBasedElectronID_tools.EleHLTSelection_V1.ecalPFClusterIsoHighPtCut
ecalPFClusterIsoHighPtCut
Definition: cutBasedElectronID_tools.py:157
cutBasedElectronID_tools.EleHLTSelection_V1.idName
idName
Definition: cutBasedElectronID_tools.py:150
cutBasedElectronID_tools.EleHLTSelection_V1.trkIsoSlopeStart
trkIsoSlopeStart
Definition: cutBasedElectronID_tools.py:161
cutBasedElectronID_tools.EleWorkingPoint_V2.dxyCut
dxyCut
Definition: cutBasedElectronID_tools.py:23
cutBasedElectronID_tools.EleWorkingPoint_V4.hOverECut_CE
hOverECut_CE
Definition: cutBasedElectronID_tools.py:86
cutBasedElectronID_tools.EleWorkingPoint_V4.relCombIsolationWithEAHighPtCut
relCombIsolationWithEAHighPtCut
Definition: cutBasedElectronID_tools.py:90
cutBasedElectronID_tools.EleWorkingPoint_V4.dPhiInCut
dPhiInCut
Definition: cutBasedElectronID_tools.py:83
cutBasedElectronID_tools.EleWorkingPoint_V5.__init__
def __init__(self, idName, dEtaInSeedCut, dPhiInCut, full5x5_sigmaIEtaIEtaCut, hOverECut_C0, hOverECut_CE, hOverECut_Cr, absEInverseMinusPInverseCut, relCombIsolationWithEACut_C0, relCombIsolationWithEACut_Cpt, missingHitsCut)
Definition: cutBasedElectronID_tools.py:114
cutBasedElectronID_tools.EleWorkingPoint_V5.dEtaInSeedCut
dEtaInSeedCut
Definition: cutBasedElectronID_tools.py:116
cutBasedElectronID_tools.psetGsfEleDxyCut
def psetGsfEleDxyCut(wpEB, wpEE)
Definition: cutBasedElectronID_tools.py:418
cutBasedElectronID_tools.EleHLTSelection_V1.trkIsoConstTerm
trkIsoConstTerm
Definition: cutBasedElectronID_tools.py:162
cutBasedElectronID_tools.psetTrkPtIsoCut
def psetTrkPtIsoCut(wpEB, wpEE)
Definition: cutBasedElectronID_tools.py:339
cutBasedElectronID_tools.EleWorkingPoint_V4.full5x5_sigmaIEtaIEtaCut
full5x5_sigmaIEtaIEtaCut
Definition: cutBasedElectronID_tools.py:84
cutBasedElectronID_tools.EleWorkingPoint_V5.relCombIsolationWithEACut_C0
relCombIsolationWithEACut_C0
Definition: cutBasedElectronID_tools.py:123
cutBasedElectronID_tools.EleWorkingPoint_V3.absEInverseMinusPInverseCut
absEInverseMinusPInverseCut
Definition: cutBasedElectronID_tools.py:56
cutBasedElectronID_tools.psetEcalPFClusterIsoCut
def psetEcalPFClusterIsoCut(wpEB, wpEE, ecalIsoInputs)
Definition: cutBasedElectronID_tools.py:300
cutBasedElectronID_tools.EleWorkingPoint_V3.idName
idName
Definition: cutBasedElectronID_tools.py:51
cutBasedElectronID_tools.EleWorkingPoint_V4.idName
idName
Definition: cutBasedElectronID_tools.py:81
cutBasedElectronID_tools.EleHLTSelection_V1.dPhiInCut
dPhiInCut
Definition: cutBasedElectronID_tools.py:153
cutBasedElectronID_tools.EleWorkingPoint_V3.missingHitsCut
missingHitsCut
Definition: cutBasedElectronID_tools.py:60
cutBasedElectronID_tools.EleWorkingPoint_V2.idName
idName
Definition: cutBasedElectronID_tools.py:18
cutBasedElectronID_tools.EleWorkingPoint_V3
Definition: cutBasedElectronID_tools.py:44
cutBasedElectronID_tools.psetEffAreaPFIsoCut
def psetEffAreaPFIsoCut(wpEB, wpEE, isoInputs)
Definition: cutBasedElectronID_tools.py:367
cutBasedElectronID_tools.psetHadronicOverEMEnergyScaledCut
def psetHadronicOverEMEnergyScaledCut(wpEB, wpEE)
Definition: cutBasedElectronID_tools.py:271
cutBasedElectronID_tools.EleWorkingPoint_V2.dPhiInCut
dPhiInCut
Definition: cutBasedElectronID_tools.py:20
cutBasedElectronID_tools.EleWorkingPoint_V2.__init__
def __init__(self, idName, dEtaInCut, dPhiInCut, full5x5_sigmaIEtaIEtaCut, hOverECut, dxyCut, dzCut, absEInverseMinusPInverseCut, relCombIsolationWithEALowPtCut, relCombIsolationWithEAHighPtCut, missingHitsCut)
Definition: cutBasedElectronID_tools.py:17