Public Member Functions | |
def | __init__ |
Public Attributes | |
path | |
pathName | |
process | |
processName | |
Private Attributes | |
__result |
a class which can be used to produce an analysis path for the EmDQM analyzer
Definition at line 125 of file EgammaHLTValidationUtils.py.
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 # find Et threshold of primary object 00166 #-------------------- 00167 mo = re.match("HLT_.*?(\d+).*",pathName) 00168 00169 if mo != None: 00170 etThreshold = float(mo.group(1)) 00171 else: 00172 etThreshold = -1.0 00173 00174 #-------------------- 00175 # initialize the analyzer we put together here 00176 #-------------------- 00177 self.__result = cms.EDAnalyzer("EmDQM", 00178 triggerobject = cms.InputTag("hltTriggerSummaryRAW","","HLT"), 00179 genEtaAcc = cms.double(2.5), 00180 genEtAcc = cms.double(2.0), 00181 reqNum = cms.uint32(requiredNumberOfGeneratedObjects), 00182 filters = cms.VPSet(), # will be added later 00183 PtMax = cms.untracked.double(100.0), 00184 genEtMin = cms.untracked.double(etThreshold), 00185 pdgGen = cms.int32(pdgGen), 00186 cutcollection = cms.InputTag(cutCollection), 00187 00188 # is this a requirement on reconstructed or generated number of objects ? 00189 cutnum = cms.int32(requiredNumberOfGeneratedObjects), 00190 00191 00192 00193 ) 00194 00195 #-------------------- 00196 # get all modules of this path. 00197 # dirty hack: assumes that all modules 00198 # are concatenated by '+' 00199 # but easier than to use a node visitor 00200 # and order the modules ourselves afterwards.. 00201 00202 moduleNames = str(self.path).split('+') 00203 00204 # now find out which of these are EDFilters 00205 # and what CMSSW class type they are 00206 00207 # example: 00208 # 00209 # CMSSW type module name 00210 # -------------------------------------------------------------------------------------------------------------------- 00211 # HLTTriggerTypeFilter hltTriggerType 00212 # HLTLevel1GTSeed hltL1sL1SingleEG8 00213 # HLTPrescaler hltPreEle17SWTighterEleIdIsolL1R 00214 # HLTEgammaL1MatchFilterRegional hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolL1MatchFilterRegional 00215 # HLTEgammaEtFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolEtFilter 00216 # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolR9ShapeFilter 00217 # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolClusterShapeFilter 00218 # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TIghterEleIdIsolEcalIsolFilter 00219 # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolHEFilter 00220 # HLTEgammaGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolHcalIsolFilter 00221 # HLTElectronPixelMatchFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolPixelMatchFilter 00222 # HLTElectronOneOEMinusOneOPFilterRegional hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolOneOEMinusOneOPFilter 00223 # HLTElectronGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolDetaFilter 00224 # HLTElectronGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolDphiFilter 00225 # HLTElectronGenericFilter hltL1NonIsoHLTNonIsoSingleElectronEt17TighterEleIdIsolTrackIsolFilter 00226 # HLTBool hltBoolEnd 00227 00228 # it looks like in the MC menu, all modules have a name containing 'L1NonIso' and then 00229 # have a parameter IsoCollections (which is mostly cms.Input("none")...) 00230 00231 import FWCore.ParameterSet.Modules 00232 00233 for moduleName in moduleNames: 00234 00235 # add protection to avoid accessing non-existing modules 00236 # (not understood why this is needed but happens 00237 # in some cases...). 00238 # 00239 # should also cover the special cases listed afterwards 00240 # (i.e. the check after this one could be removed 00241 # at some point) 00242 if not hasattr(self.process, moduleName): 00243 continue 00244 00245 # protection for FastSim HLT menu 00246 # which seems to reference certain modules in some 00247 # paths but these modules are not defined when just 00248 # loading the HLT menu into a process object. 00249 # 00250 # this seems not to happen for the fullsim menu for some 00251 # reason... 00252 if moduleName in ('simulation', 00253 'offlineBeamSpot', 00254 'HLTEndSequence'): 00255 continue 00256 00257 00258 00259 module = getattr(self.process,moduleName) 00260 00261 if not isinstance(module, FWCore.ParameterSet.Modules.EDFilter): 00262 continue 00263 00264 # ignore certain EDFilters 00265 if module.type_() in ('HLTTriggerTypeFilter', 00266 'HLTPrescaler', 00267 'HLTBool'): 00268 continue 00269 00270 # print "XX", module.type_(), moduleName 00271 00272 #-------------------- 00273 if module.type_() == 'HLTLevel1GTSeed': 00274 # L1 seed 00275 self.__result.filters.append(self.makePSetForL1SeedFilter(moduleName)) 00276 continue 00277 00278 #-------------------- 00279 if module.type_() == 'HLTEgammaL1MatchFilterRegional': 00280 # L1 seed to supercluster match 00281 self.__result.filters.append(self.makePSetForL1SeedToSuperClusterMatchFilter(moduleName)) 00282 continue 00283 00284 #-------------------- 00285 00286 if module.type_() == "HLTEgammaEtFilter": 00287 # minimum Et requirement 00288 self.__result.filters.append(self.makePSetForEtFilter(moduleName)) 00289 continue 00290 00291 #-------------------- 00292 00293 if module.type_() == "HLTElectronOneOEMinusOneOPFilterRegional": 00294 self.__result.filters.append(self.makePSetForOneOEMinusOneOPFilter(moduleName)) 00295 continue 00296 00297 #-------------------- 00298 if module.type_() == "HLTElectronPixelMatchFilter": 00299 self.__result.filters.append(self.makePSetForPixelMatchFilter(moduleName)) 00300 continue 00301 00302 #-------------------- 00303 # generic filters: the module types 00304 # aren't enough, we must check on which 00305 # input collections they filter on 00306 #-------------------- 00307 00308 if module.type_() == "HLTEgammaGenericFilter": 00309 00310 pset = self.makePSetForEgammaGenericFilter(module, moduleName) 00311 if pset != None: 00312 self.__result.filters.append(pset) 00313 continue 00314 00315 #-------------------- 00316 00317 if module.type_() == "HLTElectronGenericFilter": 00318 00319 pset = self.makePSetForElectronGenericFilter(module, moduleName) 00320 if pset != None: 00321 self.__result.filters.append(pset) 00322 continue 00323 00324 #--------------------
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.