def makeOnePath(path, isFastSim): """ given a path object, returns the python text to be written to a _cff.py file""" # name of the HLT path pathName = path.label_() # we currently exclude a few 'problematic' paths (for which we # don't have a full recipe how to produce a monitoring path # for them). # # we exclude paths which contain EDFilters which we don't know # how to handle in the DQM modules moduleCXXtypes = EgammaHLTValidationUtils.getCXXTypesOfPath( refProcess, path) # print >> sys.stderr,"module types:", moduleCXXtypes hasProblematicType = False for problematicType in [ # this list was collected empirically 'HLTEgammaTriggerFilterObjectWrapper', 'EgammaHLTPhotonTrackIsolationProducersRegional', ]: if problematicType in moduleCXXtypes: print(msgPrefix + "SKIPPING PATH", pathName, "BECAUSE DON'T KNOW HOW TO HANDLE A MODULE WITH C++ TYPE", problematicType, file=sys.stderr) return None # print >> sys.stderr,msgPrefix, "adding E/gamma HLT dqm module for path",pathName dqmModuleName = pathName if isFastSim: dqmModuleName = dqmModuleName + "FastSim" dqmModuleName = dqmModuleName + "_DQM" # global dqmModule dqmModule = EgammaHLTValidationUtils.EgammaDQMModuleMaker( refProcess, pathName, thisCategoryData['genPid'], # type of generated particle thisCategoryData['numGenerated'] # number of generated particles ).getResult() return dqmModuleName + " = " + repr(dqmModule)
def makeOnePath(path, isFastSim): """ given a path object, returns the python text to be written to a _cff.py file""" # name of the HLT path pathName = path.label_() # we currently exclude a few 'problematic' paths (for which we # don't have a full recipe how to produce a monitoring path # for them). # # we exclude paths which contain EDFilters which we don't know # how to handle in the DQM modules moduleCXXtypes = EgammaHLTValidationUtils.getCXXTypesOfPath(refProcess,path) # print >> sys.stderr,"module types:", moduleCXXtypes hasProblematicType = False for problematicType in [ # this list was collected empirically 'HLTEgammaTriggerFilterObjectWrapper', 'EgammaHLTPhotonTrackIsolationProducersRegional', ]: if problematicType in moduleCXXtypes: print >> sys.stderr,msgPrefix + "SKIPPING PATH",pathName,"BECAUSE DON'T KNOW HOW TO HANDLE A MODULE WITH C++ TYPE",problematicType return None # print >> sys.stderr,msgPrefix, "adding E/gamma HLT dqm module for path",pathName dqmModuleName = pathName if isFastSim: dqmModuleName = dqmModuleName + "FastSim" dqmModuleName = dqmModuleName + "_DQM" # global dqmModule dqmModule = EgammaHLTValidationUtils.EgammaDQMModuleMaker(refProcess, pathName, thisCategoryData['genPid'], # type of generated particle thisCategoryData['numGenerated'] # number of generated particles ).getResult() return dqmModuleName + " = " + repr(dqmModule)
#---------------------------------------- # generate generator level selection modules # # note that this is common between full and # fast simulation #---------------------------------------- egammaSelectors = [] for hltPathCategory, thisCategoryData in configData.iteritems(): # all paths in the current category share the same # generator level requirement # # add a sequence for this generator level requirement generatorRequirementSequence = EgammaHLTValidationUtils.makeGeneratedParticleAndFiducialVolumeFilter(None, thisCategoryData['genPid'], thisCategoryData['numGenerated']) # dirty hack: get all modules of this sequence and add them # to globals() (which is not the same as calling globals() in makeGeneratedParticleAndFiducialVolumeFilter) # so that they will be added to the process for module in EgammaHLTValidationUtils.getModulesOfSequence(generatorRequirementSequence): globals()[module.label_()] = module # avoid that this variable is added to the process object when importing this _cff # (otherwise the last filter will appear with module name 'module' instead # of the name given by us...) del module egammaSelectors.append(generatorRequirementSequence)
# a 'reference' process to take (and analyze) the HLT menu from refProcess = cms.Process("REF") refProcess.load("HLTrigger.Configuration.HLT_GRun_cff") process.dqmModule = EgammaHLTValidationUtils.EgammaDQMModuleMaker(refProcess, pathToTest, 11, # type of generated particle 1 # number of generated particles ).getResult() del refProcess process.dqmPath = cms.Path( # creates the sequence for requiring the number and type of generated particles EgammaHLTValidationUtils.makeGeneratedParticleAndFiducialVolumeFilter(process, 11, 1) * process.dqmModule) #---------------------------------------- # E/gamma HLT specific DQM configuration #---------------------------------------- process.post=DQMEDProducer("EmDQMPostProcessor", subDir = cms.untracked.string("HLT/HLTEgammaValidation"), dataSet = cms.untracked.string("unknown"), ) #---------------------------------------- # add DQM configuration #----------------------------------------
process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(-1)) #---------------------------------------- # add the modules we want to test # (producing the DQM histograms) #---------------------------------------- import HLTriggerOffline.Egamma.EgammaHLTValidationUtils as EgammaHLTValidationUtils # a 'reference' process to take (and analyze) the HLT menu from refProcess = cms.Process("REF") refProcess.load("HLTrigger.Configuration.HLT_GRun_cff") process.dqmModule = EgammaHLTValidationUtils.EgammaDQMModuleMaker( refProcess, pathToTest, 11, # type of generated particle 1 # number of generated particles ).getResult() del refProcess process.dqmPath = cms.Path( # creates the sequence for requiring the number and type of generated particles EgammaHLTValidationUtils.makeGeneratedParticleAndFiducialVolumeFilter( process, 11, 1) * process.dqmModule) #---------------------------------------- # E/gamma HLT specific DQM configuration #----------------------------------------
pathToPythonText = {} #-------------------- # a 'reference' process to take (and analyze) the HLT menu from #-------------------- refProcess = cms.Process("REF") if isFastSim: refProcess.load("FastSimulation.Configuration.HLT_GRun_cff") else: refProcess.load("HLTrigger.Configuration.HLT_GRun_cff") #-------------------- pathsByCategory = EgammaHLTValidationUtils.findEgammaPaths(refProcess) os.mkdir(outputDir) allPathsWritten = [] for hltPathCategory, thisCategoryData in configData.iteritems(): # get the HLT path objects for this category paths = pathsByCategory[hltPathCategory] # fix: if there are no paths for some reason, # provide some dummy objects which we can delete # after the loop over the paths path = None
pathToPythonText = {} #-------------------- # a 'reference' process to take (and analyze) the HLT menu from #-------------------- refProcess = cms.Process("REF") if isFastSim: refProcess.load("FastSimulation.Configuration.HLT_GRun_cff") else: refProcess.load("HLTrigger.Configuration.HLT_GRun_cff") #-------------------- pathsByCategory = EgammaHLTValidationUtils.findEgammaPaths(refProcess) os.mkdir(outputDir) allPathsWritten = [] for hltPathCategory, thisCategoryData in six.iteritems(configData): # get the HLT path objects for this category paths = pathsByCategory[hltPathCategory] # fix: if there are no paths for some reason, # provide some dummy objects which we can delete # after the loop over the paths path = None