CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes
EgammaHLTValidationUtils.EgammaDQMModuleMaker Class Reference

Public Member Functions

def __init__ (self, process, pathName, pdgGen, requiredNumberOfGeneratedObjects, cutCollection=None)
 

Public Attributes

 path
 
 pathName
 
 process
 
 processName
 

Private Attributes

 __result
 

Detailed Description

a class which can be used to produce an analysis path
    for the EmDQM analyzer 

Definition at line 126 of file EgammaHLTValidationUtils.py.

Constructor & Destructor Documentation

◆ __init__()

def EgammaHLTValidationUtils.EgammaDQMModuleMaker.__init__ (   self,
  process,
  pathName,
  pdgGen,
  requiredNumberOfGeneratedObjects,
  cutCollection = None 
)
pathName is the HLT path to be validated.

pdgGen is the PDG id of the corersponding generated particles
  (11 for electrons, 22 for photons)

requiredNumberOfGeneratedObjects should be 1 for single triggers,
and 2 for double triggers (e.g. double photon triggers)

cutCollection is the name of the collection which should be used
  to define the acceptance region (at reconstruction level ?).
  typical values are 'fiducialZee'. If this is set to None,
  will be determined automatically from pdgGen and requiredNumberOfGeneratedObjects

Definition at line 132 of file EgammaHLTValidationUtils.py.

132  def __init__(self, process, pathName, pdgGen, requiredNumberOfGeneratedObjects, cutCollection = None):
133  """
134  pathName is the HLT path to be validated.
135 
136  pdgGen is the PDG id of the corersponding generated particles
137  (11 for electrons, 22 for photons)
138 
139  requiredNumberOfGeneratedObjects should be 1 for single triggers,
140  and 2 for double triggers (e.g. double photon triggers)
141 
142  cutCollection is the name of the collection which should be used
143  to define the acceptance region (at reconstruction level ?).
144  typical values are 'fiducialZee'. If this is set to None,
145  will be determined automatically from pdgGen and requiredNumberOfGeneratedObjects
146 
147  """
148 
149  self.process = process
150  self.pathName = pathName
151 
152  self.path = getattr(process,pathName)
153 
154  # the process whose products should be analyzed
155  self.processName = "HLT"
156 
157  #--------------------
158  # guess the collection for the fiducial volume cut
159  #--------------------
160 
161  if cutCollection == None:
162  cutCollection = "fiducial" + getProcessName(pdgGen, requiredNumberOfGeneratedObjects)
163 
164  #--------------------
165  # find Et threshold of primary object
166  #--------------------
167  mo = re.match("HLT_.*?(\d+).*",pathName)
168 
169  if mo != None:
170  etThreshold = float(mo.group(1))
171  else:
172  etThreshold = -1.0
173 
174  #--------------------
175  # initialize the analyzer we put together here
176  #--------------------
177  from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
178  self.__result = DQMEDAnalyzer('EmDQM',
179  triggerobject = cms.InputTag("hltTriggerSummaryRAW","","HLT"),
180  genEtaAcc = cms.double(2.5),
181  genEtAcc = cms.double(2.0),
182  reqNum = cms.uint32(requiredNumberOfGeneratedObjects),
183  filters = cms.VPSet(), # will be added later
184  PtMax = cms.untracked.double(100.0),
185  genEtMin = cms.untracked.double(etThreshold),
186  pdgGen = cms.int32(pdgGen),
187  cutcollection = cms.InputTag(cutCollection),
188 
189  # is this a requirement on reconstructed or generated number of objects ?
190  cutnum = cms.int32(requiredNumberOfGeneratedObjects),
191 
192 
193 
194  )
195 
196  #--------------------
197  # get all modules of this path.
198  # dirty hack: assumes that all modules
199  # are concatenated by '+'
200  # but easier than to use a node visitor
201  # and order the modules ourselves afterwards..
202 
203  moduleNames = str(self.path).split('+')
204 
205  # now find out which of these are EDFilters
206  # and what CMSSW class type they are
207 
208  # example:
209  #
210  # CMSSW type module name
211  # --------------------------------------------------------------------------------------------------------------------
212  # HLTTriggerTypeFilter hltTriggerType
213  # HLTLevel1GTSeed hltL1sL1SingleEG8
214  # HLTPrescaler hltPreEle17SWTighterEleIdIsolL1R
215  # HLTEgammaL1MatchFilterRegional hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolL1MatchFilterRegional
216  # HLTEgammaEtFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolEtFilter
217  # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolR9ShapeFilter
218  # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolClusterShapeFilter
219  # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TIghterEleIdIsolEcalIsolFilter
220  # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolHEFilter
221  # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolHcalIsolFilter
222  # HLTElectronPixelMatchFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolPixelMatchFilter
223  # HLTElectronOneOEMinusOneOPFilterRegional hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolOneOEMinusOneOPFilter
224  # HLTElectronGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolDetaFilter
225  # HLTElectronGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolDphiFilter
226  # HLTElectronGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolTrackIsolFilter
227  # HLTBool hltBoolEnd
228 
229  # it looks like in the MC menu, all modules have a name containing 'L1NonIso' and then
230  # have a parameter IsoCollections (which is mostly cms.Input("none")...)
231 
232  import FWCore.ParameterSet.Modules
233 
234  for moduleName in moduleNames:
235 
236  # add protection to avoid accessing non-existing modules
237  # (not understood why this is needed but happens
238  # in some cases...).
239  #
240  # should also cover the special cases listed afterwards
241  # (i.e. the check after this one could be removed
242  # at some point)
243  if not hasattr(self.process, moduleName):
244  continue
245 
246  # protection for FastSim HLT menu
247  # which seems to reference certain modules in some
248  # paths but these modules are not defined when just
249  # loading the HLT menu into a process object.
250  #
251  # this seems not to happen for the fullsim menu for some
252  # reason...
253  if moduleName in ('simulation',
254  'offlineBeamSpot',
255  'HLTEndSequence'):
256  continue
257 
258 
259 
260  module = getattr(self.process,moduleName)
261 
262  if not isinstance(module, FWCore.ParameterSet.Modules.EDFilter):
263  continue
264 
265  # ignore certain EDFilters
266  if module.type_() in ('HLTTriggerTypeFilter',
267  'HLTPrescaler',
268  'HLTBool'):
269  continue
270 
271  # print "XX", module.type_(), moduleName
272 
273  #--------------------
274  if module.type_() == 'HLTLevel1GTSeed':
275  # L1 seed
276  self.__result.filters.append(self.makePSetForL1SeedFilter(moduleName))
277  continue
278 
279  #--------------------
280  if module.type_() == 'HLTEgammaL1MatchFilterRegional':
281  # L1 seed to supercluster match
282  self.__result.filters.append(self.makePSetForL1SeedToSuperClusterMatchFilter(moduleName))
283  continue
284 
285  #--------------------
286 
287  if module.type_() == "HLTEgammaEtFilter":
288  # minimum Et requirement
289  self.__result.filters.append(self.makePSetForEtFilter(moduleName))
290  continue
291 
292  #--------------------
293 
294  if module.type_() == "HLTElectronOneOEMinusOneOPFilterRegional":
295  self.__result.filters.append(self.makePSetForOneOEMinusOneOPFilter(moduleName))
296  continue
297 
298  #--------------------
299  if module.type_() == "HLTElectronPixelMatchFilter":
300  self.__result.filters.append(self.makePSetForPixelMatchFilter(moduleName))
301  continue
302 
303  #--------------------
304  # generic filters: the module types
305  # aren't enough, we must check on which
306  # input collections they filter on
307  #--------------------
308 
309  if module.type_() == "HLTEgammaGenericFilter":
310 
311  pset = self.makePSetForEgammaGenericFilter(module, moduleName)
312  if pset != None:
313  self.__result.filters.append(pset)
314  continue
315 
316  #--------------------
317 
318  if module.type_() == "HLTElectronGenericFilter":
319 
320  pset = self.makePSetForElectronGenericFilter(module, moduleName)
321  if pset != None:
322  self.__result.filters.append(pset)
323  continue
324 
325  #--------------------
326 

Member Data Documentation

◆ __result

EgammaHLTValidationUtils.EgammaDQMModuleMaker.__result
private

◆ path

EgammaHLTValidationUtils.EgammaDQMModuleMaker.path

◆ pathName

EgammaHLTValidationUtils.EgammaDQMModuleMaker.pathName

Definition at line 150 of file EgammaHLTValidationUtils.py.

◆ process

EgammaHLTValidationUtils.EgammaDQMModuleMaker.process

◆ processName

EgammaHLTValidationUtils.EgammaDQMModuleMaker.processName
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
DQMEDAnalyzer
Definition: DQMEDAnalyzer.h:39
submitPVValidationJobs.split
def split(sequence, size)
Definition: submitPVValidationJobs.py:352
str
#define str(s)
Definition: TestProcessor.cc:53
EgammaHLTValidationUtils.getProcessName
def getProcessName(pdgGen, requiredNumberOfGeneratedObjects)
Definition: EgammaHLTValidationUtils.py:21