CMS 3D CMS Logo

cutBasedPhotonID_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 
12  """
13  This is a container class to hold numerical cut values for either
14  the barrel or endcap set of cuts
15  """
16  def __init__(self,
17  idName,
18  hOverECut,
19  full5x5_sigmaIEtaIEtaCut,
20  # Isolation cuts are generally pt-dependent: cut = C1 + pt * C2
21  absPFChaHadIsoWithEACut_C1,
22  absPFChaHadIsoWithEACut_C2,
23  absPFNeuHadIsoWithEACut_C1,
24  absPFNeuHadIsoWithEACut_C2,
25  absPFPhoIsoWithEACut_C1,
26  absPFPhoIsoWithEACut_C2
27  ):
28  self.idName = idName
29  self.hOverECut = hOverECut
30  self.full5x5_sigmaIEtaIEtaCut = full5x5_sigmaIEtaIEtaCut
31  self.absPFChaHadIsoWithEACut_C1 = absPFChaHadIsoWithEACut_C1 # charged hadron isolation C1
32  self.absPFChaHadIsoWithEACut_C2 = absPFChaHadIsoWithEACut_C2 # ........ C2
33  self.absPFNeuHadIsoWithEACut_C1 = absPFNeuHadIsoWithEACut_C1 # neutral hadron isolation C1
34  self.absPFNeuHadIsoWithEACut_C2 = absPFNeuHadIsoWithEACut_C2 # ........ C2
35  self.absPFPhoIsoWithEACut_C1 = absPFPhoIsoWithEACut_C1 # photon isolation C1
36  self.absPFPhoIsoWithEACut_C2 = absPFPhoIsoWithEACut_C2 # ........ C2
37 
39  """
40  This is a container class to hold numerical cut values for either
41  the barrel or endcap set of cuts
42  This version of the container is different from the previous one
43  by the fact that it contains three constants instead of two for
44  the neutral hadron isolation cut, for exponantial parameterization
45  """
46  def __init__(self,
47  idName,
48  hOverECut,
49  full5x5_sigmaIEtaIEtaCut,
50  # Isolation cuts are generally pt-dependent: cut = C1 + pt * C2
51  # except for the neutral hadron isolation where it is cut = C1+exp(pt*C2+C3)
52  absPFChaHadIsoWithEACut_C1,
53  absPFChaHadIsoWithEACut_C2,
54  absPFNeuHadIsoWithEACut_C1,
55  absPFNeuHadIsoWithEACut_C2,
56  absPFNeuHadIsoWithEACut_C3,
57  absPFPhoIsoWithEACut_C1,
58  absPFPhoIsoWithEACut_C2
59  ):
60  self.idName = idName
61  self.hOverECut = hOverECut
62  self.full5x5_sigmaIEtaIEtaCut = full5x5_sigmaIEtaIEtaCut
63  self.absPFChaHadIsoWithEACut_C1 = absPFChaHadIsoWithEACut_C1 # charged hadron isolation C1
64  self.absPFChaHadIsoWithEACut_C2 = absPFChaHadIsoWithEACut_C2 # ........ C2
65  self.absPFNeuHadIsoWithEACut_C1 = absPFNeuHadIsoWithEACut_C1 # neutral hadron isolation C1
66  self.absPFNeuHadIsoWithEACut_C2 = absPFNeuHadIsoWithEACut_C2 # ........ C2
67  self.absPFNeuHadIsoWithEACut_C3 = absPFNeuHadIsoWithEACut_C3 # ........ C3
68  self.absPFPhoIsoWithEACut_C1 = absPFPhoIsoWithEACut_C1 # photon isolation C1
69  self.absPFPhoIsoWithEACut_C2 = absPFPhoIsoWithEACut_C2 # ........ C2
70 
71 
73  """
74  This is a container class to hold the numerical cut values for either
75  the barrel or endcap set of cuts.
76  The changes made in this version:
77  1) The charged hadron isolation and neutral hadron isolation are replaced
78  by ECal cluster isolation and HCal cluster isolation.
79  2) The isolation variables have pt-dependance: ECal cluster isolation has
80  linear dependance and HCal cluster isolation has quadratic dependance
81  3) Cone-based H/E (instead of tower-based, as done for Run2) is used, and
82  PU-correction is done for it as well.
83  """
84  def __init__(self,
85  idName,
86  full5x5_sigmaIEtaIEtaCut,
87  hOverEwithEACut,
88  absPFChgHadIsoWithEACut_C1,
89  absPFChgHadIsoWithEACut_C2,
90  absPFECalClusIsoWithEACut_C1,
91  absPFECalClusIsoWithEACut_C2,
92  absPFHCalClusIsoWithEACut_C1,
93  absPFHCalClusIsoWithEACut_C2,
94  absPFHCalClusIsoWithEACut_C3
95  ):
96  self.idName = idName
97 
98  self.full5x5_sigmaIEtaIEtaCut = full5x5_sigmaIEtaIEtaCut # sigmaIetaIeta
99  self.hOverEwithEACut = hOverEwithEACut # H/E (cone-based)
100 
101  self.absPFChgHadIsoWithEACut_C1 = absPFChgHadIsoWithEACut_C1 # Charged hadron isolation (const. term)
102  self.absPFChgHadIsoWithEACut_C2 = absPFChgHadIsoWithEACut_C2 # Charged hadron isolation (linear term)
103  self.absPFECalClusIsoWithEACut_C1 = absPFECalClusIsoWithEACut_C1 # ECal Cluster isolation (const. term)
104  self.absPFECalClusIsoWithEACut_C2 = absPFECalClusIsoWithEACut_C1 # ECal Cluster isolation (linear term)
105  self.absPFHCalClusIsoWithEACut_C1 = absPFHCalClusIsoWithEACut_C1 # HCal Cluster isolation (const. term)
106  self.absPFHCalClusIsoWithEACut_C2 = absPFHCalClusIsoWithEACut_C2 # HCal Cluster isolation (linear term)
107  self.absPFHCalClusIsoWithEACut_C3 = absPFHCalClusIsoWithEACut_C3 # HCal Cluster isolation (quadratic term)
108 
109 
111  """
112  A container class that holds the names of the isolation maps in the event record
113  and the names of the files with the effective area constants for pile-up corrections
114  """
115  def __init__(self,
116  chHadIsolationMapName,
117  chHadIsolationEffAreas,
118  neuHadIsolationMapName,
119  neuHadIsolationEffAreas,
120  phoIsolationMapName,
121  phoIsolationEffAreas
122  ):
123  self.chHadIsolationMapName = chHadIsolationMapName
124  self.chHadIsolationEffAreas = chHadIsolationEffAreas
125  self.neuHadIsolationMapName = neuHadIsolationMapName
126  self.neuHadIsolationEffAreas = neuHadIsolationEffAreas
127  self.phoIsolationMapName = phoIsolationMapName
128  self.phoIsolationEffAreas = phoIsolationEffAreas
129 
131  """
132  A container class that holds the names of the cluster based isolation maps in the event record
133  and the names of the files with the effective area constants for pile-up corrections
134  """
135  def __init__(self,
136  trkIsolationMapName,
137  trkIsolationEffAreas,
138  ecalClusIsolationMapName,
139  ecalClusIsolationEffAreas,
140  hcalClusIsolationMapName,
141  hcalClusIsolationEffAreas
142  ):
143  self.trkIsolationMapName = trkIsolationMapName
144  self.trkIsolationEffAreas = trkIsolationEffAreas
145  self.ecalClusIsolationMapName = ecalClusIsolationMapName
146  self.ecalClusIsolationEffAreas = ecalClusIsolationEffAreas
147  self.hcalClusIsolationMapName = hcalClusIsolationMapName
148  self.hcalClusIsolationEffAreas = hcalClusIsolationEffAreas
149 
150 
152  """
153  A container class that holds the name of the file with the effective area constants
154  for pile-up corrections
155  """
156  def __init__(self,
157  hOverEEffAreas
158  ):
159  self.hOverEEffAreas = hOverEEffAreas
160 
161 
162 # ==============================================================
163 # Define individual cut configurations used by complete cut sets
164 # ==============================================================
165 
166 # The mininum pt cut is set to 5 GeV
168  return cms.PSet(
169  cutName = cms.string("MinPtCut"),
170  minPt = cms.double(5.0),
171  needsAdditionalProducts = cms.bool(False),
172  isIgnored = cms.bool(False)
173  )
174 
175 # Take all particles in the eta ranges 0-ebCutOff and ebCutOff-2.5
177  return cms.PSet(
178  cutName = cms.string("PhoSCEtaMultiRangeCut"),
179  useAbsEta = cms.bool(True),
180  allowedEtaRanges = cms.VPSet(
181  cms.PSet( minEta = cms.double(0.0),
182  maxEta = cms.double(ebCutOff) ),
183  cms.PSet( minEta = cms.double(ebCutOff),
184  maxEta = cms.double(2.5) )
185  ),
186  needsAdditionalProducts = cms.bool(False),
187  isIgnored = cms.bool(False)
188  )
189 
190 # Configure the cut on H/E
191 def psetPhoHcalOverEcalBcCut( wpEB, wpEE):
192  """
193  Arguments: two containers of working point cut values of the type WorkingPoint_*
194  """
195  return cms.PSet(
196  cutName = cms.string('PhotonHcalOverEcalBcCut'),
197  hcalOverEcalCutValueEB = cms.double( wpEB.hOverECut ),
198  hcalOverEcalCutValueEE = cms.double( wpEE.hOverECut ),
199  barrelCutOff = cms.double(ebCutOff),
200  needsAdditionalProducts = cms.bool(False),
201  isIgnored = cms.bool(False)
202  )
203 
204 # Configure the cut on full5x5 sigmaIEtaIEta that uses a ValueMap,
205 # relying on an upstream producer that creates it. This was necessary
206 # for photons up to 7.2.0.
208  """
209  Arguments: two containers of working point cut values of the type WorkingPoint_*
210  """
211  return cms.PSet(
212  cutName = cms.string('PhoFull5x5SigmaIEtaIEtaValueMapCut'),
213  cutValueEB = cms.double( wpEB.full5x5_sigmaIEtaIEtaCut ),
214  cutValueEE = cms.double( wpEE.full5x5_sigmaIEtaIEtaCut ),
215  full5x5SigmaIEtaIEtaMap = cms.InputTag('photonIDValueMapProducer:phoFull5x5SigmaIEtaIEta'),
216  barrelCutOff = cms.double(ebCutOff),
217  needsAdditionalProducts = cms.bool(True),
218  isIgnored = cms.bool(False)
219  )
220 
221 # Configure the cut on full5x5 sigmaIEtaIEta that uses the native Photon field
222 # with this variable (works for releases past 7.2.0).
224  """
225  Arguments: two containers of working point cut values of the type WorkingPoint_*
226  """
227  return cms.PSet(
228  cutName = cms.string('PhoFull5x5SigmaIEtaIEtaCut'),
229  cutValueEB = cms.double( wpEB.full5x5_sigmaIEtaIEtaCut ),
230  cutValueEE = cms.double( wpEE.full5x5_sigmaIEtaIEtaCut ),
231  barrelCutOff = cms.double(ebCutOff),
232  needsAdditionalProducts = cms.bool(False),
233  isIgnored = cms.bool(False)
234  )
235 
236 # Configure the cut on the charged hadron isolation that uses
237 # the linear pt scaling for barrel and endcap
238 def psetChHadIsoWithEALinScalingCut(wpEB, wpEE, isoInputs):
239  """
240  Arguments: two containers of working point cut values of the type WorkingPoint_*
241  The third argument contains data for isolation calculation.
242  The cut is (for lessThan==True), otherwise replace "<" with ">="
243  X < constTerm + linearPtTerm*pt + quadPtTerm* pt*pt + rho*EA
244  """
245  return cms.PSet(
246  cutName = cms.string('PhoGenericRhoPtScaledCut'),
247  cutVariable = cms.string("chargedHadronIso"),
248  lessThan = cms.bool(True),
249  # cut
250  constTermEB = cms.double( wpEB.absPFChaHadIsoWithEACut_C1 ),
251  constTermEE = cms.double( wpEE.absPFChaHadIsoWithEACut_C1 ),
252  linearPtTermEB = cms.double( wpEB.absPFChaHadIsoWithEACut_C2 ),
253  linearPtTermEE = cms.double( wpEE.absPFChaHadIsoWithEACut_C2 ),
254  quadPtTermEB = cms.double( 0. ),
255  quadPtTermEE = cms.double( 0. ),
256  needsAdditionalProducts = cms.bool(True),
257  isIgnored = cms.bool(False),
258  rho = cms.InputTag("fixedGridRhoFastjetAll"),
259  effAreasConfigFile = cms.FileInPath( isoInputs.chHadIsolationEffAreas )
260  )
261 
262 # Configure the cut on the neutral hadron isolation that uses
263 # the linear pt scaling for barrel and endcap
264 def psetNeuHadIsoWithEALinScalingCut( wpEB, wpEE, isoInputs):
265  """
266  Arguments: two containers of working point cut values of the type WorkingPoint_*
267  The third argument contains data for isolation calculation.
268  """
269  return cms.PSet(
270  cutName = cms.string('PhoGenericRhoPtScaledCut'),
271  cutVariable = cms.string("neutralHadronIso"),
272  lessThan = cms.bool(True),
273  # cut
274  constTermEB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C1 ),
275  constTermEE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C1 ),
276  linearPtTermEB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C2 ),
277  linearPtTermEE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C2 ),
278  quadPtTermEB = cms.double( 0. ),
279  quadPtTermEE = cms.double( 0. ),
280  needsAdditionalProducts = cms.bool(True),
281  isIgnored = cms.bool(False),
282  rho = cms.InputTag("fixedGridRhoFastjetAll"),
283  effAreasConfigFile = cms.FileInPath( isoInputs.neuHadIsolationEffAreas )
284  )
285 
286 # Configure the cut on the neutral hadron isolation that uses
287 # the exponential pt scaling for barrel and the linear pt scaling for endcap
288 def psetNeuHadIsoWithEAExpoScalingEBCut(wpEB, wpEE, isoInputs):
289  """
290  Arguments: two containers of working point cut values of the type WorkingPoint_*
291  The third argument contains data for isolation calculation.
292  """
293  return cms.PSet(
294  cutName = cms.string('PhoAnyPFIsoWithEAAndExpoScalingEBCut'), # Neutral hadrons isolation block
295  # Barrel: cut = c1 + expo(pt*c2+c3)
296  C1_EB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C1 ),
297  C2_EB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C2 ),
298  C3_EB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C3 ),
299  # Endcap: cut = c1 + pt*c2
300  C1_EE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C1 ),
301  C2_EE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C2 ),
302  anyPFIsoMap = cms.InputTag( isoInputs.neuHadIsolationMapName ),
303  barrelCutOff = cms.double(ebCutOff),
304  useRelativeIso = cms.bool(False),
305  needsAdditionalProducts = cms.bool(True),
306  isIgnored = cms.bool(False),
307  rho = cms.InputTag("fixedGridRhoFastjetAll"),
308  effAreasConfigFile = cms.FileInPath( isoInputs.neuHadIsolationEffAreas )
309  )
310 
311 # Configure the cut on the neutral hadron isolation that uses
312 # the exponential pt scaling for both barrel and endcap
313 def psetNeuHadIsoWithEAExpoScalingCut(wpEB, wpEE, isoInputs):
314  """
315  Arguments: two containers of working point cut values of the type WorkingPoint_*
316  The third argument contains data for isolation calculation.
317  """
318  return cms.PSet(
319  cutName = cms.string('PhoAnyPFIsoWithEAAndExpoScalingCut'), # Neutral hadrons isolation block
320  # Barrel: cut = c1 + expo(pt*c2+c3)
321  C1_EB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C1 ),
322  C2_EB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C2 ),
323  C3_EB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C3 ),
324  # Endcap: cut = cut = c1 + expo(pt*c2+c3)
325  C1_EE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C1 ),
326  C2_EE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C2 ),
327  C3_EE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C3 ),
328  anyPFIsoMap = cms.InputTag( isoInputs.neuHadIsolationMapName ),
329  barrelCutOff = cms.double(ebCutOff),
330  useRelativeIso = cms.bool(False),
331  needsAdditionalProducts = cms.bool(True),
332  isIgnored = cms.bool(False),
333  rho = cms.InputTag("fixedGridRhoFastjetAll"),
334  effAreasConfigFile = cms.FileInPath( isoInputs.neuHadIsolationEffAreas )
335  )
336 
337 # Configure the cut on the neutral hadron isolation that uses
338 # the quadratic polynomial pt scaling for both barrel and endcap
339 def psetNeuHadIsoWithEAQuadScalingCut(wpEB, wpEE, isoInputs):
340  """
341  Arguments: two containers of working point cut values of the type WorkingPoint_*
342  The third argument contains data for isolation calculation.
343  """
344  return cms.PSet(
345  cutName = cms.string('PhoGenericRhoPtScaledCut'),
346  cutVariable = cms.string("neutralHadronIso"),
347  lessThan = cms.bool(True),
348  # cut
349  constTermEB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C1 ),
350  constTermEE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C1 ),
351  linearPtTermEB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C2 ),
352  linearPtTermEE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C2 ),
353  quadPtTermEB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C3 ),
354  quadPtTermEE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C3 ),
355  needsAdditionalProducts = cms.bool(True),
356  isIgnored = cms.bool(False),
357  rho = cms.InputTag("fixedGridRhoFastjetAll"),
358  effAreasConfigFile = cms.FileInPath( isoInputs.neuHadIsolationEffAreas )
359  )
360 
361 # Configure the cut on the photon isolation that uses
362 # the linear pt scaling for barrel and endcap
363 def psetPhoIsoWithEALinScalingCut(wpEB, wpEE, isoInputs):
364  """
365  Arguments: two containers of working point cut values of the type WorkingPoint_*
366  The third argument contains data for isolation calculation.
367  """
368  return cms.PSet(
369  cutName = cms.string('PhoGenericRhoPtScaledCut'),
370  cutVariable = cms.string("photonIso"),
371  lessThan = cms.bool(True),
372  # cut
373  constTermEB = cms.double( wpEB.absPFPhoIsoWithEACut_C1 ),
374  constTermEE = cms.double( wpEE.absPFPhoIsoWithEACut_C1 ),
375  linearPtTermEB = cms.double( wpEB.absPFPhoIsoWithEACut_C2 ),
376  linearPtTermEE = cms.double( wpEE.absPFPhoIsoWithEACut_C2 ),
377  quadPtTermEB = cms.double( 0. ),
378  quadPtTermEE = cms.double( 0. ),
379  needsAdditionalProducts = cms.bool(True),
380  isIgnored = cms.bool(False),
381  rho = cms.InputTag("fixedGridRhoFastjetAll"),
382  effAreasConfigFile = cms.FileInPath( isoInputs.phoIsolationEffAreas )
383  )
384 
385 
386 # Configure the cut on H/E (cone-based)
387 def psetPhoHcalOverEcalWithEACut( wpEB, wpEE, hOverEInputs ):
388  """
389  Arguments: two containers of working point cut values of the type WorkingPoint_V3
390  Third argument contains the effective areas for pile-up corrections.
391  """
392  return cms.PSet(
393  cutName = cms.string('PhoGenericQuadraticRhoPtScaledCut'),
394  cutVariable = cms.string("hcalOverEcal"),
395  lessThan = cms.bool(True),
396  # cut
397  constTermEB = cms.double( wpEB.hOverEwithEACut ),
398  constTermEE = cms.double( wpEE.hOverEwithEACut ),
399  linearPtTermEB = cms.double( 0. ),
400  linearPtTermEE = cms.double( 0. ),
401  quadraticPtTermEB = cms.double( 0. ),
402  quadraticPtTermEE = cms.double( 0. ),
403  needsAdditionalProducts = cms.bool(True),
404  isIgnored = cms.bool(False),
405  rho = cms.InputTag("fixedGridRhoFastjetAll"),
406  quadEAflag = cms.bool(True),
407  effAreasConfigFile = cms.FileInPath( hOverEInputs.hOverEEffAreas )
408  )
409 
410 
411 # Configure the cut on the charged hadron isolation that uses
412 # the quadratic pt scaling for barrel and endcap
413 def psetChgHadIsoWithEAQuadScalingCut(wpEB, wpEE, isoInputs):
414  """
415  Arguments: two containers of working point cut values of the type WorkingPoint_V3
416  The third argument contains data for isolation calculation.
417  The cut is (for lessThan==True), otherwise replace "<" with ">="
418  X < constTerm + linearPtTerm*pt + quadPtTerm* pt*pt + rho*EA
419  """
420  return cms.PSet(
421  cutName = cms.string('PhoGenericQuadraticRhoPtScaledCut'),
422  cutVariable = cms.string("chargedHadronIso"),
423  lessThan = cms.bool(True),
424  # cut
425  constTermEB = cms.double( wpEB.absPFChgHadIsoWithEACut_C1 ),
426  constTermEE = cms.double( wpEE.absPFChgHadIsoWithEACut_C1 ),
427  linearPtTermEB = cms.double( wpEB.absPFChgHadIsoWithEACut_C2 ),
428  linearPtTermEE = cms.double( wpEE.absPFChgHadIsoWithEACut_C2 ),
429  quadraticPtTermEB = cms.double( 0. ),
430  quadraticPtTermEE = cms.double( 0. ),
431  needsAdditionalProducts = cms.bool(True),
432  isIgnored = cms.bool(False),
433  rho = cms.InputTag("fixedGridRhoFastjetAll"),
434  quadEAflag = cms.bool(True),
435  effAreasConfigFile = cms.FileInPath( isoInputs.chHadIsolationEffAreas )
436  )
437 
438 
439 
440 # Configure the cut on the ECal cluster isolation that uses
441 # the quadratic pt scaling for barrel and endcap
442 def psetECalClusIsoWithEAQuadScalingCut(wpEB, wpEE, clusterIsoInputs):
443  """
444  Arguments: two containers of working point cut values of the type WorkingPoint_V3
445  The third argument contains data for isolation calculation.
446  """
447  return cms.PSet(
448  cutName = cms.string('PhoGenericQuadraticRhoPtScaledCut'),
449  cutVariable = cms.string("ecalPFClusterIso"),
450  lessThan = cms.bool(True),
451  # cut
452  constTermEB = cms.double( wpEB.absPFECalClusIsoWithEACut_C1 ),
453  constTermEE = cms.double( wpEE.absPFECalClusIsoWithEACut_C1 ),
454  linearPtTermEB = cms.double( wpEB.absPFECalClusIsoWithEACut_C2 ),
455  linearPtTermEE = cms.double( wpEE.absPFECalClusIsoWithEACut_C2 ),
456  quadraticPtTermEB = cms.double( 0. ),
457  quadraticPtTermEE = cms.double( 0. ),
458  needsAdditionalProducts = cms.bool(True),
459  isIgnored = cms.bool(False),
460  rho = cms.InputTag("fixedGridRhoFastjetAll"),
461  quadEAflag = cms.bool(True),
462  effAreasConfigFile = cms.FileInPath( clusterIsoInputs.ecalClusIsolationEffAreas )
463  )
464 
465 
466 # Configure the cut on the HCal cluster isolation that uses
467 # the quadratic polynomial pt scaling for both barrel and endcap
468 def psetHCalClusIsoWithEAQuadScalingCut(wpEB, wpEE, clusterIsoInputs):
469  """
470  Arguments: two containers of working point cut values of the type WorkingPoint_V3
471  The third argument contains data for isolation calculation.
472  """
473  return cms.PSet(
474  cutName = cms.string('PhoGenericQuadraticRhoPtScaledCut'),
475  cutVariable = cms.string("hcalPFClusterIso"),
476  lessThan = cms.bool(True),
477  # cut
478  constTermEB = cms.double( wpEB.absPFHCalClusIsoWithEACut_C1 ),
479  constTermEE = cms.double( wpEE.absPFHCalClusIsoWithEACut_C1 ),
480  linearPtTermEB = cms.double( wpEB.absPFHCalClusIsoWithEACut_C2 ),
481  linearPtTermEE = cms.double( wpEE.absPFHCalClusIsoWithEACut_C2 ),
482  quadraticPtTermEB = cms.double( wpEB.absPFHCalClusIsoWithEACut_C3 ),
483  quadraticPtTermEE = cms.double( wpEE.absPFHCalClusIsoWithEACut_C3 ),
484  needsAdditionalProducts = cms.bool(True),
485  isIgnored = cms.bool(False),
486  rho = cms.InputTag("fixedGridRhoFastjetAll"),
487  quadEAflag = cms.bool(True),
488  effAreasConfigFile = cms.FileInPath( clusterIsoInputs.hcalClusIsolationEffAreas )
489  )
490 
491 
492 
493 # ==============================================================
494 # Define the complete cut sets
495 # ==============================================================
496 
497 
498 def configureVIDCutBasedPhoID_V1( wpEB, wpEE, isoInputs ):
499  """
500  This function configures the full cms.PSet for a VID ID and returns it.
501  The inputs: two objects of the type WorkingPoint_V1, one
502  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
503  The third argument contains data for isolation calculation.
504  """
505  # print "VID: Configuring cut set %s" % wpEB.idName
506  parameterSet = cms.PSet(
507  #
508  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
509  cutFlow = cms.VPSet(
510  psetMinPtCut(), # pt cut
511  psetPhoSCEtaMultiRangeCut(), # eta cut
512  psetPhoHcalOverEcalBcCut(wpEB,wpEE), # H/E cut
513  psetPhoFull5x5SigmaIEtaIEtaValueMapCut(wpEB,wpEE), # full 5x5 sigmaIEtaIEta cut
514  psetChHadIsoWithEALinScalingCut(wpEB,wpEE,isoInputs), # charged hadron isolation cut
515  psetNeuHadIsoWithEALinScalingCut(wpEB,wpEE,isoInputs), # neutral hadron isolation cut
516  psetPhoIsoWithEALinScalingCut(wpEB,wpEE,isoInputs) # photon isolation cut
517  )
518  )
519  #
520  return parameterSet
521 
522 def configureVIDCutBasedPhoID_V2( wpEB, wpEE, isoInputs ):
523  """
524  This function configures the full cms.PSet for a VID ID and returns it.
525  The inputs: first object is of the type WorkingPoint_V2, second object
526  is of the type WorkingPoint_V1, containing the cuts for the Barrel (EB)
527  and the other one for the Endcap (EE).
528  The third argument contains data for isolation calculation.
529 
530  The V2 with respect to V1 has one change: the neutral hadron isolation
531  cut has an exponential pt scaling for the barrel.
532  """
533  # print "VID: Configuring cut set %s" % wpEB.idName
534  parameterSet = cms.PSet(
535  #
536  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
537  cutFlow = cms.VPSet(
538  psetMinPtCut(), # pt cut
539  psetPhoSCEtaMultiRangeCut(), # eta cut
540  psetPhoHcalOverEcalBcCut(wpEB,wpEE), # H/E cut
541  psetPhoFull5x5SigmaIEtaIEtaValueMapCut(wpEB,wpEE), # full 5x5 sigmaIEtaIEta cut
542  psetChHadIsoWithEALinScalingCut(wpEB,wpEE,isoInputs), # charged hadron isolation cut
543  psetNeuHadIsoWithEAExpoScalingEBCut(wpEB,wpEE,isoInputs), # neutral hadron isolation cut
544  psetPhoIsoWithEALinScalingCut(wpEB,wpEE,isoInputs) # photon isolation cut
545  )
546  )
547  #
548  return parameterSet
549 
550 def configureVIDCutBasedPhoID_V3( wpEB, wpEE, isoInputs ):
551  """
552  This function configures the full cms.PSet for a VID ID and returns it.
553  The inputs: first object is of the type WorkingPoint_V2, second object
554  is of the type WorkingPoint_V1, containing the cuts for the Barrel (EB)
555  and the other one for the Endcap (EE).
556  The third argument contains data for isolation calculation.
557 
558  The V3 with respect to V2 has one change: the full5x5 sigmaIEtaIEta
559  is taken from the native reco::Photon method and not from a ValueMap
560  produced upstream by some producer module.
561  """
562  # print "VID: Configuring cut set %s" % wpEB.idName
563  parameterSet = cms.PSet(
564  #
565  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
566  cutFlow = cms.VPSet(
567  psetMinPtCut(), # pt cut
568  psetPhoSCEtaMultiRangeCut(), # eta cut
569  psetPhoHcalOverEcalBcCut(wpEB,wpEE), # H/E cut
570  psetPhoFull5x5SigmaIEtaIEtaCut(wpEB,wpEE), # full 5x5 sigmaIEtaIEta cut
571  psetChHadIsoWithEALinScalingCut(wpEB,wpEE,isoInputs), # charged hadron isolation cut
572  psetNeuHadIsoWithEAExpoScalingEBCut(wpEB,wpEE,isoInputs), # neutral hadron isolation cut
573  psetPhoIsoWithEALinScalingCut(wpEB,wpEE,isoInputs) # photon isolation cut
574  )
575  )
576  #
577  return parameterSet
578 
579 def configureVIDCutBasedPhoID_V4( wpEB, wpEE, isoInputs ):
580  """
581  This function configures the full cms.PSet for a VID ID and returns it.
582  The inputs: first object is of the type WorkingPoint_V2, second object
583  is of the type WorkingPoint_V2 as well, first containing the cuts for the
584  Barrel (EB) and the other one for the Endcap (EE).
585  The third argument contains data for isolation calculation.
586 
587  The V4 with respect to V3 has one change: both barrel and endcap
588  use the exponential scaling for the neutral hadron isolation cut
589  (in V3 it was only done for the barrel)
590  """
591  # print "VID: Configuring cut set %s" % wpEB.idName
592  parameterSet = cms.PSet(
593  #
594  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
595  cutFlow = cms.VPSet(
596  psetMinPtCut(), # pt cut
597  psetPhoSCEtaMultiRangeCut(), # eta cut
598  psetPhoHcalOverEcalBcCut(wpEB,wpEE), # H/E cut
599  psetPhoFull5x5SigmaIEtaIEtaCut(wpEB,wpEE), # full 5x5 sigmaIEtaIEta cut
600  psetChHadIsoWithEALinScalingCut(wpEB,wpEE,isoInputs), # charged hadron isolation cut
601  psetNeuHadIsoWithEAExpoScalingCut(wpEB,wpEE,isoInputs), # neutral hadron isolation cut
602  psetPhoIsoWithEALinScalingCut(wpEB,wpEE,isoInputs) # photon isolation cut
603  )
604  )
605  #
606  return parameterSet
607 
608 def configureVIDCutBasedPhoID_V5( wpEB, wpEE, isoInputs ):
609  """
610  This function configures the full cms.PSet for a VID ID and returns it.
611  The inputs: first object is of the type WorkingPoint_V2, second object
612  is of the type WorkingPoint_V2 as well, first containing the cuts for the
613  Barrel (EB) and the other one for the Endcap (EE).
614  The third argument contains data for isolation calculation.
615 
616  The V5 with respect to V4 has one change: the neutral hadron isolation
617  for both barrel and endcap now uses quadratic polynomial scaling.
618  """
619  # print "VID: Configuring cut set %s" % wpEB.idName
620  parameterSet = cms.PSet(
621  #
622  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
623  cutFlow = cms.VPSet(
624  psetMinPtCut(), # pt cut
625  psetPhoSCEtaMultiRangeCut(), # eta cut
626  psetPhoHcalOverEcalBcCut(wpEB,wpEE), # H/E cut
627  psetPhoFull5x5SigmaIEtaIEtaCut(wpEB,wpEE), # full 5x5 sigmaIEtaIEta cut
628  psetChHadIsoWithEALinScalingCut(wpEB,wpEE,isoInputs), # charged hadron isolation cut
629  psetNeuHadIsoWithEAQuadScalingCut(wpEB,wpEE,isoInputs), # neutral hadron isolation cut
630  psetPhoIsoWithEALinScalingCut(wpEB,wpEE,isoInputs) # photon isolation cut
631  )
632  )
633  #
634  return parameterSet
635 
636 
637 
638 def configureVIDCutBasedPhoID_V6( wpEB, wpEE, isoInputs, clusterIsoInputs, hOverEInputs ):
639  """
640  This function configures the full cms.PSet for a VID ID and returns it.
641  The inputs: first object is of the type WorkingPoint_V3, second object
642  is of the type WorkingPoint_V3 as well, first containing the cuts for the
643  Barrel (EB) and the other one for the Endcap (EE).
644  The third argument contains data for isolation calculation.
645 
646  The V6 with respect to V5 has following changes:
647  1) H/E is now cone-based instead of tower-based.
648  2) Neutral hadron isolation is replaced by HCal Cluster isolation
649  for both barrel and endcap (and uses quadratic polynomial scaling
650  as done before for neutral hadron isolation).
651  3) Photon isolation is replaced by ECal Cluster isolation for both
652  barrel and endcap (and uses linear polynomial scaling as done before
653  for photon isolation).
654  """
655 
656  # print "VID: Configuring cut set %s" % wpEB.idName
657  parameterSet = cms.PSet(
658  #
659  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
660  cutFlow = cms.VPSet(
661  psetMinPtCut(), # pt cut
662  psetPhoSCEtaMultiRangeCut(), # eta cut
663  psetPhoFull5x5SigmaIEtaIEtaCut(wpEB,wpEE), # full 5x5 sigmaIEtaIEta cut
664  psetPhoHcalOverEcalWithEACut(wpEB,wpEE,hOverEInputs), # H/E cut
665  psetChgHadIsoWithEAQuadScalingCut(wpEB,wpEE,isoInputs), # charged hadron isolation cut
666  psetECalClusIsoWithEAQuadScalingCut(wpEB,wpEE,clusterIsoInputs), # ecal cluster isolation cut
667  psetHCalClusIsoWithEAQuadScalingCut(wpEB,wpEE,clusterIsoInputs) # hcal cluster isolation cut
668  )
669  )
670  #
671  return parameterSet
672 
673 
def configureVIDCutBasedPhoID_V1(wpEB, wpEE, isoInputs)
def psetNeuHadIsoWithEAExpoScalingCut(wpEB, wpEE, isoInputs)
def psetNeuHadIsoWithEAQuadScalingCut(wpEB, wpEE, isoInputs)
def psetPhoHcalOverEcalBcCut(wpEB, wpEE)
def psetChgHadIsoWithEAQuadScalingCut(wpEB, wpEE, isoInputs)
def __init__(self, trkIsolationMapName, trkIsolationEffAreas, ecalClusIsolationMapName, ecalClusIsolationEffAreas, hcalClusIsolationMapName, hcalClusIsolationEffAreas)
def configureVIDCutBasedPhoID_V5(wpEB, wpEE, isoInputs)
def configureVIDCutBasedPhoID_V3(wpEB, wpEE, isoInputs)
def psetPhoFull5x5SigmaIEtaIEtaValueMapCut(wpEB, wpEE)
def configureVIDCutBasedPhoID_V6(wpEB, wpEE, isoInputs, clusterIsoInputs, hOverEInputs)
def psetPhoIsoWithEALinScalingCut(wpEB, wpEE, isoInputs)
def psetECalClusIsoWithEAQuadScalingCut(wpEB, wpEE, clusterIsoInputs)
def psetNeuHadIsoWithEAExpoScalingEBCut(wpEB, wpEE, isoInputs)
def __init__(self, idName, hOverECut, full5x5_sigmaIEtaIEtaCut, absPFChaHadIsoWithEACut_C1, absPFChaHadIsoWithEACut_C2, absPFNeuHadIsoWithEACut_C1, absPFNeuHadIsoWithEACut_C2, absPFPhoIsoWithEACut_C1, absPFPhoIsoWithEACut_C2)
def psetChHadIsoWithEALinScalingCut(wpEB, wpEE, isoInputs)
def configureVIDCutBasedPhoID_V4(wpEB, wpEE, isoInputs)
def __init__(self, chHadIsolationMapName, chHadIsolationEffAreas, neuHadIsolationMapName, neuHadIsolationEffAreas, phoIsolationMapName, phoIsolationEffAreas)
def psetHCalClusIsoWithEAQuadScalingCut(wpEB, wpEE, clusterIsoInputs)
def __init__(self, idName, hOverECut, full5x5_sigmaIEtaIEtaCut, absPFChaHadIsoWithEACut_C1, absPFChaHadIsoWithEACut_C2, absPFNeuHadIsoWithEACut_C1, absPFNeuHadIsoWithEACut_C2, absPFNeuHadIsoWithEACut_C3, absPFPhoIsoWithEACut_C1, absPFPhoIsoWithEACut_C2)
def psetPhoHcalOverEcalWithEACut(wpEB, wpEE, hOverEInputs)
def configureVIDCutBasedPhoID_V2(wpEB, wpEE, isoInputs)
def psetNeuHadIsoWithEALinScalingCut(wpEB, wpEE, isoInputs)
def __init__(self, idName, full5x5_sigmaIEtaIEtaCut, hOverEwithEACut, absPFChgHadIsoWithEACut_C1, absPFChgHadIsoWithEACut_C2, absPFECalClusIsoWithEACut_C1, absPFECalClusIsoWithEACut_C2, absPFHCalClusIsoWithEACut_C1, absPFHCalClusIsoWithEACut_C2, absPFHCalClusIsoWithEACut_C3)
def psetPhoFull5x5SigmaIEtaIEtaCut(wpEB, wpEE)