CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Attributes

EgammaHLTValidationUtils::EgammaDQMModuleMaker Class Reference

List of all members.

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.

00132                                                                                                          :
00133         """
00134         pathName is the HLT path to be validated.
00135 
00136         pdgGen is the PDG id of the corersponding generated particles
00137           (11 for electrons, 22 for photons)
00138 
00139         requiredNumberOfGeneratedObjects should be 1 for single triggers,
00140         and 2 for double triggers (e.g. double photon triggers)
00141 
00142         cutCollection is the name of the collection which should be used
00143           to define the acceptance region (at reconstruction level ?).
00144           typical values are 'fiducialZee'. If this is set to None,
00145           will be determined automatically from pdgGen and requiredNumberOfGeneratedObjects
00146 
00147         """
00148 
00149         self.process = process
00150         self.pathName = pathName
00151 
00152         self.path = getattr(process,pathName)
00153 
00154         # the process whose products should be analyzed
00155         self.processName = "HLT"
00156 
00157         #--------------------
00158         # guess the collection for the fiducial volume cut
00159         #--------------------
00160 
00161         if cutCollection == None:
00162             cutCollection = "fiducial" + getProcessName(pdgGen, requiredNumberOfGeneratedObjects)
00163 
00164         #--------------------
00165         # initialize the analyzer we put together here
00166         #--------------------
00167         self.__result = cms.EDAnalyzer("EmDQM",
00168                                      triggerobject = cms.InputTag("hltTriggerSummaryRAW","","HLT"),                            
00169                                      genEtaAcc = cms.double(2.5),
00170                                      genEtAcc = cms.double(2.0),
00171                                      reqNum = cms.uint32(requiredNumberOfGeneratedObjects),
00172                                      filters = cms.VPSet(), # will be added later
00173                                      PtMax = cms.untracked.double(100.0),
00174                                      pdgGen = cms.int32(pdgGen),
00175                                      cutcollection = cms.InputTag(cutCollection),
00176 
00177                                      # is this a requirement on reconstructed or generated number of objects ?
00178                                      cutnum = cms.int32(requiredNumberOfGeneratedObjects),
00179 
00180 
00181                                        
00182                                        )
00183 
00184         #--------------------
00185         # get all modules of this path.
00186         # dirty hack: assumes that all modules
00187         #   are concatenated by '+'
00188         # but easier than to use a node visitor
00189         # and order the modules ourselves afterwards..
00190 
00191         moduleNames = str(self.path).split('+')
00192 
00193         # now find out which of these are EDFilters
00194         # and what CMSSW class type they are
00195 
00196         # example:
00197         #
00198         # CMSSW type                               module name
00199         # --------------------------------------------------------------------------------------------------------------------
00200         # HLTTriggerTypeFilter                     hltTriggerType 
00201         # HLTLevel1GTSeed                          hltL1sL1SingleEG8 
00202         # HLTPrescaler                             hltPreEle17SWTighterEleIdIsolL1R 
00203         # HLTEgammaL1MatchFilterRegional           hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolL1MatchFilterRegional 
00204         # HLTEgammaEtFilter                        hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolEtFilter 
00205         # HLTEgammaGenericFilter                   hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolR9ShapeFilter 
00206         # HLTEgammaGenericFilter                   hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolClusterShapeFilter 
00207         # HLTEgammaGenericFilter                   hltL1NonIsoHLTNonIsoSingleElectronEt17TIghterEleIdIsolEcalIsolFilter 
00208         # HLTEgammaGenericFilter                   hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolHEFilter 
00209         # HLTEgammaGenericFilter                   hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolHcalIsolFilter 
00210         # HLTElectronPixelMatchFilter              hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolPixelMatchFilter 
00211         # HLTElectronOneOEMinusOneOPFilterRegional hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolOneOEMinusOneOPFilter 
00212         # HLTElectronGenericFilter                 hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolDetaFilter 
00213         # HLTElectronGenericFilter                 hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolDphiFilter 
00214         # HLTElectronGenericFilter                 hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolTrackIsolFilter 
00215         # HLTBool                                  hltBoolEnd 
00216 
00217         # it looks like in the MC menu, all modules have a name containing 'L1NonIso' and then
00218         # have a parameter IsoCollections (which is mostly cms.Input("none")...)
00219 
00220         import FWCore.ParameterSet.Modules
00221 
00222         for moduleName in moduleNames:
00223 
00224             # add protection to avoid accessing non-existing modules
00225             # (not understood why this is needed but happens
00226             # in some cases...).
00227             #
00228             # should also cover the special cases listed afterwards
00229             # (i.e. the check after this one could be removed
00230             # at some point)
00231             if not hasattr(self.process, moduleName):
00232                 continue
00233 
00234             # protection for FastSim HLT menu
00235             # which seems to reference certain modules in some
00236             # paths but these modules are not defined when just
00237             # loading the HLT menu into a process object.
00238             #
00239             # this seems not to happen for the fullsim menu for some
00240             # reason...
00241             if moduleName in ('simulation',
00242                               'offlineBeamSpot',
00243                               'HLTEndSequence'):
00244                 continue
00245 
00246             
00247 
00248             module = getattr(self.process,moduleName)
00249 
00250             if not isinstance(module, FWCore.ParameterSet.Modules.EDFilter):
00251                 continue
00252 
00253             # ignore certain EDFilters
00254             if module.type_() in ('HLTTriggerTypeFilter',
00255                                   'HLTPrescaler',
00256                                   'HLTBool'):
00257                 continue
00258 
00259             # print "XX", module.type_(), moduleName
00260 
00261             #--------------------
00262             if module.type_() == 'HLTLevel1GTSeed':
00263                 # L1 seed
00264                 self.__result.filters.append(self.makePSetForL1SeedFilter(moduleName))
00265                 continue
00266 
00267             #--------------------
00268             if module.type_() == 'HLTEgammaL1MatchFilterRegional':
00269                 # L1 seed to supercluster match
00270                 self.__result.filters.append(self.makePSetForL1SeedToSuperClusterMatchFilter(moduleName))
00271                 continue
00272 
00273             #--------------------
00274 
00275             if module.type_() == "HLTEgammaEtFilter":
00276                 # minimum Et requirement
00277                 self.__result.filters.append(self.makePSetForEtFilter(moduleName))
00278                 continue
00279 
00280             #--------------------
00281 
00282             if module.type_() == "HLTElectronOneOEMinusOneOPFilterRegional":
00283                 self.__result.filters.append(self.makePSetForOneOEMinusOneOPFilter(moduleName))
00284                 continue
00285 
00286             #--------------------
00287             if module.type_() == "HLTElectronPixelMatchFilter":
00288                 self.__result.filters.append(self.makePSetForPixelMatchFilter(moduleName))
00289                 continue
00290 
00291             #--------------------
00292             # generic filters: the module types
00293             # aren't enough, we must check on which
00294             # input collections they filter on
00295             #--------------------
00296 
00297             if module.type_() == "HLTEgammaGenericFilter":
00298 
00299                 pset = self.makePSetForEgammaGenericFilter(module, moduleName)
00300                 if pset != None:
00301                     self.__result.filters.append(pset)
00302                     continue
00303 
00304             #--------------------
00305 
00306             if module.type_() == "HLTElectronGenericFilter":
00307 
00308                 pset = self.makePSetForElectronGenericFilter(module, moduleName)
00309                 if pset != None:
00310                     self.__result.filters.append(pset)
00311                     continue
00312 
00313             #--------------------


Member Data Documentation

Definition at line 145 of file EgammaHLTValidationUtils.py.

Definition at line 145 of file EgammaHLTValidationUtils.py.

Definition at line 145 of file EgammaHLTValidationUtils.py.

Definition at line 145 of file EgammaHLTValidationUtils.py.

Definition at line 145 of file EgammaHLTValidationUtils.py.