12 """adapt the HLT to run on MC, instead of data
13 see Configuration/StandardSequences/Reconstruction_Data_cff.py
14 which does the opposite, for RECO"""
17 if 'hltParticleFlowRecHitHCAL' in process.__dict__:
18 process.hltParticleFlowRecHitHCAL.ApplyPulseDPG = cms.bool(
False)
19 process.hltParticleFlowRecHitHCAL.LongShortFibre_Cut = cms.double(1000000000.0)
23 fastsim = cms.ProcessFragment( process.name_() )
24 fastsim.load(
"FastSimulation.HighLevelTrigger.HLTSetup_cff" )
26 fastSimUnsupportedPaths = (
31 "HLT_*Calibration_v*",
36 "HLT_Activity_Ecal*_v*",
39 "HLT_L1SingleMuOpen_AntiBPTX_v*",
40 "HLT_JetE*_NoBPTX*_v*",
41 "HLT_L2Mu*_NoBPTX*_v*",
42 "HLT_PixelTracks_Multiplicity70_v*",
43 "HLT_PixelTracks_Multiplicity80_v*",
44 "HLT_PixelTracks_Multiplicity90_v*",
48 "HLT_GlobalRunHPDNoise_v*",
49 "HLT_L1TrackerCosmics_v*",
53 "HLT_DoubleMu33NoFiltersNoVtx_v*",
54 "HLT_DoubleMu38NoFiltersNoVtx_v*",
55 "HLT_Mu38NoFiltersNoVtx_Photon38_CaloIdL_v*",
56 "HLT_Mu42NoFiltersNoVtx_Photon42_CaloIdL_v*",
57 "HLT_DoubleMu23NoFiltersNoVtxDisplaced_v*",
58 "HLT_DoubleMu28NoFiltersNoVtxDisplaced_v*",
59 "HLT_Mu28NoFiltersNoVtxDisplaced_Photon28_CaloIdL_v*",
60 "HLT_Mu33NoFiltersNoVtxDisplaced_Photon33_CaloIdL_v*",
61 "HLT_HT350_DisplacedDijet80_Tight_DisplacedTrack_v*",
62 "HLT_HT350_DisplacedDijet80_DisplacedTrack_v*",
63 "HLT_HT500_DisplacedDijet40_Inclusive_v*",
64 "HLT_HT350_DisplacedDijet40_DisplacedTrack_v*",
65 "HLT_HT550_DisplacedDijet40_Inclusive_v*",
66 "HLT_HT350_DisplacedDijet80_DisplacedTrack_v*",
67 "HLT_HT400_DisplacedDijet40_Inclusive_v*",
68 "HLT_HT250_DisplacedDijet40_DisplacedTrack_v*",
69 "HLT_TrkMu15_DoubleTrkMu5NoFiltersNoVtx_v*",
70 "HLT_TrkMu17_DoubleTrkMu8NoFiltersNoVtx_v*",
71 "HLT_MET75_IsoTrk50_v*",
72 "HLT_MET90_IsoTrk50_v*",
73 "HLT_VBF_DisplacedJet40_DisplacedTrack_v*",
74 "HLT_VBF_DisplacedJet40_TightID_DisplacedTrack_v*",
75 "HLT_VBF_DisplacedJet40_VTightID_DisplacedTrack_v*",
76 "HLT_VBF_DisplacedJet40_VVTightID_DisplacedTrack_v*",
77 "HLT_VBF_DisplacedJet40_Hadronic_2PromptTrack_v*",
78 "HLT_VBF_DisplacedJet40_DisplacedTrack_2TrackIP2DSig5_v*",
79 "HLT_Mu33NoFiltersNoVtxDisplaced_DisplacedJet50_Tight_v*",
80 "HLT_Mu33NoFiltersNoVtxDisplaced_DisplacedJet50_Loose_v*",
81 "HLT_Mu38NoFiltersNoVtxDisplaced_DisplacedJet60_Tight_v*",
82 "HLT_Mu38NoFiltersNoVtxDisplaced_DisplacedJet60_Loose_v*",
83 "HLT_Mu38NoFiltersNoVtx_DisplacedJet60_Loose_v*",
84 "HLT_Mu28NoFiltersNoVtx_DisplacedJet40_Loose_v*",
85 "HLT_Mu28NoFiltersNoVtx_CentralCaloJet40_v*",
86 "HLT_Mu23NoFiltersNoVtx_Photon23_CaloIdL_v*",
87 "HLT_DoubleMu18NoFiltersNoVtx_v*",
88 "HLT_DoubleMuNoFiltersNoVtx_SaveObjects_v*",
89 "MC_DoubleMuNoFiltersNoVtx_v*",
116 "hltCkfL1SeededTrackCandidates",
117 "hltCtfL1SeededithMaterialTracks",
118 "hltCkf3HitL1SeededTrackCandidates",
119 "hltCtf3HitL1SeededWithMaterialTracks",
120 "hltCkf3HitActivityTrackCandidates",
121 "hltCtf3HitActivityWithMaterialTracks",
122 "hltActivityCkfTrackCandidatesForGSF",
123 "hltL1SeededCkfTrackCandidatesForGSF",
124 "hltMuCkfTrackCandidates",
126 "hltTau3MuCkfTrackCandidates",
127 "hltTau3MuCtfWithMaterialTracks",
128 "hltMuTrackJpsiCkfTrackCandidates",
129 "hltMuTrackJpsiCtfTracks",
130 "hltMuTrackJpsiEffCkfTrackCandidates",
131 "hltMuTrackJpsiEffCtfTracks",
132 "hltJpsiTkPixelSeedFromL3Candidate",
133 "hltCkfTrackCandidatesJpsiTk",
134 "hltCtfWithMaterialTracksJpsiTk",
135 "hltMuTrackCkfTrackCandidatesOnia",
136 "hltMuTrackCtfTracksOnia",
139 "hltL3TrajSeedOIHit",
140 "hltL3TrajSeedIOHit",
141 "hltL3NoFiltersTrajSeedOIHit",
142 "hltL3NoFiltersTrajSeedIOHit",
143 "hltL3TrackCandidateFromL2OIState",
144 "hltL3TrackCandidateFromL2OIHit",
145 "hltL3TrackCandidateFromL2IOHit",
146 "hltL3TrackCandidateFromL2NoVtx",
151 "hltESRawToRecHitFacility",
155 "hltEgammaCkfTrackCandidatesForGSF",
156 "hltEgammaGsfTracks",
157 "hltEgammaCkfTrackCandidatesForGSFUnseeded",
158 "hltEgammaGsfTracksUnseeded",
160 "hltPFJetCkfTrackCandidates",
161 "hltPFJetCtfWithMaterialTracks",
162 "hltPFlowTrackSelectionHighPurity",
164 "hltDisplacedHT250L1FastJetRegionalPixelSeedGenerator",
165 "hltDisplacedHT250L1FastJetRegionalCkfTrackCandidates",
166 "hltDisplacedHT250L1FastJetRegionalCtfWithMaterialTracks",
167 "hltDisplacedHT300L1FastJetRegionalPixelSeedGenerator",
168 "hltDisplacedHT300L1FastJetRegionalCkfTrackCandidates",
169 "hltDisplacedHT300L1FastJetRegionalCtfWithMaterialTracks",
170 "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJet",
171 "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJet",
172 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJet",
173 "hltBLifetimeRegionalPixelSeedGeneratorHbbVBF",
174 "hltBLifetimeRegionalCkfTrackCandidatesHbbVBF",
175 "hltBLifetimeRegionalCtfWithMaterialTracksHbbVBF",
176 "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
177 "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
178 "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
179 "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
180 "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
181 "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
183 "hltBLifetimeRegionalPixelSeedGeneratorHbb",
184 "hltBLifetimeRegionalCkfTrackCandidatesHbb",
185 "hltBLifetimeRegionalCtfWithMaterialTracksHbb",
186 "hltBLifetimeRegionalPixelSeedGeneratorbbPhi",
187 "hltBLifetimeRegionalCkfTrackCandidatesbbPhi",
188 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhi",
189 "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
190 "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
191 "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
192 "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
193 "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
194 "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
195 "hltBLifetimeFastRegionalPixelSeedGeneratorHbbVBF",
196 "hltBLifetimeFastRegionalCkfTrackCandidatesHbbVBF",
197 "hltBLifetimeFastRegionalCtfWithMaterialTracksHbbVBF",
198 "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJetFastPV",
199 "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJetFastPV",
200 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJetFastPV",
201 "hltFastPixelBLifetimeRegionalPixelSeedGeneratorHbb",
202 "hltFastPixelBLifetimeRegionalCkfTrackCandidatesHbb",
203 "hltFastPixelBLifetimeRegionalCtfWithMaterialTracksHbb",
205 "hltPixelTracksForMinBias",
206 "hltPixelTracksForHighMult",
207 "hltRegionalPixelTracks",
209 "hltPixelTracksL3Muon",
210 "hltPixelTracksGlbTrkMuon",
211 "hltPixelTracksHighPtTkMuIso",
212 "hltPixelTracksHybrid",
213 "hltPixelTracksForPhotons",
214 "hltPixelTracksForEgamma",
215 "hltPixelTracksElectrons",
216 "hltPixelTracksForHighPt",
217 "hltHighPtPixelTracks",
218 "hltPixelTracksForNoPU",
220 "hltFastPixelHitsVertex",
221 "hltFastPixelTracks",
222 "hltFastPixelTracksRecover",
224 "hltPixelLayerPairs",
225 "hltPixelLayerTriplets",
226 "hltPixelLayerTripletsReg",
227 "hltPixelLayerTripletsHITHB",
228 "hltPixelLayerTripletsHITHE",
229 "hltMixedLayerPairs",
231 "hltFastPrimaryVertexbbPhi",
232 "hltPixelTracksFastPVbbPhi",
233 "hltPixelTracksRecoverbbPhi",
234 "hltFastPixelHitsVertexVHbb",
235 "hltFastPixelTracksVHbb",
236 "hltFastPixelTracksRecoverVHbb",
238 "hltFastPrimaryVertex",
239 "hltFastPVPixelVertexFilter",
240 "hltFastPVPixelTracks",
241 "hltFastPVPixelTracksRecover",
253 "hltScalersRawToDigi",
254 "hltEcalPreshowerDigis",
256 "hltEcalDetIdToBeRecovered",
260 SequencesToRemove = (
261 "HLTL1SeededEgammaRegionalRecoTrackerSequence",
262 "HLTEcalActivityEgammaRegionalRecoTrackerSequence",
263 "HLTPixelMatchElectronActivityTrackingSequence",
264 "HLTDoLocalStripSequence",
265 "HLTDoLocalPixelSequence",
266 "HLTDoLocalPixelSequenceRegL2Tau",
267 "HLTDoLocalStripSequenceReg",
268 "HLTDoLocalPixelSequenceReg",
269 "HLTDoLocalStripSequenceRegForBTag",
270 "HLTDoLocalPixelSequenceRegForBTag",
271 "HLTDoLocalPixelSequenceRegForNoPU",
275 "HLTRecopixelvertexingSequence",
278 "HLTBeginSequenceNZS",
279 "HLTBeginSequenceBPTX",
280 "HLTBeginSequenceAntiBPTX",
281 "HLTHBHENoiseSequence",
282 "HLTIterativeTrackingIter04",
283 "HLTIterativeTrackingIter02",
284 "HLTIterativeTracking",
285 "HLTIterativeTrackingForHighPt",
286 "HLTIterativeTrackingTau3Mu",
287 "HLTIterativeTrackingReg",
288 "HLTIterativeTrackingForElectronIter02",
289 "HLTIterativeTrackingForPhotonsIter02",
290 "HLTIterativeTrackingL3MuonIter02",
291 "HLTIterativeTrackingGlbTrkMuonIter02",
292 "HLTIterativeTrackingL3MuonRegIter02",
293 "HLTIterativeTrackingHighPtTkMu",
294 "HLTIterativeTrackingHighPtTkMuIsoIter02",
295 "HLTIterativeTrackingForBTagIter02",
296 "HLTIterativeTrackingForBTagIter12",
297 "HLTIterativeTrackingForTauIter04",
298 "HLTIterativeTrackingForTauIter02",
299 "HLTIterativeTrackingDisplacedJpsiIter02",
300 "HLTIterativeTrackingDisplacedPsiPrimeIter02",
301 "HLTIterativeTrackingDisplacedNRMuMuIter02",
302 "HLTIterativeTrackingForBTagIteration0",
303 "HLTIterativeTrackingIteration4DisplacedJets",
304 "HLTRegionalCKFTracksForL3Isolation",
305 "HLTHBHENoiseCleanerSequence",
309 for label
in ESModulesToRemove:
310 if (hasattr(process,label)):
311 delattr(process,label)
316 HLTSchedule = tuple( path.label_()
for path
in process.HLTSchedule)
317 for black
in fastSimUnsupportedPaths:
318 compiled = re.compile(fnmatch.translate(black))
319 for path
in HLTSchedule:
320 if compiled.search(path)
is not None:
321 ExplicitList += [path]
323 for path
in ExplicitList:
324 if path
not in UniqueList:
326 for path
in UniqueList:
327 process.schedule.remove(getattr(process,path))
328 process.setSchedule_(process.schedule)
332 if hasattr(process,
'streams'):
333 delattr(process,
'streams')
334 if hasattr(process,
'datasets'):
335 delattr(process,
'datasets')
338 for label
in SequencesToRemove:
339 if hasattr(process,label):
340 if hasattr(fastsim,label):
341 setattr(process,label,getattr(fastsim,label))
343 object = getattr(process,label)
344 list = tuple(process.sequences_().
keys())
346 sequence = getattr(process,name)
349 more = sequence.remove(object)
350 list = tuple(process.paths_().
keys())
352 path = getattr(process,name)
355 more = path.remove(object)
356 delattr(process,label)
359 for label
in ModulesToRemove:
360 if hasattr(process,label):
361 if hasattr(fastsim,label):
362 setattr(process,label,getattr(fastsim,label))
364 object = getattr(process,label)
365 list = tuple(process.sequences_().
keys())
367 sequence = getattr(process,name)
370 more = sequence.remove(object)
371 list = tuple(process.paths_().
keys())
373 path = getattr(process,name)
376 more = path.remove(object)
377 delattr(process,label)
380 if hasattr(process,
'hltGetConditions')
and hasattr(process,
'HLTriggerFirstPath'):
381 process.hltDummyConditions = cms.EDFilter(
"HLTBool", result = cms.bool(
True ) )
382 process.HLTriggerFirstPath.replace(process.hltGetConditions,process.hltDummyConditions)
383 if hasattr(process,
'hltPixelVertices'):
384 process.hltPixelVertices.beamSpot = cms.InputTag(
'offlineBeamSpot')
385 specialModules = (
'hltEcalRecHit',
'hltEcalPreshowerRecHit', )
386 for label
in specialModules:
387 if hasattr(process,label):
388 setattr(fastsim,label,getattr(process,label))
391 for label
in fastsim.producers_().
keys():
392 if hasattr(process,label):
393 setattr(process,label,getattr(fastsim,label))
394 for label
in fastsim.filters_().
keys():
395 if hasattr(process,label):
396 setattr(process,label,getattr(fastsim,label))
397 for label
in fastsim.analyzers_().
keys():
398 if hasattr(process,label):
399 setattr(process,label,getattr(fastsim,label))
400 for label
in fastsim.sequences_().
keys():
401 if hasattr(process,label):
402 setattr(process,label,getattr(fastsim,label))
407 (
'hltGtDigis',
'gtDigis'),
408 (
'hltL1GtObjectMap',
'gtDigis'),
409 (
'hltEcalDigis:ebDigis',
'ecalDigis:ebDigis'),
410 (
'hltEcalDigis:eeDigis',
'ecalDigis:eeDigis'),
411 (
'hltMuonCSCDigis',
'muonCSCDigis'),
412 (
'hltMuonCSCDigis:MuonCSCStripDigi',
'muonCSCDigis:MuonCSCStripDigi'),
413 (
'hltMuonCSCDigis:MuonCSCWireDigi',
'muonCSCDigis:MuonCSCWireDigi'),
414 (
'hltMuonDTDigis',
'muonDTDigis'),
415 (
'hltMuonRPCDigis',
'muonRPCDigis'),
416 (
'hltEcalPreshowerDigis',
'ecalPreshowerDigis'),
417 (
'hltHbhereco',
'hbhereco'),
418 (
'hltHoreco',
'horeco'),
419 (
'hltHfreco',
'hfreco'),
421 (
'hltIter2Merged',
'generalTracks'),
422 (
'hltIter2HighPtMerged',
'generalTracks'),
423 (
'hltIter2MergedForElectrons',
'generalTracks'),
424 (
'hltIter2MergedForPhotons',
'generalTracks'),
425 (
'hltIter2L3MuonMerged',
'generalTracks'),
426 (
'hltIter2MergedForBTag',
'generalTracks'),
427 (
'hltIter2MergedForTau',
'generalTracks'),
428 (
'hltIter2GlbTrkMuonMerged',
'generalTracks'),
429 (
'hltIter2HighPtTkMuMerged',
'generalTracks'),
430 (
'hltIter2HighPtTkMuIsoMerged',
'generalTracks'),
431 (
'hltIter2DisplacedJpsiMerged',
'generalTracks'),
432 (
'hltIter2DisplacedPsiPrimeMerged',
'generalTracks'),
433 (
'hltIter2DisplacedNRMuMuMerged',
'generalTracks'),
434 (
'hltIter0PFlowTrackSelectionHighPurityForBTag',
'generalTracks'),
435 (
'hltIter4HighPtMerged',
'generalTracks'),
437 (
'hltRegionalTracksForL3MuonIsolation',
'hltPixelTracks'),
439 (
'hltL1extraParticles',
'l1extraParticles'),
440 (
'hltL1extraParticles:Central',
'l1extraParticles:Central'),
441 (
'hltL1extraParticles:Forward',
'l1extraParticles:Forward'),
442 (
'hltL1extraParticles:Isolated',
'l1extraParticles:Isolated'),
443 (
'hltL1extraParticles:NonIsolated',
'l1extraParticles:NonIsolated'),
444 (
'hltL1extraParticles:Tau',
'l1extraParticles:Tau'),
445 (
'hltL1extraParticles:IsoTau',
'l1extraParticles:IsoTau'),
446 (
'hltOfflineBeamSpot',
'offlineBeamSpot'),
447 (
'hltOnlineBeamSpot',
'offlineBeamSpot'),
448 (
'hltSiStripClusters',
'MeasurementTrackerEvent'),
451 from HLTrigger.Configuration.CustomConfigs
import MassReplaceInputTag
452 for pair
in InputTags:
457 (
'GMTReadoutCollection',cms.InputTag(
'gtDigis'),cms.InputTag(
'gmtDigis')),
458 (
'killDeadChannels',cms.bool(
True),cms.bool(
False)),
459 (
'recoverEBFE',cms.bool(
True),cms.bool(
False)),
460 (
'recoverEEFE',cms.bool(
True),cms.bool(
False)),
461 (
'src',cms.InputTag(
'hltHcalTowerNoiseCleaner'),cms.InputTag(
'hltTowerMakerForAll')),
462 (
'initialSeeds',cms.InputTag(
'noSeedsHere'),cms.InputTag(
'globalPixelSeeds')),
463 (
'preFilteredSeeds',cms.bool(
True),cms.bool(
False)),
465 from HLTrigger.Configuration.CustomConfigs
import MassReplaceParameter
466 for thrice
in NamedParameters:
470 for label
in (
'hltEgammaElectronPixelSeeds',
'hltEgammaElectronPixelSeedsUnseeded',):
471 if hasattr(process,label):
472 getattr(process,label).SeedConfiguration.initialSeeds = cms.InputTag(
'globalPixelSeeds')
473 getattr(process,label).SeedConfiguration.preFilteredSeeds = cms.bool(
False)
474 if hasattr(fastsim,
'globalPixelSeeds'):
475 if hasattr(fastsim.globalPixelSeeds,
'outputSeedCollectionName'):
476 getattr(process,label).SeedConfiguration.initialSeeds = cms.InputTag(
'globalPixelSeeds',fastsim.globalPixelSeeds.outputSeedCollectionName.value())
480 fastsim.extend(process)
481 fastsim.setSchedule_(fastsim.schedule)