CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
cutBasedPhotonID_tools Namespace Reference

Classes

class  IsolationCutInputs
 
class  WorkingPoint_V1
 
class  WorkingPoint_V2
 

Functions

def configureVIDCutBasedPhoID_V1
 
def configureVIDCutBasedPhoID_V2
 
def configureVIDCutBasedPhoID_V3
 
def psetChHadIsoWithEALinScalingCut
 
def psetMinPtCut
 
def psetNeuHadIsoWithEAExpoScalingEBCut
 
def psetNeuHadIsoWithEALinScalingCut
 
def psetPhoFull5x5SigmaIEtaIEtaCut
 
def psetPhoFull5x5SigmaIEtaIEtaValueMapCut
 
def psetPhoIsoWithEALinScalingCut
 
def psetPhoSCEtaMultiRangeCut
 
def psetPhoSingleTowerHadOverEmCut
 

Variables

float ebCutOff = 1.479
 

Function Documentation

def cutBasedPhotonID_tools.configureVIDCutBasedPhoID_V1 (   wpEB,
  wpEE,
  isoInputs 
)
This function configures the full cms.PSet for a VID ID and returns it.
The inputs: two objects of the type WorkingPoint_V1, one
containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
The third argument contains data for isolation calculation.

Definition at line 265 of file cutBasedPhotonID_tools.py.

References psetChHadIsoWithEALinScalingCut(), psetMinPtCut(), psetNeuHadIsoWithEALinScalingCut(), psetPhoFull5x5SigmaIEtaIEtaValueMapCut(), psetPhoIsoWithEALinScalingCut(), psetPhoSCEtaMultiRangeCut(), and psetPhoSingleTowerHadOverEmCut().

266 def configureVIDCutBasedPhoID_V1( wpEB, wpEE, isoInputs ):
267  """
268  This function configures the full cms.PSet for a VID ID and returns it.
269  The inputs: two objects of the type WorkingPoint_V1, one
270  containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
271  The third argument contains data for isolation calculation.
272  """
273  # print "VID: Configuring cut set %s" % wpEB.idName
274  parameterSet = cms.PSet(
275  #
276  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
277  cutFlow = cms.VPSet(
278  psetMinPtCut(), # pt cut
279  psetPhoSCEtaMultiRangeCut(), # eta cut
280  psetPhoSingleTowerHadOverEmCut(wpEB,wpEE), # H/E cut
281  psetPhoFull5x5SigmaIEtaIEtaValueMapCut(wpEB,wpEE), # full 5x5 sigmaIEtaIEta cut
282  psetChHadIsoWithEALinScalingCut(wpEB,wpEE,isoInputs), # charged hadron isolation cut
283  psetNeuHadIsoWithEALinScalingCut(wpEB,wpEE,isoInputs), # neutral hadron isolation cut
284  psetPhoIsoWithEALinScalingCut(wpEB,wpEE,isoInputs) # photon isolation cut
285  )
286  )
287  #
288  return parameterSet
def cutBasedPhotonID_tools.configureVIDCutBasedPhoID_V2 (   wpEB,
  wpEE,
  isoInputs 
)
This function configures the full cms.PSet for a VID ID and returns it.
The inputs: first object is of the type WorkingPoint_V2, second object
is of the type WorkingPoint_V1, containing the cuts for the Barrel (EB) 
and the other one for the Endcap (EE).
The third argument contains data for isolation calculation.

The V2 with respect to V1 has one change: the neutral hadron isolation
cut has an exponential pt scaling for the barrel.

Definition at line 289 of file cutBasedPhotonID_tools.py.

References psetChHadIsoWithEALinScalingCut(), psetMinPtCut(), psetNeuHadIsoWithEAExpoScalingEBCut(), psetPhoFull5x5SigmaIEtaIEtaValueMapCut(), psetPhoIsoWithEALinScalingCut(), psetPhoSCEtaMultiRangeCut(), and psetPhoSingleTowerHadOverEmCut().

290 def configureVIDCutBasedPhoID_V2( wpEB, wpEE, isoInputs ):
291  """
292  This function configures the full cms.PSet for a VID ID and returns it.
293  The inputs: first object is of the type WorkingPoint_V2, second object
294  is of the type WorkingPoint_V1, containing the cuts for the Barrel (EB)
295  and the other one for the Endcap (EE).
296  The third argument contains data for isolation calculation.
297 
298  The V2 with respect to V1 has one change: the neutral hadron isolation
299  cut has an exponential pt scaling for the barrel.
300  """
301  # print "VID: Configuring cut set %s" % wpEB.idName
302  parameterSet = cms.PSet(
303  #
304  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
305  cutFlow = cms.VPSet(
306  psetMinPtCut(), # pt cut
307  psetPhoSCEtaMultiRangeCut(), # eta cut
308  psetPhoSingleTowerHadOverEmCut(wpEB,wpEE), # H/E cut
309  psetPhoFull5x5SigmaIEtaIEtaValueMapCut(wpEB,wpEE), # full 5x5 sigmaIEtaIEta cut
310  psetChHadIsoWithEALinScalingCut(wpEB,wpEE,isoInputs), # charged hadron isolation cut
311  psetNeuHadIsoWithEAExpoScalingEBCut(wpEB,wpEE,isoInputs), # neutral hadron isolation cut
312  psetPhoIsoWithEALinScalingCut(wpEB,wpEE,isoInputs) # photon isolation cut
313  )
314  )
315  #
316  return parameterSet
def cutBasedPhotonID_tools.configureVIDCutBasedPhoID_V3 (   wpEB,
  wpEE,
  isoInputs 
)
This function configures the full cms.PSet for a VID ID and returns it.
The inputs: first object is of the type WorkingPoint_V2, second object
is of the type WorkingPoint_V1, containing the cuts for the Barrel (EB) 
and the other one for the Endcap (EE).
The third argument contains data for isolation calculation.

The V3 with respect to V2 has one change: the full5x5 sigmaIEtaIEta
is taken from the native reco::Photon method and not from a ValueMap
produced upstream by some producer module.

Definition at line 317 of file cutBasedPhotonID_tools.py.

References psetChHadIsoWithEALinScalingCut(), psetMinPtCut(), psetNeuHadIsoWithEAExpoScalingEBCut(), psetPhoFull5x5SigmaIEtaIEtaCut(), psetPhoIsoWithEALinScalingCut(), psetPhoSCEtaMultiRangeCut(), and psetPhoSingleTowerHadOverEmCut().

318 def configureVIDCutBasedPhoID_V3( wpEB, wpEE, isoInputs ):
319  """
320  This function configures the full cms.PSet for a VID ID and returns it.
321  The inputs: first object is of the type WorkingPoint_V2, second object
322  is of the type WorkingPoint_V1, containing the cuts for the Barrel (EB)
323  and the other one for the Endcap (EE).
324  The third argument contains data for isolation calculation.
325 
326  The V3 with respect to V2 has one change: the full5x5 sigmaIEtaIEta
327  is taken from the native reco::Photon method and not from a ValueMap
328  produced upstream by some producer module.
329  """
330  # print "VID: Configuring cut set %s" % wpEB.idName
331  parameterSet = cms.PSet(
332  #
333  idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
334  cutFlow = cms.VPSet(
335  psetMinPtCut(), # pt cut
336  psetPhoSCEtaMultiRangeCut(), # eta cut
337  psetPhoSingleTowerHadOverEmCut(wpEB,wpEE), # H/E cut
338  psetPhoFull5x5SigmaIEtaIEtaCut(wpEB,wpEE), # full 5x5 sigmaIEtaIEta cut
339  psetChHadIsoWithEALinScalingCut(wpEB,wpEE,isoInputs), # charged hadron isolation cut
340  psetNeuHadIsoWithEAExpoScalingEBCut(wpEB,wpEE,isoInputs), # neutral hadron isolation cut
341  psetPhoIsoWithEALinScalingCut(wpEB,wpEE,isoInputs) # photon isolation cut
342  )
343  )
344  #
345  return parameterSet
346 
def cutBasedPhotonID_tools.psetChHadIsoWithEALinScalingCut (   wpEB,
  wpEE,
  isoInputs 
)
Arguments: two containers of working point cut values of the type WorkingPoint_*
The third argument contains data for isolation calculation.

Definition at line 168 of file cutBasedPhotonID_tools.py.

Referenced by configureVIDCutBasedPhoID_V1(), configureVIDCutBasedPhoID_V2(), and configureVIDCutBasedPhoID_V3().

169 def psetChHadIsoWithEALinScalingCut(wpEB, wpEE, isoInputs):
170  """
171  Arguments: two containers of working point cut values of the type WorkingPoint_*
172  The third argument contains data for isolation calculation.
173  """
174  return cms.PSet(
175  cutName = cms.string('PhoAnyPFIsoWithEACut'),
176  # Both barrel and endcap: cut = c1 + pt*c2
177  C1_EB = cms.double( wpEB.absPFChaHadIsoWithEACut_C1 ),
178  C2_EB = cms.double( wpEB.absPFChaHadIsoWithEACut_C2 ),
179  C1_EE = cms.double( wpEE.absPFChaHadIsoWithEACut_C1 ),
180  C2_EE = cms.double( wpEE.absPFChaHadIsoWithEACut_C2 ),
181  anyPFIsoMap = cms.InputTag( isoInputs.chHadIsolationMapName ),
182  barrelCutOff = cms.double(ebCutOff),
183  useRelativeIso = cms.bool(False),
184  needsAdditionalProducts = cms.bool(True),
185  isIgnored = cms.bool(False),
186  rho = cms.InputTag("fixedGridRhoFastjetAll"),
187  effAreasConfigFile = cms.FileInPath( isoInputs.chHadIsolationEffAreas )
188  )
189 
190 # Configure the cut on the neutral hadron isolation that uses
# the linear pt scaling for barrel and endcap
def cutBasedPhotonID_tools.psetMinPtCut ( )

Definition at line 96 of file cutBasedPhotonID_tools.py.

Referenced by configureVIDCutBasedPhoID_V1(), configureVIDCutBasedPhoID_V2(), and configureVIDCutBasedPhoID_V3().

96 
97 def psetMinPtCut():
98  return cms.PSet(
99  cutName = cms.string("MinPtCut"),
100  minPt = cms.double(5.0),
101  needsAdditionalProducts = cms.bool(False),
102  isIgnored = cms.bool(False)
103  )
104 
# Take all particles in the eta ranges 0-ebCutOff and ebCutOff-2.5
def cutBasedPhotonID_tools.psetNeuHadIsoWithEAExpoScalingEBCut (   wpEB,
  wpEE,
  isoInputs 
)
Arguments: two containers of working point cut values of the type WorkingPoint_*
The third argument contains data for isolation calculation.

Definition at line 214 of file cutBasedPhotonID_tools.py.

Referenced by configureVIDCutBasedPhoID_V2(), and configureVIDCutBasedPhoID_V3().

215 def psetNeuHadIsoWithEAExpoScalingEBCut(wpEB, wpEE, isoInputs):
216  """
217  Arguments: two containers of working point cut values of the type WorkingPoint_*
218  The third argument contains data for isolation calculation.
219  """
220  return cms.PSet(
221  cutName = cms.string('PhoAnyPFIsoWithEAAndExpoScalingEBCut'), # Neutral hadrons isolation block
222  # Barrel: cut = c1 + expo(pt*c2+c3)
223  C1_EB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C1 ),
224  C2_EB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C2 ),
225  C3_EB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C3 ),
226  # Endcap: cut = c1 + pt*c2
227  C1_EE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C1 ),
228  C2_EE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C2 ),
229  anyPFIsoMap = cms.InputTag( isoInputs.neuHadIsolationMapName ),
230  barrelCutOff = cms.double(ebCutOff),
231  useRelativeIso = cms.bool(False),
232  needsAdditionalProducts = cms.bool(True),
233  isIgnored = cms.bool(False),
234  rho = cms.InputTag("fixedGridRhoFastjetAll"),
235  effAreasConfigFile = cms.FileInPath( isoInputs.neuHadIsolationEffAreas )
236  )
237 
238 # Configure the cut on the photon isolation that uses
# the linear pt scaling for barrel and endcap
def cutBasedPhotonID_tools.psetNeuHadIsoWithEALinScalingCut (   wpEB,
  wpEE,
  isoInputs 
)
Arguments: two containers of working point cut values of the type WorkingPoint_*
The third argument contains data for isolation calculation.

Definition at line 191 of file cutBasedPhotonID_tools.py.

Referenced by configureVIDCutBasedPhoID_V1().

192 def psetNeuHadIsoWithEALinScalingCut( wpEB, wpEE, isoInputs):
193  """
194  Arguments: two containers of working point cut values of the type WorkingPoint_*
195  The third argument contains data for isolation calculation.
196  """
197  return cms.PSet(
198  cutName = cms.string('PhoAnyPFIsoWithEACut'), # Neutral hadrons isolation block
199  # Both barrel and endcap: cut = c1 + pt*c2
200  C1_EB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C1 ),
201  C2_EB = cms.double( wpEB.absPFNeuHadIsoWithEACut_C2 ),
202  C1_EE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C1 ),
203  C2_EE = cms.double( wpEE.absPFNeuHadIsoWithEACut_C2 ),
204  anyPFIsoMap = cms.InputTag( isoInputs.neuHadIsolationMapName ),
205  barrelCutOff = cms.double(ebCutOff),
206  useRelativeIso = cms.bool(False),
207  needsAdditionalProducts = cms.bool(True),
208  isIgnored = cms.bool(False),
209  rho = cms.InputTag("fixedGridRhoFastjetAll"),
210  effAreasConfigFile = cms.FileInPath( isoInputs.neuHadIsolationEffAreas )
211  )
212 
213 # Configure the cut on the neutral hadron isolation that uses
# the exponential pt scaling for barrel and the linear pt scaling for endcap
def cutBasedPhotonID_tools.psetPhoFull5x5SigmaIEtaIEtaCut (   wpEB,
  wpEE 
)
Arguments: two containers of working point cut values of the type WorkingPoint_*

Definition at line 152 of file cutBasedPhotonID_tools.py.

Referenced by configureVIDCutBasedPhoID_V3().

153 def psetPhoFull5x5SigmaIEtaIEtaCut(wpEB, wpEE):
154  """
155  Arguments: two containers of working point cut values of the type WorkingPoint_*
156  """
157  return cms.PSet(
158  cutName = cms.string('PhoFull5x5SigmaIEtaIEtaCut'),
159  cutValueEB = cms.double( wpEB.full5x5_sigmaIEtaIEtaCut ),
160  cutValueEE = cms.double( wpEE.full5x5_sigmaIEtaIEtaCut ),
161  full5x5SigmaIEtaIEtaMap = cms.InputTag('photonIDValueMapProducer:phoFull5x5SigmaIEtaIEta'),
162  barrelCutOff = cms.double(ebCutOff),
163  needsAdditionalProducts = cms.bool(True),
164  isIgnored = cms.bool(False)
165  )
166 
167 # Configure the cut on the charged hadron isolation that uses
# the linear pt scaling for barrel and endcap
def cutBasedPhotonID_tools.psetPhoFull5x5SigmaIEtaIEtaValueMapCut (   wpEB,
  wpEE 
)
Arguments: two containers of working point cut values of the type WorkingPoint_*

Definition at line 136 of file cutBasedPhotonID_tools.py.

Referenced by configureVIDCutBasedPhoID_V1(), and configureVIDCutBasedPhoID_V2().

138  """
139  Arguments: two containers of working point cut values of the type WorkingPoint_*
140  """
141  return cms.PSet(
142  cutName = cms.string('PhoFull5x5SigmaIEtaIEtaValueMapCut'),
143  cutValueEB = cms.double( wpEB.full5x5_sigmaIEtaIEtaCut ),
144  cutValueEE = cms.double( wpEE.full5x5_sigmaIEtaIEtaCut ),
145  full5x5SigmaIEtaIEtaMap = cms.InputTag('photonIDValueMapProducer:phoFull5x5SigmaIEtaIEta'),
146  barrelCutOff = cms.double(ebCutOff),
147  needsAdditionalProducts = cms.bool(True),
148  isIgnored = cms.bool(False)
149  )
150 
151 # Configure the cut on full5x5 sigmaIEtaIEta that uses the native Photon field
# with this variable (works for releases past 7.2.0).
def cutBasedPhotonID_tools.psetPhoIsoWithEALinScalingCut (   wpEB,
  wpEE,
  isoInputs 
)
Arguments: two containers of working point cut values of the type WorkingPoint_*
The third argument contains data for isolation calculation.

Definition at line 239 of file cutBasedPhotonID_tools.py.

Referenced by configureVIDCutBasedPhoID_V1(), configureVIDCutBasedPhoID_V2(), and configureVIDCutBasedPhoID_V3().

240 def psetPhoIsoWithEALinScalingCut(wpEB, wpEE, isoInputs):
241  """
242  Arguments: two containers of working point cut values of the type WorkingPoint_*
243  The third argument contains data for isolation calculation.
244  """
245  return cms.PSet(
246  cutName = cms.string('PhoAnyPFIsoWithEACut'), # Photons isolation block
247  # Both barrel and endcap: cut = c1 + pt*c2
248  C1_EB = cms.double( wpEB.absPFPhoIsoWithEACut_C1 ),
249  C2_EB = cms.double( wpEB.absPFPhoIsoWithEACut_C2 ),
250  C1_EE = cms.double( wpEE.absPFPhoIsoWithEACut_C1 ),
251  C2_EE = cms.double( wpEE.absPFPhoIsoWithEACut_C2 ),
252  anyPFIsoMap = cms.InputTag( isoInputs.phoIsolationMapName ),
253  barrelCutOff = cms.double(ebCutOff),
254  useRelativeIso = cms.bool(False),
255  needsAdditionalProducts = cms.bool(True),
256  isIgnored = cms.bool(False),
257  rho = cms.InputTag("fixedGridRhoFastjetAll"),
258  effAreasConfigFile = cms.FileInPath( isoInputs.phoIsolationEffAreas )
259  )
260 
261 # ==============================================================
262 # Define the complete cut sets
263 # ==============================================================
264 
def cutBasedPhotonID_tools.psetPhoSCEtaMultiRangeCut ( )

Definition at line 105 of file cutBasedPhotonID_tools.py.

Referenced by configureVIDCutBasedPhoID_V1(), configureVIDCutBasedPhoID_V2(), and configureVIDCutBasedPhoID_V3().

107  return cms.PSet(
108  cutName = cms.string("PhoSCEtaMultiRangeCut"),
109  useAbsEta = cms.bool(True),
110  allowedEtaRanges = cms.VPSet(
111  cms.PSet( minEta = cms.double(0.0),
112  maxEta = cms.double(ebCutOff) ),
113  cms.PSet( minEta = cms.double(ebCutOff),
114  maxEta = cms.double(2.5) )
115  ),
116  needsAdditionalProducts = cms.bool(False),
117  isIgnored = cms.bool(False)
118  )
119 
# Configure the cut on the single tower H/E
def cutBasedPhotonID_tools.psetPhoSingleTowerHadOverEmCut (   wpEB,
  wpEE 
)
Arguments: two containers of working point cut values of the type WorkingPoint_*

Definition at line 120 of file cutBasedPhotonID_tools.py.

Referenced by configureVIDCutBasedPhoID_V1(), configureVIDCutBasedPhoID_V2(), and configureVIDCutBasedPhoID_V3().

121 def psetPhoSingleTowerHadOverEmCut( wpEB, wpEE):
122  """
123  Arguments: two containers of working point cut values of the type WorkingPoint_*
124  """
125  return cms.PSet(
126  cutName = cms.string('PhoSingleTowerHadOverEmCut'),
127  hadronicOverEMCutValueEB = cms.double( wpEB.hOverECut ),
128  hadronicOverEMCutValueEE = cms.double( wpEE.hOverECut ),
129  barrelCutOff = cms.double(ebCutOff),
130  needsAdditionalProducts = cms.bool(False),
131  isIgnored = cms.bool(False)
132  )
133 
134 # Configure the cut on full5x5 sigmaIEtaIEta that uses a ValueMap,
135 # relying on an upstream producer that creates it. This was necessary
# for photons up to 7.2.0.

Variable Documentation

float cutBasedPhotonID_tools.ebCutOff = 1.479

Definition at line 5 of file cutBasedPhotonID_tools.py.