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_TrkMu15_DoubleTrkMu5NoFiltersNoVtx_v*",
68 "HLT_TrkMu17_DoubleTrkMu8NoFiltersNoVtx_v*",
69 "HLT_MET75_IsoTrk50_v*",
70 "HLT_MET90_IsoTrk50_v*",
71 "HLT_VBF_DisplacedJet40_DisplacedTrack_v*",
72 "HLT_VBF_DisplacedJet40_TightID_DisplacedTrack_v*",
73 "HLT_VBF_DisplacedJet40_VTightID_DisplacedTrack_v*",
74 "HLT_VBF_DisplacedJet40_VVTightID_DisplacedTrack_v*",
75 "HLT_Mu33NoFiltersNoVtxDisplaced_DisplacedJet50_Tight_v*",
76 "HLT_Mu33NoFiltersNoVtxDisplaced_DisplacedJet50_Loose_v*",
77 "HLT_Mu38NoFiltersNoVtxDisplaced_DisplacedJet60_Tight_v*",
78 "HLT_Mu38NoFiltersNoVtxDisplaced_DisplacedJet60_Loose_v*",
79 "HLT_Mu38NoFiltersNoVtx_DisplacedJet60_Loose_v*",
80 "HLT_Mu28NoFiltersNoVtx_DisplacedJet40_Loose_v*",
81 "HLT_Mu28NoFiltersNoVtx_CentralCaloJet40_v*",
82 "HLT_Mu23NoFiltersNoVtx_Photon23_CaloIdL_v*",
83 "HLT_DoubleMu18NoFiltersNoVtx_v*",
84 "HLT_DoubleMuNoFiltersNoVtx_SaveObjects_v*",
85 "MC_DoubleMuNoFiltersNoVtx_v*",
112 "hltCkfL1SeededTrackCandidates",
113 "hltCtfL1SeededithMaterialTracks",
114 "hltCkf3HitL1SeededTrackCandidates",
115 "hltCtf3HitL1SeededWithMaterialTracks",
116 "hltCkf3HitActivityTrackCandidates",
117 "hltCtf3HitActivityWithMaterialTracks",
118 "hltActivityCkfTrackCandidatesForGSF",
119 "hltL1SeededCkfTrackCandidatesForGSF",
120 "hltMuCkfTrackCandidates",
122 "hltTau3MuCkfTrackCandidates",
123 "hltTau3MuCtfWithMaterialTracks",
124 "hltMuTrackJpsiCkfTrackCandidates",
125 "hltMuTrackJpsiCtfTracks",
126 "hltMuTrackJpsiEffCkfTrackCandidates",
127 "hltMuTrackJpsiEffCtfTracks",
128 "hltJpsiTkPixelSeedFromL3Candidate",
129 "hltCkfTrackCandidatesJpsiTk",
130 "hltCtfWithMaterialTracksJpsiTk",
131 "hltMuTrackCkfTrackCandidatesOnia",
132 "hltMuTrackCtfTracksOnia",
135 "hltL3TrajSeedOIHit",
136 "hltL3TrajSeedIOHit",
137 "hltL3NoFiltersTrajSeedOIHit",
138 "hltL3NoFiltersTrajSeedIOHit",
139 "hltL3TrackCandidateFromL2OIState",
140 "hltL3TrackCandidateFromL2OIHit",
141 "hltL3TrackCandidateFromL2IOHit",
142 "hltL3TrackCandidateFromL2NoVtx",
147 "hltESRawToRecHitFacility",
151 "hltEgammaCkfTrackCandidatesForGSF",
152 "hltEgammaGsfTracks",
153 "hltEgammaCkfTrackCandidatesForGSFUnseeded",
154 "hltEgammaGsfTracksUnseeded",
156 "hltPFJetCkfTrackCandidates",
157 "hltPFJetCtfWithMaterialTracks",
158 "hltPFlowTrackSelectionHighPurity",
160 "hltDisplacedHT250L1FastJetRegionalPixelSeedGenerator",
161 "hltDisplacedHT250L1FastJetRegionalCkfTrackCandidates",
162 "hltDisplacedHT250L1FastJetRegionalCtfWithMaterialTracks",
163 "hltDisplacedHT300L1FastJetRegionalPixelSeedGenerator",
164 "hltDisplacedHT300L1FastJetRegionalCkfTrackCandidates",
165 "hltDisplacedHT300L1FastJetRegionalCtfWithMaterialTracks",
166 "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJet",
167 "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJet",
168 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJet",
169 "hltBLifetimeRegionalPixelSeedGeneratorHbbVBF",
170 "hltBLifetimeRegionalCkfTrackCandidatesHbbVBF",
171 "hltBLifetimeRegionalCtfWithMaterialTracksHbbVBF",
172 "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
173 "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
174 "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
175 "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
176 "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
177 "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
179 "hltBLifetimeRegionalPixelSeedGeneratorHbb",
180 "hltBLifetimeRegionalCkfTrackCandidatesHbb",
181 "hltBLifetimeRegionalCtfWithMaterialTracksHbb",
182 "hltBLifetimeRegionalPixelSeedGeneratorbbPhi",
183 "hltBLifetimeRegionalCkfTrackCandidatesbbPhi",
184 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhi",
185 "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
186 "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
187 "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
188 "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
189 "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
190 "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
191 "hltBLifetimeFastRegionalPixelSeedGeneratorHbbVBF",
192 "hltBLifetimeFastRegionalCkfTrackCandidatesHbbVBF",
193 "hltBLifetimeFastRegionalCtfWithMaterialTracksHbbVBF",
194 "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJetFastPV",
195 "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJetFastPV",
196 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJetFastPV",
197 "hltFastPixelBLifetimeRegionalPixelSeedGeneratorHbb",
198 "hltFastPixelBLifetimeRegionalCkfTrackCandidatesHbb",
199 "hltFastPixelBLifetimeRegionalCtfWithMaterialTracksHbb",
201 "hltPixelTracksForMinBias",
202 "hltPixelTracksForHighMult",
203 "hltRegionalPixelTracks",
205 "hltPixelTracksL3Muon",
206 "hltPixelTracksGlbTrkMuon",
207 "hltPixelTracksHighPtTkMuIso",
208 "hltPixelTracksHybrid",
209 "hltPixelTracksForPhotons",
210 "hltPixelTracksForEgamma",
211 "hltPixelTracksElectrons",
212 "hltPixelTracksForHighPt",
213 "hltHighPtPixelTracks",
214 "hltPixelTracksForNoPU",
216 "hltFastPixelHitsVertex",
217 "hltFastPixelTracks",
218 "hltFastPixelTracksRecover",
220 "hltPixelLayerPairs",
221 "hltPixelLayerTriplets",
222 "hltPixelLayerTripletsReg",
223 "hltPixelLayerTripletsHITHB",
224 "hltPixelLayerTripletsHITHE",
225 "hltMixedLayerPairs",
227 "hltFastPrimaryVertexbbPhi",
228 "hltPixelTracksFastPVbbPhi",
229 "hltPixelTracksRecoverbbPhi",
230 "hltFastPixelHitsVertexVHbb",
231 "hltFastPixelTracksVHbb",
232 "hltFastPixelTracksRecoverVHbb",
234 "hltFastPrimaryVertex",
235 "hltFastPVPixelVertexFilter",
236 "hltFastPVPixelTracks",
237 "hltFastPVPixelTracksRecover",
249 "hltScalersRawToDigi",
250 "hltEcalPreshowerDigis",
252 "hltEcalDetIdToBeRecovered",
256 SequencesToRemove = (
257 "HLTL1SeededEgammaRegionalRecoTrackerSequence",
258 "HLTEcalActivityEgammaRegionalRecoTrackerSequence",
259 "HLTPixelMatchElectronActivityTrackingSequence",
260 "HLTDoLocalStripSequence",
261 "HLTDoLocalPixelSequence",
262 "HLTDoLocalPixelSequenceRegL2Tau",
263 "HLTDoLocalStripSequenceReg",
264 "HLTDoLocalPixelSequenceReg",
265 "HLTDoLocalStripSequenceRegForBTag",
266 "HLTDoLocalPixelSequenceRegForBTag",
267 "HLTDoLocalPixelSequenceRegForNoPU",
271 "HLTRecopixelvertexingSequence",
274 "HLTBeginSequenceNZS",
275 "HLTBeginSequenceBPTX",
276 "HLTBeginSequenceAntiBPTX",
277 "HLTHBHENoiseSequence",
278 "HLTIterativeTrackingIter04",
279 "HLTIterativeTrackingIter02",
280 "HLTIterativeTracking",
281 "HLTIterativeTrackingForHighPt",
282 "HLTIterativeTrackingTau3Mu",
283 "HLTIterativeTrackingReg",
284 "HLTIterativeTrackingForElectronIter02",
285 "HLTIterativeTrackingForPhotonsIter02",
286 "HLTIterativeTrackingL3MuonIter02",
287 "HLTIterativeTrackingGlbTrkMuonIter02",
288 "HLTIterativeTrackingL3MuonRegIter02",
289 "HLTIterativeTrackingHighPtTkMu",
290 "HLTIterativeTrackingHighPtTkMuIsoIter02",
291 "HLTIterativeTrackingForBTagIter02",
292 "HLTIterativeTrackingForBTagIter12",
293 "HLTIterativeTrackingForTauIter04",
294 "HLTIterativeTrackingForTauIter02",
295 "HLTIterativeTrackingDisplacedJpsiIter02",
296 "HLTIterativeTrackingDisplacedPsiPrimeIter02",
297 "HLTIterativeTrackingDisplacedNRMuMuIter02",
298 "HLTIterativeTrackingForBTagIteration0",
299 "HLTIterativeTrackingIteration4DisplacedJets",
300 "HLTRegionalCKFTracksForL3Isolation",
301 "HLTHBHENoiseCleanerSequence",
305 for label
in ESModulesToRemove:
306 if (hasattr(process,label)):
307 delattr(process,label)
312 HLTSchedule = tuple( path.label_()
for path
in process.HLTSchedule)
313 for black
in fastSimUnsupportedPaths:
314 compiled = re.compile(fnmatch.translate(black))
315 for path
in HLTSchedule:
316 if compiled.search(path)
is not None:
317 ExplicitList += [path]
319 for path
in ExplicitList:
320 if path
not in UniqueList:
322 for path
in UniqueList:
323 process.schedule.remove(getattr(process,path))
324 process.setSchedule_(process.schedule)
328 if hasattr(process,
'streams'):
329 delattr(process,
'streams')
330 if hasattr(process,
'datasets'):
331 delattr(process,
'datasets')
334 for label
in SequencesToRemove:
335 if hasattr(process,label):
336 if hasattr(fastsim,label):
337 setattr(process,label,getattr(fastsim,label))
339 object = getattr(process,label)
340 list = tuple(process.sequences_().
keys())
342 sequence = getattr(process,name)
345 more = sequence.remove(object)
346 list = tuple(process.paths_().
keys())
348 path = getattr(process,name)
351 more = path.remove(object)
352 delattr(process,label)
355 for label
in ModulesToRemove:
356 if hasattr(process,label):
357 if hasattr(fastsim,label):
358 setattr(process,label,getattr(fastsim,label))
360 object = getattr(process,label)
361 list = tuple(process.sequences_().
keys())
363 sequence = getattr(process,name)
366 more = sequence.remove(object)
367 list = tuple(process.paths_().
keys())
369 path = getattr(process,name)
372 more = path.remove(object)
373 delattr(process,label)
376 if hasattr(process,
'hltGetConditions')
and hasattr(process,
'HLTriggerFirstPath'):
377 process.hltDummyConditions = cms.EDFilter(
"HLTBool", result = cms.bool(
True ) )
378 process.HLTriggerFirstPath.replace(process.hltGetConditions,process.hltDummyConditions)
379 if hasattr(process,
'hltPixelVertices'):
380 process.hltPixelVertices.beamSpot = cms.InputTag(
'offlineBeamSpot')
381 specialModules = (
'hltEcalRecHit',
'hltEcalPreshowerRecHit', )
382 for label
in specialModules:
383 if hasattr(process,label):
384 setattr(fastsim,label,getattr(process,label))
387 for label
in fastsim.producers_().
keys():
388 if hasattr(process,label):
389 setattr(process,label,getattr(fastsim,label))
390 for label
in fastsim.filters_().
keys():
391 if hasattr(process,label):
392 setattr(process,label,getattr(fastsim,label))
393 for label
in fastsim.analyzers_().
keys():
394 if hasattr(process,label):
395 setattr(process,label,getattr(fastsim,label))
396 for label
in fastsim.sequences_().
keys():
397 if hasattr(process,label):
398 setattr(process,label,getattr(fastsim,label))
403 (
'hltGtDigis',
'gtDigis'),
404 (
'hltL1GtObjectMap',
'gtDigis'),
405 (
'hltEcalDigis:ebDigis',
'ecalDigis:ebDigis'),
406 (
'hltEcalDigis:eeDigis',
'ecalDigis:eeDigis'),
407 (
'hltMuonCSCDigis',
'muonCSCDigis'),
408 (
'hltMuonCSCDigis:MuonCSCStripDigi',
'muonCSCDigis:MuonCSCStripDigi'),
409 (
'hltMuonCSCDigis:MuonCSCWireDigi',
'muonCSCDigis:MuonCSCWireDigi'),
410 (
'hltMuonDTDigis',
'muonDTDigis'),
411 (
'hltMuonRPCDigis',
'muonRPCDigis'),
412 (
'hltEcalPreshowerDigis',
'ecalPreshowerDigis'),
413 (
'hltHbhereco',
'hbhereco'),
414 (
'hltHoreco',
'horeco'),
415 (
'hltHfreco',
'hfreco'),
417 (
'hltIter2Merged',
'generalTracks'),
418 (
'hltIter2HighPtMerged',
'generalTracks'),
419 (
'hltIter2MergedForElectrons',
'generalTracks'),
420 (
'hltIter2MergedForPhotons',
'generalTracks'),
421 (
'hltIter2L3MuonMerged',
'generalTracks'),
422 (
'hltIter2MergedForBTag',
'generalTracks'),
423 (
'hltIter2MergedForTau',
'generalTracks'),
424 (
'hltIter2GlbTrkMuonMerged',
'generalTracks'),
425 (
'hltIter2HighPtTkMuMerged',
'generalTracks'),
426 (
'hltIter2HighPtTkMuIsoMerged',
'generalTracks'),
427 (
'hltIter2DisplacedJpsiMerged',
'generalTracks'),
428 (
'hltIter2DisplacedPsiPrimeMerged',
'generalTracks'),
429 (
'hltIter2DisplacedNRMuMuMerged',
'generalTracks'),
430 (
'hltIter0PFlowTrackSelectionHighPurityForBTag',
'generalTracks'),
431 (
'hltIter4HighPtMerged',
'generalTracks'),
433 (
'hltRegionalTracksForL3MuonIsolation',
'hltPixelTracks'),
435 (
'hltL1extraParticles',
'l1extraParticles'),
436 (
'hltL1extraParticles:Central',
'l1extraParticles:Central'),
437 (
'hltL1extraParticles:Forward',
'l1extraParticles:Forward'),
438 (
'hltL1extraParticles:Isolated',
'l1extraParticles:Isolated'),
439 (
'hltL1extraParticles:NonIsolated',
'l1extraParticles:NonIsolated'),
440 (
'hltL1extraParticles:Tau',
'l1extraParticles:Tau'),
441 (
'hltL1extraParticles:IsoTau',
'l1extraParticles:IsoTau'),
442 (
'hltOfflineBeamSpot',
'offlineBeamSpot'),
443 (
'hltOnlineBeamSpot',
'offlineBeamSpot'),
444 (
'hltSiStripClusters',
'MeasurementTrackerEvent'),
447 from HLTrigger.Configuration.CustomConfigs
import MassReplaceInputTag
448 for pair
in InputTags:
453 (
'GMTReadoutCollection',cms.InputTag(
'gtDigis'),cms.InputTag(
'gmtDigis')),
454 (
'killDeadChannels',cms.bool(
True),cms.bool(
False)),
455 (
'recoverEBFE',cms.bool(
True),cms.bool(
False)),
456 (
'recoverEEFE',cms.bool(
True),cms.bool(
False)),
457 (
'src',cms.InputTag(
'hltHcalTowerNoiseCleaner'),cms.InputTag(
'hltTowerMakerForAll')),
458 (
'initialSeeds',cms.InputTag(
'noSeedsHere'),cms.InputTag(
'globalPixelSeeds')),
459 (
'preFilteredSeeds',cms.bool(
True),cms.bool(
False)),
461 from HLTrigger.Configuration.CustomConfigs
import MassReplaceParameter
462 for thrice
in NamedParameters:
466 for label
in (
'hltEgammaElectronPixelSeeds',
'hltEgammaElectronPixelSeedsUnseeded',):
467 if hasattr(process,label):
468 getattr(process,label).SeedConfiguration.initialSeeds = cms.InputTag(
'globalPixelSeeds')
469 getattr(process,label).SeedConfiguration.preFilteredSeeds = cms.bool(
False)
470 if hasattr(fastsim,
'globalPixelSeeds'):
471 if hasattr(fastsim.globalPixelSeeds,
'outputSeedCollectionName'):
472 getattr(process,label).SeedConfiguration.initialSeeds = cms.InputTag(
'globalPixelSeeds',fastsim.globalPixelSeeds.outputSeedCollectionName.value())
476 fastsim.extend(process)
477 fastsim.setSchedule_(fastsim.schedule)