CMS 3D CMS Logo

EgammaHLTValidationUtils.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import FWCore.ParameterSet.Config as cms
3 import sys, os, re
4 
5 # prefix for printouts
6 msgPrefix = "[" + os.path.basename(__file__) + "]"
7 
8 
9 #----------------------------------------------------------------------
10 
11 def getPathsOfDataSet(process, datasetName):
12  """ returns the names of the trigger paths contained in the
13  given (primary) dataset """
14 
15  return list(getattr(process.datasets, datasetName))
16 
17 #----------------------------------------------------------------------
18 
19 
20 def getProcessName(pdgGen, requiredNumberOfGeneratedObjects):
21  """ returns a process name (such as 'Zee') which can be
22  used in various places (e.g. module names etc.) """
23 
24  if pdgGen == 11:
25 
26  # electron paths
27  if requiredNumberOfGeneratedObjects == 1:
28  return "Wenu"
29  elif requiredNumberOfGeneratedObjects == 2:
30  return "Zee"
31  else:
32  raise Exception("unsupported case, can't guess type of process")
33 
34  elif pdgGen == 22:
35 
36  # photon paths
37  if requiredNumberOfGeneratedObjects == 1:
38  return 'GammaJet'
39  elif requiredNumberOfGeneratedObjects == 2:
40  return 'DiGamma'
41  else:
42  raise Exception("unsupported case, can't guess type of process")
43  else:
44  raise Exception("unsupported case, can't guess type of process")
45 
46 
47 #----------------------------------------------------------------------
48 
49 def makeGeneratedParticleAndFiducialVolumeFilter(process, pdgGen, requiredNumberOfGeneratedObjects):
50  """
51  adds the needed modules to the process object and
52  returns a sequence made of the two filters.
53 
54  returns the name of the created module
55 
56  if process is not None, are added to the process.
57 
58  When using this function from a _cff file, one
59  has to manually add the modules of the returned
60  sequence to globals() (in the calling module, not
61  here, globals() live in a different name space here)
62 
63  """
64 
65  # name of the physics process
66  procName = getProcessName(pdgGen, requiredNumberOfGeneratedObjects)
67 
68  #--------------------
69  # create a module producing a collection with the
70  # desired generated particles
71  #--------------------
72 
73  genPartModuleName = 'genpart' + procName
74 
75 
76  genPartModule = cms.EDFilter("PdgIdAndStatusCandViewSelector",
77  status = cms.vint32(3),
78  src = cms.InputTag("genParticles"),
79  pdgId = cms.vint32(pdgGen),
80  )
81 
82  # genPartModule.setLabel(genPartModuleName)
83  if process != None:
84  setattr(process, genPartModuleName, genPartModule)
85 
86  genPartModule.setLabel(genPartModuleName)
87 
88  #--------------------
89  # create a module requiring the number
90  # of generated particles
91  #--------------------
92 
93  selectorModuleName = "fiducial" + procName
94 
95  selectorModule = cms.EDFilter("EtaPtMinCandViewSelector",
96  src = cms.InputTag(genPartModuleName),
97  etaMin = cms.double(-2.5),
98  etaMax = cms.double(2.5),
99  ptMin = cms.double(2.0)
100  )
101 
102  if process != None:
103  setattr(process, selectorModuleName, selectorModule)
104 
105  # this is needed if we don't have a process to attach this module to
106  selectorModule.setLabel(selectorModuleName)
107 
108  #--------------------
109  # create the sequence
110  #--------------------
111 
112  return cms.Sequence(
113  # getattr(process, genPartModuleName)
114  genPartModule
115 
116  *
117 
118  # getattr(process, selectorModuleName)
119  selectorModule
120  )
121 #----------------------------------------------------------------------
122 
123 import HLTriggerOffline.Egamma.TriggerTypeDefs_cfi as TriggerTypeDefs_cfi
124 
126  """ a class which can be used to produce an analysis path
127  for the EmDQM analyzer """
128 
129  #----------------------------------------
130 
131  def __init__(self, process, pathName, pdgGen, requiredNumberOfGeneratedObjects, cutCollection = None):
132  """
133  pathName is the HLT path to be validated.
134 
135  pdgGen is the PDG id of the corersponding generated particles
136  (11 for electrons, 22 for photons)
137 
138  requiredNumberOfGeneratedObjects should be 1 for single triggers,
139  and 2 for double triggers (e.g. double photon triggers)
140 
141  cutCollection is the name of the collection which should be used
142  to define the acceptance region (at reconstruction level ?).
143  typical values are 'fiducialZee'. If this is set to None,
144  will be determined automatically from pdgGen and requiredNumberOfGeneratedObjects
145 
146  """
147 
148  self.process = process
149  self.pathName = pathName
150 
151  self.path = getattr(process,pathName)
152 
153  # the process whose products should be analyzed
154  self.processName = "HLT"
155 
156  #--------------------
157  # guess the collection for the fiducial volume cut
158  #--------------------
159 
160  if cutCollection == None:
161  cutCollection = "fiducial" + getProcessName(pdgGen, requiredNumberOfGeneratedObjects)
162 
163  #--------------------
164  # find Et threshold of primary object
165  #--------------------
166  mo = re.match("HLT_.*?(\d+).*",pathName)
167 
168  if mo != None:
169  etThreshold = float(mo.group(1))
170  else:
171  etThreshold = -1.0
172 
173  #--------------------
174  # initialize the analyzer we put together here
175  #--------------------
176  from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
177  self.__result = DQMEDAnalyzer('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  #--------------------
325 
326 ## print >> sys.stderr,msgPrefix,"WARNING: unknown module type", module.type_(), " with name " + moduleName + " in path " + pathName
327 
328  #----------------------------------------
329 
330  def makePSetForL1SeedFilter(self,moduleName):
331  """ generates a PSet to analyze the behaviour of an L1 seed.
332 
333  moduleName is the name of the HLT module which filters
334  on the L1 seed.
335  """
336 
337  return cms.PSet(
338  PlotBounds = cms.vdouble(0.0, 0.0),
339  HLTCollectionLabels = cms.InputTag(moduleName,"",self.processName),
340  IsoCollections = cms.VInputTag(cms.InputTag("none")),
341  theHLTOutputTypes = cms.int32(TriggerTypeDefs_cfi.TriggerL1NoIsoEG)
342  )
343 
344  #----------------------------------------
345 
347  """ generates a PSet to analyze the behaviour of L1 to supercluster match filter.
348 
349  moduleName is the name of the HLT module which requires the match
350  between supercluster and L1 seed.
351  """
352 
353  return cms.PSet(
354  PlotBounds = cms.vdouble(0.0, 0.0),
355  HLTCollectionLabels = cms.InputTag(moduleName,"",self.processName),
356  IsoCollections = cms.VInputTag(cms.InputTag("none")),
357  theHLTOutputTypes = cms.int32(TriggerTypeDefs_cfi.TriggerCluster)
358  )
359 
360  #----------------------------------------
361 
362  def makePSetForEtFilter(self, moduleName):
363  """ generates a PSet for the Egamma DQM analyzer for the Et filter """
364 
365  return cms.PSet(
366  PlotBounds = cms.vdouble(0.0, 0.0),
367  HLTCollectionLabels = cms.InputTag(moduleName,"",self.processName),
368  IsoCollections = cms.VInputTag(cms.InputTag("none")),
369  theHLTOutputTypes = cms.int32(TriggerTypeDefs_cfi.TriggerCluster)
370  )
371 
372  #----------------------------------------
373 
374  def makePSetForOneOEMinusOneOPFilter(self, moduleName):
375 
376  return cms.PSet(
377  PlotBounds = cms.vdouble(0.0, 0.0),
378  HLTCollectionLabels = cms.InputTag(moduleName,"",self.processName),
379  IsoCollections = cms.VInputTag(cms.InputTag("none")),
380  theHLTOutputTypes = cms.int32(TriggerTypeDefs_cfi.TriggerElectron)
381  )
382 
383  #----------------------------------------
384 
385  def makePSetForPixelMatchFilter(self, moduleName):
386  return cms.PSet(
387  PlotBounds = cms.vdouble(0.0, 0.0),
388  HLTCollectionLabels = cms.InputTag(moduleName,"",self.processName),
389  IsoCollections = cms.VInputTag(cms.InputTag("none")),
390  theHLTOutputTypes = cms.int32(TriggerTypeDefs_cfi.TriggerCluster)
391  )
392 
393  #----------------------------------------
394 
395  def makePSetForEgammaGenericFilter(self, module, moduleName):
396 
397  # example usages of HLTEgammaGenericFilter are:
398  # R9 shape filter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolR9ShapeFilter
399  # cluster shape filter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolClusterShapeFilter
400  # Ecal isolation filter hltL1NonIsoHLTNonIsoSingleElectronEt17TIghterEleIdIsolEcalIsolFilter
401  # H/E filter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolHEFilter
402  # HCAL isolation filter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolHcalIsolFilter
403 
404  # the type of object to look for seems to be the
405  # same for all uses of HLTEgammaGenericFilter
406  theHLTOutputTypes = cms.int32(TriggerTypeDefs_cfi.TriggerCluster)
407 
408  # infer the type of filter by the type of the producer which
409  # generates the collection used to cut on this
410  inputCollectionLabel = module.isoTag.moduleLabel
411 
412  inputType = getattr(self.process, inputCollectionLabel).type_()
413  # print >> sys.stderr, "inputType=",inputType,moduleName
414 
415  #--------------------
416  # sanity check: non-isolated path should be produced by the
417  # same type of module
418  #
419  # first check that the non-iso tag is non-empty
420  assert(module.nonIsoTag.moduleLabel != "")
421 
422  assert(inputType == getattr(self.process, module.nonIsoTag.moduleLabel).type_())
423 
424  #--------------------
425 
426 
427  # the following cases seem to have identical PSets ?
428 
429  #--------------------
430  # R9 shape
431  #--------------------
432 
433  if inputType == 'EgammaHLTR9Producer':
434  return cms.PSet(
435  PlotBounds = cms.vdouble(0.0, 0.0),
436  HLTCollectionLabels = cms.InputTag(moduleName,"",self.processName),
437  IsoCollections = cms.VInputTag(module.isoTag, module.nonIsoTag),
438  theHLTOutputTypes = theHLTOutputTypes
439  )
440 
441  #--------------------
442  # cluster shape
443  #--------------------
444  if inputType == 'EgammaHLTClusterShapeProducer':
445  return cms.PSet(
446  PlotBounds = cms.vdouble(0.0, 0.0),
447  HLTCollectionLabels = cms.InputTag(moduleName,"",self.processName),
448  IsoCollections = cms.VInputTag(module.isoTag, module.nonIsoTag),
449  theHLTOutputTypes = theHLTOutputTypes
450  )
451 
452  #--------------------
453  # ecal isolation
454  #--------------------
455  if inputType == 'EgammaHLTEcalRecIsolationProducer':
456  return cms.PSet(
457  PlotBounds = cms.vdouble(0.0, 0.0),
458  HLTCollectionLabels = cms.InputTag(moduleName,"",self.processName),
459  IsoCollections = cms.VInputTag(module.isoTag, module.nonIsoTag),
460  theHLTOutputTypes = theHLTOutputTypes
461  )
462 
463  #--------------------
464  # HCAL isolation and HE
465  #--------------------
466 
467  if inputType == 'EgammaHLTHcalIsolationProducersRegional':
468  return cms.PSet(
469  PlotBounds = cms.vdouble(0.0, 0.0),
470  HLTCollectionLabels = cms.InputTag(moduleName,"",self.processName),
471  IsoCollections = cms.VInputTag(module.isoTag, module.nonIsoTag),
472  theHLTOutputTypes = theHLTOutputTypes
473  )
474 
475 
476  raise Exception("can't determine what the HLTEgammaGenericFilter '" + moduleName + "' should do: uses a collection produced by a module of C++ type '" + inputType + "'")
477 
478  #----------------------------------------
479 
480  def makePSetForElectronGenericFilter(self, module, moduleName):
481 
482  # example usages of HLTElectronGenericFilter are:
483 
484  # deta filter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolDetaFilter
485  # dphi filter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolDphiFilter
486  # track isolation hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolTrackIsolFilter
487 
488  # the type of object to look for seems to be the
489  # same for all uses of HLTEgammaGenericFilter
490  theHLTOutputTypes = cms.int32(TriggerTypeDefs_cfi.TriggerElectron)
491 
492  # infer the type of filter by the type of the producer which
493  # generates the collection used to cut on this
494  inputCollectionLabel = module.isoTag.moduleLabel
495 
496  inputType = getattr(self.process, inputCollectionLabel).type_()
497  # print >> sys.stderr, "inputType=",inputType,moduleName
498 
499  # sanity check: non-isolated path should be produced by the
500  # same type of module
501  assert(inputType == getattr(self.process, module.nonIsoTag.moduleLabel).type_())
502 
503  # the following cases seem to have identical PSets ?
504 
505  #--------------------
506  # deta and dphi filter
507  #--------------------
508 
509  # note that whether deta or dphi is used is determined from
510  # the product instance (not the module label)
511  if inputType == 'EgammaHLTElectronDetaDphiProducer':
512 
513  return cms.PSet(
514  PlotBounds = cms.vdouble(0.0, 0.0),
515  HLTCollectionLabels = cms.InputTag(moduleName,"",self.processName),
516  IsoCollections = cms.VInputTag(module.isoTag, module.nonIsoTag),
517  theHLTOutputTypes = theHLTOutputTypes
518  )
519 
520  #--------------------
521  # track isolation
522  #--------------------
523 
524  if inputType == 'EgammaHLTElectronTrackIsolationProducers':
525 
526  return cms.PSet(
527  PlotBounds = cms.vdouble(0.0, 0.0),
528  HLTCollectionLabels = cms.InputTag(moduleName,"",self.processName),
529  IsoCollections = cms.VInputTag(module.isoTag, module.nonIsoTag),
530  theHLTOutputTypes = theHLTOutputTypes
531  )
532  raise Exception("can't determine what the HLTElectronGenericFilter '" + moduleName + "' should do: uses a collection produced by a module of C++ type '" + inputType + "'")
533 
534  #----------------------------------------
535 
536  def getResult(self):
537  """ returns the composed analyzer module """
538  return self.__result
539 
540  #----------------------------------------
541 
542 #----------------------------------------------------------------------
543 # main
544 #----------------------------------------------------------------------
545 if __name__ == "__main__":
546 
547  import FWCore.ParameterSet.Config as cms
548  process = cms.Process("MYTEST")
549  process.load("HLTrigger.Configuration.HLT_GRun_cff")
550 
551  moduleMaker = EgammaDQMModuleMaker(process, "HLT_Ele17_SW_TighterEleIdIsol_L1R_v3", 11, 1)
552 
553  # print "# ----------------------------------------------------------------------"
554 
555  print moduleMaker.getResult().dumpPython()
556 
557 #----------------------------------------------------------------------
558 
559 def findEgammaPaths(process):
560  """
561  returns a dict:
562 
563  {
564  "singleElectron": [ list of single electron path objects ],
565  "doubleElectron": [ list of double electron path objects ],
566  "singlePhoton": [ list of single photon path objects ],
567  "doublePhoton": [ list of double photon path objects ],
568  }
569 
570  Note that the elements in the lists are path objects, not path names.
571 
572  Note also that this is based on the name of the paths using some
573  heuristics.
574  """
575 
576  retval = { "singleElectron": [],
577  "doubleElectron": [],
578  "singlePhoton": [],
579  "doublePhoton": [],
580  }
581 
582  for path_name, path in process.paths.items():
583 
584  # print "XX",path_name.__class__,path.__class__
585 
586  if path_name.startswith("AlCa_"):
587  continue
588 
589  if path_name.startswith("DQM_"):
590  continue
591 
592  if not path_name.startswith("HLT_"):
593  continue
594 
595  if path_name.startswith("HLT_Ele"):
596  retval['singleElectron'].append(path)
597  continue
598 
599  if path_name.startswith("HLT_Photon"):
600  retval['singlePhoton'].append(path)
601  continue
602 
603  if path_name.startswith("HLT_DoublePhoton"):
604  retval['doublePhoton'].append(path)
605  continue
606 
607  if path_name.startswith("HLT_DoubleEle"):
608  retval['doubleElectron'].append(path)
609  continue
610 
611  # end of loop over paths
612  return retval
613 
614 #----------------------------------------------------------------------
615 
617  """ returns the names of the modules found in the given path.
618 
619  Note that these are not guaranteed to be in any particular
620  order.
621  """
622 
623  # this function could actually call getModulesOfSequence(..)
624  # and then produce a set with the unique names of
625  # the modules
626 
627  import FWCore.ParameterSet.Modules
628  class Visitor:
629 
630  #----------------------------------------
631  def __init__(self):
632  self.module_names_found = set()
633 
634  #----------------------------------------
635  def enter(self,visitee):
636 
637  if isinstance(visitee, FWCore.ParameterSet.Modules._Module):
638  self.module_names_found.add(visitee.label_())
639 
640  #----------------------------------------
641  def leave(self,visitee):
642  pass
643 
644  #----------------------------------------
645 
646  visitor = Visitor()
647  path.visit(visitor)
648 
649  return visitor.module_names_found
650 
651 
652 #----------------------------------------------------------------------
653 def getCXXTypesOfPath(process, path):
654  """ returns the names of (classes) of the C++ types of the modules
655  found in the given path (in no particular order) """
656 
657  moduleNames = getModuleNamesOfPath(path)
658 
659  retval = set()
660 
661  for name in moduleNames:
662 
663  # skip those modules which are in the path
664  # but not in the process object.
665  # not understood why we need to do this
666  # but seems to cause problems in practice...
667  if not hasattr(process,name):
668  continue
669 
670  module = getattr(process, name)
671 
672  retval.add(module.type_())
673 
674  return retval
675 
676 #----------------------------------------------------------------------
677 
678 def getModulesOfSequence(sequence):
679  """ returns the modules found in a sequence.
680 
681  Note that a module can appear more than once.
682  """
683 
684  import FWCore.ParameterSet.Modules
685  class Visitor:
686 
687  #----------------------------------------
688  def __init__(self):
689  self.modules_found = []
690 
691  #----------------------------------------
692  def enter(self,visitee):
693 
694  if isinstance(visitee, FWCore.ParameterSet.Modules._Module):
695  self.modules_found.append(visitee)
696 
697  #----------------------------------------
698  def leave(self,visitee):
699  pass
700 
701  #----------------------------------------
702 
703  visitor = Visitor()
704  sequence.visitNode(visitor)
705 
706  return visitor.modules_found
707 
708 
709 #----------------------------------------------------------------------
def makePSetForL1SeedToSuperClusterMatchFilter(self, moduleName)
def makeGeneratedParticleAndFiducialVolumeFilter(process, pdgGen, requiredNumberOfGeneratedObjects)
def makePSetForEtFilter(self, moduleName)
def __init__(self, process, pathName, pdgGen, requiredNumberOfGeneratedObjects, cutCollection=None)
def makePSetForOneOEMinusOneOPFilter(self, moduleName)
def makePSetForEgammaGenericFilter(self, module, moduleName)
def getProcessName(pdgGen, requiredNumberOfGeneratedObjects)
def makePSetForPixelMatchFilter(self, moduleName)
def getPathsOfDataSet(process, datasetName)
def dumpPython(process, name)
def makePSetForElectronGenericFilter(self, module, moduleName)
#define str(s)
double split
Definition: MVATrainer.cc:139
def makePSetForL1SeedFilter(self, moduleName)
print >> sys.stderr,msgPrefix,"WARNING: unknown module type", module.type_(), " with name " + moduleN...
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run