CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
EgammaHLTValidationUtils.EgammaDQMModuleMaker Class Reference

Public Member Functions

def __init__
 

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

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.

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

Member Data Documentation

EgammaHLTValidationUtils.EgammaDQMModuleMaker.__result
private

Definition at line 178 of file EgammaHLTValidationUtils.py.

Referenced by selectionParser.selectionParser.numls(), pileupParser.pileupParser.numls(), csvLumibyLSParser.csvLumibyLSParser.numls(), selectionParser.selectionParser.numruns(), pileupParser.pileupParser.numruns(), csvLumibyLSParser.csvLumibyLSParser.numruns(), selectionParser.selectionParser.runsandls(), pileupParser.pileupParser.runsandls(), and csvLumibyLSParser.csvLumibyLSParser.runsandls().

EgammaHLTValidationUtils.EgammaDQMModuleMaker.path

Definition at line 152 of file EgammaHLTValidationUtils.py.

Referenced by python.rootplot.rootmath.Target.__repr__().

EgammaHLTValidationUtils.EgammaDQMModuleMaker.pathName

Definition at line 150 of file EgammaHLTValidationUtils.py.

EgammaHLTValidationUtils.EgammaDQMModuleMaker.process

Definition at line 149 of file EgammaHLTValidationUtils.py.

Referenced by adaptToRunAtMiniAOD.adaptToRunAtMiniAOD.convertModuleToMiniAODInput(), runTauIdMVA.TauIDEmbedder.processDeepProducer(), runTauIdMVA.TauIDEmbedder.runTauID(), and runTauIdMVA.TauIDEmbedder.tauIDMVAinputs().

EgammaHLTValidationUtils.EgammaDQMModuleMaker.processName

Definition at line 155 of file EgammaHLTValidationUtils.py.

Referenced by core.TriggerBitFilter.TriggerBitFilter.declareHandles(), core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.declareHandles(), and core.TriggerBitAnalyzer.TriggerBitAnalyzer.declareHandles().