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