1 import FWCore.ParameterSet.Config
as cms
2 from functools
import reduce
11 if not use_new_method:
26 samples.names = [
'Wenu',
60 paths.Zee = paths.Wenu + [
88 pathlumi = {
'HLT_Ele17_SW_TighterEleIdIsol_L1RDQM':
'8e29',
89 'HLT_Ele10_LW_L1RDQM':
'8e29',
90 'HLT_Ele15_SW_L1RDQM':
'1e31',
91 'HLT_Ele10_LW_EleId_L1RDQM':
'8e29',
92 'HLT_Ele15_SiStrip_L1RDQM':
'8e29',
93 'HLT_DoubleEle5_SW_L1RDQM':
'8e29',
94 'HLT_Photon10_L1R_DQM':
'8e29',
95 'HLT_Photon15_TrackIso_L1R_DQM':
'8e29',
96 'HLT_Photon15_LooseEcalIso_L1R_DQM':
'8e29',
97 'HLT_Photon20_Cleaned_L1R_DQM':
'8e29',
98 'HLT_DoublePhoton10_L1R_DQM':
'8e29',
99 'HLT_Photon25_L1R_DQM':
'1e31',
100 'HLT_Photon25_LooseEcalIso_TrackIso_L1R_DQM':
'1e31'}
103 for path
in paths.Wenu + paths.Zee + paths.GammaJet + paths.DiGamma:
104 pathlumi[path] =
'8e29'
106 lumiprocess = {
'8e29':
'HLT',
115 genp = cms.EDFilter(
"PdgIdAndStatusCandViewSelector",
116 status = cms.vint32(3),
117 src = cms.InputTag(
"genParticles"),
118 pdgId = cms.vint32(11)
121 fiducial = cms.EDFilter(
"EtaPtMinCandViewSelector",
122 src = cms.InputTag(
"genp"),
123 etaMin = cms.double(-2.5),
124 etaMax = cms.double(2.5),
125 ptMin = cms.double(2.0)
132 tmp = cms.SequencePlaceholder(
"tmp")
133 egammaSelectors = cms.Sequence(tmp)
134 egammaValidators= cms.Sequence(tmp)
137 for samplenum
in range(len(samples.names)):
140 genpartname =
"genpart"+samples.names[samplenum]
141 globals()[genpartname] = genp.clone()
142 setattr(globals()[genpartname],
"pdgId",cms.vint32(samples.pdgid[samplenum]) )
143 egammaSelectors *= globals()[genpartname]
146 fiducialname =
"fiducial"+samples.names[samplenum]
147 globals()[fiducialname] = fiducial.clone()
148 setattr(globals()[fiducialname],
"src",cms.InputTag(genpartname) )
149 egammaSelectors *= globals()[fiducialname]
152 for trig
in getattr(paths,samples.names[samplenum]):
153 trigname = trig + samples.names[samplenum]
155 filename =
"HLTriggerOffline.Egamma."+trig+
"_cfi"
156 trigdef =__import__( filename )
158 globals()[trigname] = getattr(sys.modules[filename],trig).
clone()
159 setattr(globals()[trigname],
"cutcollection",cms.InputTag(fiducialname))
160 setattr(globals()[trigname],
"cutnum",cms.int32( samples.num[samplenum] ))
161 setattr(globals()[trigname],
"pdgGen",cms.int32( samples.pdgid[samplenum]))
162 getattr(globals()[trigname],
'triggerobject').setProcessName( lumiprocess[pathlumi[trig]] )
163 for filterpset
in getattr(globals()[trigname],
'filters'):
164 getattr(filterpset,
'HLTCollectionLabels').setProcessName( lumiprocess[pathlumi[trig]] )
165 for isocollections
in getattr(filterpset,
'IsoCollections'):
166 isocollections.setProcessName( lumiprocess[pathlumi[trig]])
168 egammaValidators *= globals()[trigname]
171 egammaSelectors.remove(tmp)
172 egammaValidators.remove(tmp)
175 egammaValidationSequence = cms.Sequence( egammaValidators )
185 msgPrefix =
"[" + os.path.basename(__file__) +
"]"
187 import HLTriggerOffline.Egamma.EgammaHLTValidationUtils
as EgammaHLTValidationUtils
193 "singleElectron": {
"genPid" : 11,
"numGenerated" : 1,},
194 "doubleElectron": {
"genPid" : 11,
"numGenerated" : 2 },
195 "singlePhoton": {
"genPid" : 22,
"numGenerated" : 1 },
196 "doublePhoton": {
"genPid" : 22,
"numGenerated" : 2 },
207 for hltPathCategory, thisCategoryData
in six.iteritems(configData):
214 thisCategoryData[
'genPid'],
215 thisCategoryData[
'numGenerated'])
221 globals()[module.label_()] = module
228 egammaSelectors.append(generatorRequirementSequence)
234 egammaValidators = []
235 egammaValidatorsFS = []
237 for isFastSim, validators
in (
238 (
False, egammaValidators),
239 (
True, egammaValidatorsFS),
245 refProcess = cms.Process(
"REF")
248 refProcess.load(
"FastSimulation.Configuration.HLT_GRun_cff")
250 refProcess.load(
"HLTrigger.Configuration.HLT_GRun_cff")
256 for hltPathCategory, thisCategoryData
in six.iteritems(configData):
259 paths = pathsByCategory[hltPathCategory]
270 pathName = path.label_()
281 hasProblematicType =
False
283 for problematicType
in [
285 'HLTEgammaTriggerFilterObjectWrapper',
286 'EgammaHLTPhotonTrackIsolationProducersRegional',
289 if problematicType
in moduleCXXtypes:
291 hasProblematicType =
True
294 if hasProblematicType:
299 dqmModuleName = pathName
301 dqmModuleName = dqmModuleName +
"FastSim"
303 dqmModuleName = dqmModuleName +
"_DQM"
306 thisCategoryData[
'genPid'],
307 thisCategoryData[
'numGenerated']
311 globals()[dqmModuleName] = dqmModule
314 validators.append(dqmModule)
336 egammaSelectors = cms.Sequence(reduce(operator.mul, egammaSelectors))
339 egammaValidationSequence = cms.Sequence(reduce(operator.mul, egammaValidators))
340 egammaValidationSequenceFS = cms.Sequence(reduce(operator.mul, egammaValidatorsFS))