CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 5 GeV
140  return cms.PSet(
141  cutName = cms.string("MinPtCut"),
142  minPt = cms.double(35.0),
143  needsAdditionalProducts = cms.bool(False),
144  isIgnored = cms.bool(False)
145  )
146 
147 # Take all particles in the eta ranges 0-ebMax and eeMin-2.5
149  return cms.PSet(
150  cutName = cms.string("GsfEleSCEtaMultiRangeCut"),
151  useAbsEta = cms.bool(True),
152  allowedEtaRanges = cms.VPSet(
153  cms.PSet( minEta = cms.double(0.0),
154  maxEta = cms.double(ebMax) ),
155  cms.PSet( minEta = cms.double(eeMin),
156  maxEta = cms.double(2.5) )
157  ),
158  needsAdditionalProducts = cms.bool(False),
159  isIgnored = cms.bool(False)
160  )
161 
162 # Configure the cut on the dEtaIn for the seed
163 def psetGsfEleDEtaInSeedCut(wpEB, wpEE):
164  return cms.PSet(
165  cutName = cms.string('GsfEleDEtaInSeedCut'),
166  dEtaInSeedCutValueEB = cms.double( wpEB.dEtaInSeedCut ),
167  dEtaInSeedCutValueEE = cms.double( wpEE.dEtaInSeedCut ),
168  barrelCutOff = cms.double(ebCutOff),
169  needsAdditionalProducts = cms.bool(False),
170  isIgnored = cms.bool(False)
171  )
172 
173 # Configure the cut on the dPhiIn
174 def psetGsfEleDPhiInCut(wpEB, wpEE):
175  return cms.PSet(
176  cutName = cms.string('GsfEleDPhiInCut'),
177  dPhiInCutValueEB = cms.double( wpEB.dPhiInCut ),
178  dPhiInCutValueEE = cms.double( wpEE.dPhiInCut ),
179  barrelCutOff = cms.double(ebCutOff),
180  needsAdditionalProducts = cms.bool(False),
181  isIgnored = cms.bool(False)
182  )
183 
184 # Confugure the full 5x5 sigmaIEtaIEta cut
186  return cms.PSet(
187  cutName = cms.string('GsfEleFull5x5SigmaIEtaIEtaCut'),
188  full5x5SigmaIEtaIEtaCutValueEB = cms.double( wpEB.full5x5SigmaIEtaIEtaCut ),
189  full5x5SigmaIEtaIEtaCutValueEE = cms.double( wpEE.full5x5SigmaIEtaIEtaCut ),
190  barrelCutOff = cms.double(ebCutOff),
191  needsAdditionalProducts = cms.bool(False),
192  isIgnored = cms.bool(False)
193  )
194 
196  return cms.PSet(
197  cutName = cms.string('GsfEleFull5x5SigmaIEtaIEtaWithSatCut'),
198  maxSigmaIEtaIEtaEB = cms.double( wpEB.full5x5SigmaIEtaIEtaCut ),
199  maxSigmaIEtaIEtaEE = cms.double( wpEE.full5x5SigmaIEtaIEtaCut ),
200  maxNrSatCrysIn5x5EB =cms.int32( 0 ),
201  maxNrSatCrysIn5x5EE =cms.int32( 0 ),
202  nrSatCrysValueMap = cms.InputTag("heepIDVarValueMaps","eleNrSaturateIn5x5"),
203  needsAdditionalProducts = cms.bool(True),
204 
205  isIgnored = cms.bool(False)
206  )
207 # Configure XxX shower shape cuts
209  return cms.PSet(
210  cutName = cms.string('GsfEleFull5x5E2x5OverE5x5Cut'),
211  # E1x5 / E5x5
212  minE1x5OverE5x5EB = cms.double( wpEB.minE1x5OverE5x5Cut ),
213  minE1x5OverE5x5EE = cms.double( wpEE.minE1x5OverE5x5Cut ),
214  # E2x5 / E5x5
215  minE2x5OverE5x5EB = cms.double( wpEB.minE2x5OverE5x5Cut ),
216  minE2x5OverE5x5EE = cms.double( wpEE.minE2x5OverE5x5Cut ),
217  needsAdditionalProducts = cms.bool(False),
218  isIgnored = cms.bool(False)
219  )
220 # Configure XxX shower shape cuts
222  return cms.PSet(
223  cutName = cms.string('GsfEleFull5x5E2x5OverE5x5WithSatCut'),
224  # E1x5 / E5x5
225  minE1x5OverE5x5EB = cms.double( wpEB.minE1x5OverE5x5Cut ),
226  minE1x5OverE5x5EE = cms.double( wpEE.minE1x5OverE5x5Cut ),
227  # E2x5 / E5x5
228  minE2x5OverE5x5EB = cms.double( wpEB.minE2x5OverE5x5Cut ),
229  minE2x5OverE5x5EE = cms.double( wpEE.minE2x5OverE5x5Cut ),
230  maxNrSatCrysIn5x5EB =cms.int32( 0 ),
231  maxNrSatCrysIn5x5EE =cms.int32( 0 ),
232  nrSatCrysValueMap = cms.InputTag("heepIDVarValueMaps","eleNrSaturateIn5x5"),
233  needsAdditionalProducts = cms.bool(True),
234  isIgnored = cms.bool(False)
235  )
236 # Configure the cut of E/H
238  return cms.PSet(
239  cutName = cms.string('GsfEleHadronicOverEMLinearCut'),
240  # Three constants for the GsfEleHadronicOverEMLinearCut
241  # cut = constTerm if value < slopeStart
242  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
243  slopeTermEB = cms.double( wpEB.hOverESlopeTerm ),
244  slopeTermEE = cms.double( wpEE.hOverESlopeTerm ),
245  slopeStartEB = cms.double( wpEB.hOverESlopeStart ),
246  slopeStartEE = cms.double( wpEE.hOverESlopeStart ),
247  constTermEB = cms.double( wpEB.hOverEConstTerm ),
248  constTermEE = cms.double( wpEE.hOverEConstTerm ),
249  needsAdditionalProducts = cms.bool(False),
250  isIgnored = cms.bool(False)
251  )
252 
253 # Configure the cut on the tracker isolation
254 def psetGsfEleTrkPtIsoCut(wpEB, wpEE):
255  return cms.PSet(
256  cutName = cms.string('GsfEleTrkPtIsoCut'),
257  # Three constants for the GsfEleTrkPtIsoCut
258  # cut = constTerm if value < slopeStart
259  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
260  slopeTermEB = cms.double( wpEB.trkIsoSlopeTerm ),
261  slopeTermEE = cms.double( wpEE.trkIsoSlopeTerm ),
262  slopeStartEB = cms.double( wpEB.trkIsoSlopeStart ),
263  slopeStartEE = cms.double( wpEE.trkIsoSlopeStart ),
264  constTermEB = cms.double( wpEB.trkIsoConstTerm ),
265  constTermEE = cms.double( wpEE.trkIsoConstTerm ),
266  needsAdditionalProducts = cms.bool(False),
267  isIgnored = cms.bool(False)
268  )
269 # Configure the cut on the tracker isolation with a rho correction (hack for 76X)
270 def psetGsfEleTrkPtIsoRhoCut(wpEB, wpEE):
271  return cms.PSet(
272  cutName = cms.string('GsfEleTrkPtIsoRhoCut'),
273  # Three constants for the GsfEleTrkPtIsoCut
274  # cut = constTerm if value < slopeStart
275  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
276  slopeTermEB = cms.double( wpEB.trkIsoSlopeTerm ),
277  slopeTermEE = cms.double( wpEE.trkIsoSlopeTerm ),
278  slopeStartEB = cms.double( wpEB.trkIsoSlopeStart ),
279  slopeStartEE = cms.double( wpEE.trkIsoSlopeStart ),
280  constTermEB = cms.double( wpEB.trkIsoConstTerm ),
281  constTermEE = cms.double( wpEE.trkIsoConstTerm ),
282  rhoEtStartEB = cms.double( wpEB.trkIsoRhoCorrStart),
283  rhoEtStartEE = cms.double( wpEE.trkIsoRhoCorrStart),
284  rhoEAEB = cms.double( wpEB.trkIsoEffArea),
285  rhoEAEE = cms.double( wpEE.trkIsoEffArea),
286  rho = cms.InputTag("fixedGridRhoFastjetAll"),
287  needsAdditionalProducts = cms.bool(True),
288  isIgnored = cms.bool(False)
289  )
291  return cms.PSet(
292  cutName = cms.string('GsfEleValueMapIsoRhoCut'),
293  # Three constants for the GsfEleTrkPtIsoCut
294  # cut = constTerm if value < slopeStart
295  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
296  slopeTermEB = cms.double( wpEB.trkIsoSlopeTerm ),
297  slopeTermEE = cms.double( wpEE.trkIsoSlopeTerm ),
298  slopeStartEB = cms.double( wpEB.trkIsoSlopeStart ),
299  slopeStartEE = cms.double( wpEE.trkIsoSlopeStart ),
300  constTermEB = cms.double( wpEB.trkIsoConstTerm ),
301  constTermEE = cms.double( wpEE.trkIsoConstTerm ),
302  #no rho so we zero it out, if the input tag is empty, its ignored anyways
303  rhoEtStartEB = cms.double( 999999.),
304  rhoEtStartEE = cms.double( 999999.),
305  rhoEAEB = cms.double( 0. ),
306  rhoEAEE = cms.double( 0. ),
307  rho = cms.InputTag(""),
308  value = cms.InputTag("heepIDVarValueMaps","eleTrkPtIsoNoJetCore"),
309  needsAdditionalProducts = cms.bool(True),
310  isIgnored = cms.bool(False)
311  )
313  return cms.PSet(
314  cutName = cms.string('GsfEleValueMapIsoRhoCut'),
315  # Three constants for the GsfEleTrkPtIsoCut
316  # cut = constTerm if value < slopeStart
317  # cut = slopeTerm * (value - slopeStart) + constTerm if value >= slopeStart
318  slopeTermEB = cms.double( wpEB.trkIsoSlopeTerm ),
319  slopeTermEE = cms.double( wpEE.trkIsoSlopeTerm ),
320  slopeStartEB = cms.double( wpEB.trkIsoSlopeStart ),
321  slopeStartEE = cms.double( wpEE.trkIsoSlopeStart ),
322  constTermEB = cms.double( wpEB.trkIsoConstTerm ),
323  constTermEE = cms.double( wpEE.trkIsoConstTerm ),
324  #no rho so we zero it out, if the input tag is empty, its ignored anyways
325  rhoEtStartEB = cms.double( 999999.),
326  rhoEtStartEE = cms.double( 999999.),
327  rhoEAEB = cms.double( 0. ),
328  rhoEAEE = cms.double( 0. ),
329  rho = cms.InputTag(""),
330  value = cms.InputTag("heepIDVarValueMaps","eleTrkPtIso"),
331  needsAdditionalProducts = cms.bool(True),
332  isIgnored = cms.bool(False)
333  )
334 # Configure the cut on the EM + Had_depth_1 isolation with rho correction
336  return cms.PSet(
337  cutName = cms.string('GsfEleEmHadD1IsoRhoCut'),
338  slopeTermEB = cms.double( wpEB.ehIsoSlopeTerm ),
339  slopeTermEE = cms.double( wpEE.ehIsoSlopeTerm ),
340  slopeStartEB = cms.double( wpEB.ehIsoSlopeStart ),
341  slopeStartEE = cms.double( wpEE.ehIsoSlopeStart ),
342  constTermEB = cms.double( wpEB.ehIsoConstTerm ),
343  constTermEE = cms.double( wpEE.ehIsoConstTerm ),
344  rhoConstant = cms.double( wpEB.effAreaForEHIso), # expected to be the same for EB and EE
345  rho = cms.InputTag("fixedGridRhoFastjetAll"),
346  needsAdditionalProducts = cms.bool(True),
347  isIgnored = cms.bool(False)
348  )
349 
350 # Configure the dxy cut
351 def psetGsfEleDxyCut(wpEB, wpEE):
352  return cms.PSet(
353  cutName = cms.string('GsfEleDxyCut'),
354  dxyCutValueEB = cms.double( wpEB.dxyCut ),
355  dxyCutValueEE = cms.double( wpEE.dxyCut ),
356  vertexSrc = cms.InputTag("offlinePrimaryVertices"),
357  vertexSrcMiniAOD = cms.InputTag("offlineSlimmedPrimaryVertices"),
358  barrelCutOff = cms.double(ebCutOff),
359  needsAdditionalProducts = cms.bool(True),
360  isIgnored = cms.bool(False)
361  )
362 
363 # Configure the cut on missing hits
364 def psetGsfEleMissingHitsCut(wpEB, wpEE):
365  return cms.PSet(
366  cutName = cms.string('GsfEleMissingHitsCut'),
367  maxMissingHitsEB = cms.uint32( wpEB.maxMissingHitsCut ),
368  maxMissingHitsEE = cms.uint32( wpEE.maxMissingHitsCut ),
369  barrelCutOff = cms.double(ebCutOff),
370  needsAdditionalProducts = cms.bool(False),
371  isIgnored = cms.bool(False)
372  )
373 def psetGsfEleEcalDrivenCut(wpEB, wpEE):
374  return cms.PSet(
375  cutName = cms.string('GsfEleEcalDrivenCut'),
376  ecalDrivenEB = cms.int32( wpEB.ecalDrivenCut ),
377  ecalDrivenEE = cms.int32( wpEE.ecalDrivenCut ),
378  barrelCutOff = cms.double(ebCutOff),
379  needsAdditionalProducts = cms.bool(False),
380  isIgnored = cms.bool(False)
381  )
382 
383 # ==============================================================
384 # Define the complete cut sets
385 # ==============================================================
386 
388  """
389  This function configures the full cms.PSet for a VID ID and returns it.
390  The inputs: two objects of the type HEEP_WorkingPoint_V1, one
391  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
392  """
393  parameterSet = cms.PSet(
394  idName = cms.string("heepElectronID-HEEPV51"),
395  cutFlow = cms.VPSet(
396  psetMinPtCut(), #0
398  psetGsfEleDEtaInSeedCut(wpEB,wpEE), #2
399  psetGsfEleDPhiInCut(wpEB,wpEE), #3
400  psetGsfEleFull5x5SigmaIEtaIEtaCut(wpEB,wpEE), #4
401  psetGsfEleFull5x5E2x5OverE5x5Cut(wpEB,wpEE), #5
402  psetGsfEleHadronicOverEMLinearCut(wpEB,wpEE), #6
403  psetGsfEleTrkPtIsoCut(wpEB,wpEE), #7
404  psetGsfEleEmHadD1IsoRhoCut(wpEB,wpEE), #8
405  psetGsfEleDxyCut(wpEB,wpEE), #9
406  psetGsfEleMissingHitsCut(wpEB,wpEE), #10,
407  psetGsfEleEcalDrivenCut(wpEB,wpEE) #11
408  )
409  )
410  return parameterSet
411 
413  """
414  This function configures the full cms.PSet for a VID ID and returns it.
415  The inputs: two objects of the type HEEP_WorkingPoint_V1, one
416  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
417  """
418  parameterSet = cms.PSet(
419  idName = cms.string("heepElectronID-HEEPV60"),
420  cutFlow = cms.VPSet(
421  psetMinPtCut(), #0
423  psetGsfEleDEtaInSeedCut(wpEB,wpEE), #2
424  psetGsfEleDPhiInCut(wpEB,wpEE), #3
425  psetGsfEleFull5x5SigmaIEtaIEtaCut(wpEB,wpEE), #4
426  psetGsfEleFull5x5E2x5OverE5x5Cut(wpEB,wpEE), #5
427  psetGsfEleHadronicOverEMLinearCut(wpEB,wpEE), #6
428  psetGsfEleTrkPtIsoCut(wpEB,wpEE), #7
429  psetGsfEleEmHadD1IsoRhoCut(wpEB,wpEE), #8
430  psetGsfEleDxyCut(wpEB,wpEE), #9
431  psetGsfEleMissingHitsCut(wpEB,wpEE), #10,
432  psetGsfEleEcalDrivenCut(wpEB,wpEE) #11
433  )
434  )
435  return parameterSet
436 
437 
438 def configureHEEPElectronID_V70(idName, wpEB, wpEE):
439  """
440  This function configures the full cms.PSet for a VID ID and returns it.
441  The inputs: two objects of the type HEEP_WorkingPoint_V1, one
442  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
443  """
444  parameterSet = cms.PSet(
445  idName = cms.string(idName),
446  cutFlow = cms.VPSet(
447  psetMinPtCut(), #0
449  psetGsfEleDEtaInSeedCut(wpEB,wpEE), #2
450  psetGsfEleDPhiInCut(wpEB,wpEE), #3
453  psetGsfEleHadronicOverEMLinearCut(wpEB,wpEE), #6
454  psetGsfEleTrkPtFall16IsoCut(wpEB,wpEE), #7
455  psetGsfEleEmHadD1IsoRhoCut(wpEB,wpEE), #8
456  psetGsfEleDxyCut(wpEB,wpEE), #9
457  psetGsfEleMissingHitsCut(wpEB,wpEE), #10,
458  psetGsfEleEcalDrivenCut(wpEB,wpEE) #11
459  )
460  )
461  return parameterSet
462 
463 
464 def configureHEEPElectronID_V60_80XAOD(idName, wpEB, wpEE):
465  """
466  This function configures the full cms.PSet for a VID ID and returns it.
467  The inputs: two objects of the type HEEP_WorkingPoint_V1, one
468  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
469  """
470  parameterSet = cms.PSet(
471  idName = cms.string(idName),
472  cutFlow = cms.VPSet(
473  psetMinPtCut(), #0
475  psetGsfEleDEtaInSeedCut(wpEB,wpEE), #2
476  psetGsfEleDPhiInCut(wpEB,wpEE), #3
479  psetGsfEleHadronicOverEMLinearCut(wpEB,wpEE), #6
480  psetGsfEleTrkPtNoJetCoreIsoCut(wpEB,wpEE), #7
481  psetGsfEleEmHadD1IsoRhoCut(wpEB,wpEE), #8
482  psetGsfEleDxyCut(wpEB,wpEE), #9
483  psetGsfEleMissingHitsCut(wpEB,wpEE), #10,
484  psetGsfEleEcalDrivenCut(wpEB,wpEE) #11
485  )
486  )
487  return parameterSet
488 
490  """
491  This function configures the full cms.PSet for a VID ID and returns it.
492  The inputs: two objects of the type HEEP_WorkingPoint_V2, one
493  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
494  """
495  parameterSet = cms.PSet(
496  idName = cms.string("heepElectronID-HEEPV61"),
497  cutFlow = cms.VPSet(
498  psetMinPtCut(), #0
500  psetGsfEleDEtaInSeedCut(wpEB,wpEE), #2
501  psetGsfEleDPhiInCut(wpEB,wpEE), #3
502  psetGsfEleFull5x5SigmaIEtaIEtaCut(wpEB,wpEE), #4
503  psetGsfEleFull5x5E2x5OverE5x5Cut(wpEB,wpEE), #5
504  psetGsfEleHadronicOverEMLinearCut(wpEB,wpEE), #6
505  psetGsfEleTrkPtIsoRhoCut(wpEB,wpEE), #7
506  psetGsfEleEmHadD1IsoRhoCut(wpEB,wpEE), #8
507  psetGsfEleDxyCut(wpEB,wpEE), #9
508  psetGsfEleMissingHitsCut(wpEB,wpEE), #10,
509  psetGsfEleEcalDrivenCut(wpEB,wpEE) #11
510  )
511  )
512  return parameterSet
513 
514 def addHEEPProducersToSeq(process,seq,insertIndex,useMiniAOD):
515  process.load("RecoEgamma.ElectronIdentification.heepIdVarValueMapProducer_cfi")
516 
517  seq.insert(insertIndex,process.heepIDVarValueMaps)
518 
519  if useMiniAOD==False:
520  process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi")
521  process.load("PhysicsTools.PatAlgos.slimming.primaryVertexAssociation_cfi")
522  process.load("PhysicsTools.PatAlgos.slimming.offlineSlimmedPrimaryVertices_cfi")
523  process.load("PhysicsTools.PatAlgos.slimming.packedPFCandidates_cfi")
524  from PhysicsTools.PatAlgos.slimming.packedPFCandidates_cfi import packedPFCandidates
525  process.packedCandsForTkIso = packedPFCandidates.clone()
526  process.packedCandsForTkIso.PuppiSrc=cms.InputTag("")
527  process.packedCandsForTkIso.PuppiNoLepSrc=cms.InputTag("")
528 
529  process.load("PhysicsTools.PatAlgos.slimming.lostTracks_cfi")
530  from PhysicsTools.PatAlgos.slimming.lostTracks_cfi import lostTracks
531  process.lostTracksForTkIso = lostTracks.clone()
532  process.lostTracksForTkIso.packedPFCandidates =cms.InputTag("packedCandsForTkIso")
533  seq.insert(insertIndex,process.primaryVertexAssociation)
534  seq.insert(insertIndex+1,process.offlineSlimmedPrimaryVertices)
535  seq.insert(insertIndex+2,process.packedCandsForTkIso)
536  seq.insert(insertIndex+3,process.lostTracksForTkIso)