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