CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 125 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 131 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  """
149  self.process = process
150  self.pathName = pathName
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  self.__result = cms.EDAnalyzer("EmDQM",
178  triggerobject = cms.InputTag("hltTriggerSummaryRAW","","HLT"),
179  genEtaAcc = cms.double(2.5),
180  genEtAcc = cms.double(2.0),
181  reqNum = cms.uint32(requiredNumberOfGeneratedObjects),
182  filters = cms.VPSet(), # will be added later
183  PtMax = cms.untracked.double(100.0),
184  genEtMin = cms.untracked.double(etThreshold),
185  pdgGen = cms.int32(pdgGen),
186  cutcollection = cms.InputTag(cutCollection),
187 
188  # is this a requirement on reconstructed or generated number of objects ?
189  cutnum = cms.int32(requiredNumberOfGeneratedObjects),
190 
191 
192 
193  )
194 
195  #--------------------
196  # get all modules of this path.
197  # dirty hack: assumes that all modules
198  # are concatenated by '+'
199  # but easier than to use a node visitor
200  # and order the modules ourselves afterwards..
201 
202  moduleNames = str(self.path).split('+')
203 
204  # now find out which of these are EDFilters
205  # and what CMSSW class type they are
206 
207  # example:
208  #
209  # CMSSW type module name
210  # --------------------------------------------------------------------------------------------------------------------
211  # HLTTriggerTypeFilter hltTriggerType
212  # HLTLevel1GTSeed hltL1sL1SingleEG8
213  # HLTPrescaler hltPreEle17SWTighterEleIdIsolL1R
214  # HLTEgammaL1MatchFilterRegional hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolL1MatchFilterRegional
215  # HLTEgammaEtFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolEtFilter
216  # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolR9ShapeFilter
217  # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolClusterShapeFilter
218  # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TIghterEleIdIsolEcalIsolFilter
219  # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolHEFilter
220  # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolHcalIsolFilter
221  # HLTElectronPixelMatchFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolPixelMatchFilter
222  # HLTElectronOneOEMinusOneOPFilterRegional hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolOneOEMinusOneOPFilter
223  # HLTElectronGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolDetaFilter
224  # HLTElectronGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolDphiFilter
225  # HLTElectronGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolTrackIsolFilter
226  # HLTBool hltBoolEnd
227 
228  # it looks like in the MC menu, all modules have a name containing 'L1NonIso' and then
229  # have a parameter IsoCollections (which is mostly cms.Input("none")...)
230 
231  import FWCore.ParameterSet.Modules
232 
233  for moduleName in moduleNames:
234 
235  # add protection to avoid accessing non-existing modules
236  # (not understood why this is needed but happens
237  # in some cases...).
238  #
239  # should also cover the special cases listed afterwards
240  # (i.e. the check after this one could be removed
241  # at some point)
242  if not hasattr(self.process, moduleName):
243  continue
244 
245  # protection for FastSim HLT menu
246  # which seems to reference certain modules in some
247  # paths but these modules are not defined when just
248  # loading the HLT menu into a process object.
249  #
250  # this seems not to happen for the fullsim menu for some
251  # reason...
252  if moduleName in ('simulation',
253  'offlineBeamSpot',
254  'HLTEndSequence'):
255  continue
256 
257 
258 
259  module = getattr(self.process,moduleName)
260 
261  if not isinstance(module, FWCore.ParameterSet.Modules.EDFilter):
262  continue
263 
264  # ignore certain EDFilters
265  if module.type_() in ('HLTTriggerTypeFilter',
266  'HLTPrescaler',
267  'HLTBool'):
268  continue
269 
270  # print "XX", module.type_(), moduleName
271 
272  #--------------------
273  if module.type_() == 'HLTLevel1GTSeed':
274  # L1 seed
275  self.__result.filters.append(self.makePSetForL1SeedFilter(moduleName))
276  continue
277 
278  #--------------------
279  if module.type_() == 'HLTEgammaL1MatchFilterRegional':
280  # L1 seed to supercluster match
281  self.__result.filters.append(self.makePSetForL1SeedToSuperClusterMatchFilter(moduleName))
282  continue
283 
284  #--------------------
285 
286  if module.type_() == "HLTEgammaEtFilter":
287  # minimum Et requirement
288  self.__result.filters.append(self.makePSetForEtFilter(moduleName))
289  continue
290 
291  #--------------------
292 
293  if module.type_() == "HLTElectronOneOEMinusOneOPFilterRegional":
294  self.__result.filters.append(self.makePSetForOneOEMinusOneOPFilter(moduleName))
295  continue
296 
297  #--------------------
298  if module.type_() == "HLTElectronPixelMatchFilter":
299  self.__result.filters.append(self.makePSetForPixelMatchFilter(moduleName))
300  continue
301 
302  #--------------------
303  # generic filters: the module types
304  # aren't enough, we must check on which
305  # input collections they filter on
306  #--------------------
307 
308  if module.type_() == "HLTEgammaGenericFilter":
309 
310  pset = self.makePSetForEgammaGenericFilter(module, moduleName)
311  if pset != None:
312  self.__result.filters.append(pset)
313  continue
314 
315  #--------------------
316 
317  if module.type_() == "HLTElectronGenericFilter":
318 
319  pset = self.makePSetForElectronGenericFilter(module, moduleName)
320  if pset != None:
321  self.__result.filters.append(pset)
322  continue
323 
324  #--------------------
double split
Definition: MVATrainer.cc:139

Member Data Documentation

EgammaHLTValidationUtils.EgammaDQMModuleMaker.__result
private

Definition at line 176 of file EgammaHLTValidationUtils.py.

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

EgammaHLTValidationUtils.EgammaDQMModuleMaker.path

Definition at line 151 of file EgammaHLTValidationUtils.py.

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

EgammaHLTValidationUtils.EgammaDQMModuleMaker.pathName

Definition at line 149 of file EgammaHLTValidationUtils.py.

EgammaHLTValidationUtils.EgammaDQMModuleMaker.process

Definition at line 148 of file EgammaHLTValidationUtils.py.

Referenced by ConfigBuilder.ConfigBuilder.__init__(), ConfigBuilder.ConfigBuilder.addExtraStream(), ConfigBuilder.ConfigBuilder.anyOf(), ConfigBuilder.ConfigBuilder.completeInputCommand(), ConfigBuilder.ConfigBuilder.doNotInlineEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.dumpPython(), ConfigBuilder.ConfigBuilder.PrintAllModules.leave(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.open(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.outputEventContent(), ConfigBuilder.ConfigBuilder.prepare(), ConfigBuilder.ConfigBuilder.prepare_ALCA(), ConfigBuilder.ConfigBuilder.prepare_DQM(), ConfigBuilder.ConfigBuilder.prepare_FASTSIM(), ConfigBuilder.ConfigBuilder.prepare_HARVESTING(), ConfigBuilder.ConfigBuilder.prepare_HLT(), ConfigBuilder.ConfigBuilder.prepare_LHE(), ConfigBuilder.ConfigBuilder.prepare_VALIDATION(), ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder.renameInputTagsInSequence(), ConfigBuilder.ConfigBuilder.scheduleSequence(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.setProcess(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.setProperty().

EgammaHLTValidationUtils.EgammaDQMModuleMaker.processName

Definition at line 154 of file EgammaHLTValidationUtils.py.

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