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_HT400_DisplacedDijet40_Inclusive_v*",
69 "HLT_HT250_DisplacedDijet40_DisplacedTrack_v*",
70 "HLT_TrkMu15_DoubleTrkMu5NoFiltersNoVtx_v*",
71 "HLT_TrkMu17_DoubleTrkMu8NoFiltersNoVtx_v*",
72 "HLT_MET75_IsoTrk50_v*",
73 "HLT_MET90_IsoTrk50_v*",
74 "HLT_VBF_DisplacedJet40_DisplacedTrack_v*",
75 "HLT_VBF_DisplacedJet40_TightID_DisplacedTrack_v*",
76 "HLT_VBF_DisplacedJet40_VTightID_DisplacedTrack_v*",
77 "HLT_VBF_DisplacedJet40_VVTightID_DisplacedTrack_v*",
78 "HLT_VBF_DisplacedJet40_Hadronic_2PromptTrack_v*",
79 "HLT_VBF_DisplacedJet40_DisplacedTrack_2TrackIP2DSig5_v*",
80 "HLT_Mu33NoFiltersNoVtxDisplaced_DisplacedJet50_Tight_v*",
81 "HLT_Mu33NoFiltersNoVtxDisplaced_DisplacedJet50_Loose_v*",
82 "HLT_Mu38NoFiltersNoVtxDisplaced_DisplacedJet60_Tight_v*",
83 "HLT_Mu38NoFiltersNoVtxDisplaced_DisplacedJet60_Loose_v*",
84 "HLT_Mu38NoFiltersNoVtx_DisplacedJet60_Loose_v*",
85 "HLT_Mu28NoFiltersNoVtx_DisplacedJet40_Loose_v*",
86 "HLT_Mu28NoFiltersNoVtx_CentralCaloJet40_v*",
87 "HLT_Mu23NoFiltersNoVtx_Photon23_CaloIdL_v*",
88 "HLT_DoubleMu18NoFiltersNoVtx_v*",
89 "HLT_DoubleMuNoFiltersNoVtx_SaveObjects_v*",
90 "MC_DoubleMuNoFiltersNoVtx_v*",
92 "HLT_L1MuOpenNotHF2Pixel_SingleTrack*",
93 "HLT_L1TOTEM0_RomanPotsAND_PixelClusters*",
119 "hltCkfL1SeededTrackCandidates",
120 "hltCtfL1SeededithMaterialTracks",
121 "hltCkf3HitL1SeededTrackCandidates",
122 "hltCtf3HitL1SeededWithMaterialTracks",
123 "hltCkf3HitActivityTrackCandidates",
124 "hltCtf3HitActivityWithMaterialTracks",
125 "hltActivityCkfTrackCandidatesForGSF",
126 "hltL1SeededCkfTrackCandidatesForGSF",
127 "hltMuCkfTrackCandidates",
129 "hltTau3MuCkfTrackCandidates",
130 "hltTau3MuCtfWithMaterialTracks",
131 "hltMuTrackJpsiCkfTrackCandidates",
132 "hltMuTrackJpsiCtfTracks",
133 "hltMuTrackJpsiEffCkfTrackCandidates",
134 "hltMuTrackJpsiEffCtfTracks",
135 "hltJpsiTkPixelSeedFromL3Candidate",
136 "hltCkfTrackCandidatesJpsiTk",
137 "hltCtfWithMaterialTracksJpsiTk",
138 "hltMuTrackCkfTrackCandidatesOnia",
139 "hltMuTrackCtfTracksOnia",
142 "hltL3TrajSeedOIHit",
143 "hltL3TrajSeedIOHit",
144 "hltL3NoFiltersTrajSeedOIHit",
145 "hltL3NoFiltersTrajSeedIOHit",
146 "hltL3TrackCandidateFromL2OIState",
147 "hltL3TrackCandidateFromL2OIHit",
148 "hltL3TrackCandidateFromL2IOHit",
149 "hltL3TrackCandidateFromL2NoVtx",
154 "hltESRawToRecHitFacility",
158 "hltEgammaCkfTrackCandidatesForGSF",
159 "hltEgammaGsfTracks",
160 "hltEgammaCkfTrackCandidatesForGSFUnseeded",
161 "hltEgammaGsfTracksUnseeded",
163 "hltPFJetCkfTrackCandidates",
164 "hltPFJetCtfWithMaterialTracks",
165 "hltPFlowTrackSelectionHighPurity",
167 "hltDisplacedHT250L1FastJetRegionalPixelSeedGenerator",
168 "hltDisplacedHT250L1FastJetRegionalCkfTrackCandidates",
169 "hltDisplacedHT250L1FastJetRegionalCtfWithMaterialTracks",
170 "hltDisplacedHT300L1FastJetRegionalPixelSeedGenerator",
171 "hltDisplacedHT300L1FastJetRegionalCkfTrackCandidates",
172 "hltDisplacedHT300L1FastJetRegionalCtfWithMaterialTracks",
173 "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJet",
174 "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJet",
175 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJet",
176 "hltBLifetimeRegionalPixelSeedGeneratorHbbVBF",
177 "hltBLifetimeRegionalCkfTrackCandidatesHbbVBF",
178 "hltBLifetimeRegionalCtfWithMaterialTracksHbbVBF",
179 "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
180 "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
181 "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
182 "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
183 "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
184 "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
186 "hltBLifetimeRegionalPixelSeedGeneratorHbb",
187 "hltBLifetimeRegionalCkfTrackCandidatesHbb",
188 "hltBLifetimeRegionalCtfWithMaterialTracksHbb",
189 "hltBLifetimeRegionalPixelSeedGeneratorbbPhi",
190 "hltBLifetimeRegionalCkfTrackCandidatesbbPhi",
191 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhi",
192 "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
193 "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
194 "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
195 "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
196 "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
197 "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
198 "hltBLifetimeFastRegionalPixelSeedGeneratorHbbVBF",
199 "hltBLifetimeFastRegionalCkfTrackCandidatesHbbVBF",
200 "hltBLifetimeFastRegionalCtfWithMaterialTracksHbbVBF",
201 "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJetFastPV",
202 "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJetFastPV",
203 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJetFastPV",
204 "hltFastPixelBLifetimeRegionalPixelSeedGeneratorHbb",
205 "hltFastPixelBLifetimeRegionalCkfTrackCandidatesHbb",
206 "hltFastPixelBLifetimeRegionalCtfWithMaterialTracksHbb",
208 "hltPixelTracksForMinBias",
209 "hltPixelTracksForMinBias01",
210 "hltPixelTracksForHighMult",
211 "hltRegionalPixelTracks",
213 "hltPixelTracksL3Muon",
214 "hltPixelTracksGlbTrkMuon",
215 "hltPixelTracksHighPtTkMuIso",
216 "hltPixelTracksHybrid",
217 "hltPixelTracksForPhotons",
218 "hltPixelTracksForEgamma",
219 "hltPixelTracksElectrons",
220 "hltPixelTracksForHighPt",
221 "hltHighPtPixelTracks",
222 "hltPixelTracksForNoPU",
224 "hltFastPixelHitsVertex",
225 "hltFastPixelTracks",
226 "hltFastPixelTracksRecover",
228 "hltPixelLayerPairs",
229 "hltPixelLayerTriplets",
230 "hltPixelLayerTripletsReg",
231 "hltPixelLayerTripletsHITHB",
232 "hltPixelLayerTripletsHITHE",
233 "hltMixedLayerPairs",
235 "hltFastPrimaryVertexbbPhi",
236 "hltPixelTracksFastPVbbPhi",
237 "hltPixelTracksRecoverbbPhi",
238 "hltFastPixelHitsVertexVHbb",
239 "hltFastPixelTracksVHbb",
240 "hltFastPixelTracksRecoverVHbb",
242 "hltFastPrimaryVertex",
243 "hltFastPVPixelVertexFilter",
244 "hltFastPVPixelTracks",
245 "hltFastPVPixelTracksRecover",
257 "hltScalersRawToDigi",
258 "hltEcalPreshowerDigis",
260 "hltEcalDetIdToBeRecovered",
264 SequencesToRemove = (
265 "HLTL1SeededEgammaRegionalRecoTrackerSequence",
266 "HLTEcalActivityEgammaRegionalRecoTrackerSequence",
267 "HLTPixelMatchElectronActivityTrackingSequence",
268 "HLTDoLocalStripSequence",
269 "HLTDoLocalPixelSequence",
270 "HLTDoLocalPixelSequenceRegL2Tau",
271 "HLTDoLocalStripSequenceReg",
272 "HLTDoLocalPixelSequenceReg",
273 "HLTDoLocalStripSequenceRegForBTag",
274 "HLTDoLocalPixelSequenceRegForBTag",
275 "HLTDoLocalPixelSequenceRegForNoPU",
279 "HLTRecopixelvertexingSequence",
282 "HLTBeginSequenceNZS",
283 "HLTBeginSequenceBPTX",
284 "HLTBeginSequenceAntiBPTX",
285 "HLTHBHENoiseSequence",
286 "HLTIterativeTrackingIter04",
287 "HLTIterativeTrackingIter02",
288 "HLTIterativeTracking",
289 "HLTIterativeTrackingForHighPt",
290 "HLTIterativeTrackingTau3Mu",
291 "HLTIterativeTrackingReg",
292 "HLTIterativeTrackingForElectronIter02",
293 "HLTIterativeTrackingForPhotonsIter02",
294 "HLTIterativeTrackingL3MuonIter02",
295 "HLTIterativeTrackingGlbTrkMuonIter02",
296 "HLTIterativeTrackingL3MuonRegIter02",
297 "HLTIterativeTrackingHighPtTkMu",
298 "HLTIterativeTrackingHighPtTkMuIsoIter02",
299 "HLTIterativeTrackingForBTagIter02",
300 "HLTIterativeTrackingForBTagIter12",
301 "HLTIterativeTrackingForTauIter04",
302 "HLTIterativeTrackingForTauIter02",
303 "HLTIterativeTrackingDisplacedJpsiIter02",
304 "HLTIterativeTrackingDisplacedPsiPrimeIter02",
305 "HLTIterativeTrackingDisplacedNRMuMuIter02",
306 "HLTIterativeTrackingForBTagIteration0",
307 "HLTIterativeTrackingIteration4DisplacedJets",
308 "HLTRegionalCKFTracksForL3Isolation",
309 "HLTHBHENoiseCleanerSequence",
313 for label
in ESModulesToRemove:
314 if (hasattr(process,label)):
315 delattr(process,label)
320 HLTSchedule = tuple( path.label_()
for path
in process.HLTSchedule)
321 for black
in fastSimUnsupportedPaths:
322 compiled = re.compile(fnmatch.translate(black))
323 for path
in HLTSchedule:
324 if compiled.search(path)
is not None:
325 ExplicitList += [path]
327 for path
in ExplicitList:
328 if path
not in UniqueList:
330 for path
in UniqueList:
331 process.schedule.remove(getattr(process,path))
332 process.setSchedule_(process.schedule)
336 if hasattr(process,
'streams'):
337 delattr(process,
'streams')
338 if hasattr(process,
'datasets'):
339 delattr(process,
'datasets')
342 for label
in SequencesToRemove:
343 if hasattr(process,label):
344 if hasattr(fastsim,label):
345 setattr(process,label,getattr(fastsim,label))
347 object = getattr(process,label)
348 list = tuple(process.sequences_().
keys())
350 sequence = getattr(process,name)
353 more = sequence.remove(object)
354 list = tuple(process.paths_().
keys())
356 path = getattr(process,name)
359 more = path.remove(object)
360 delattr(process,label)
363 for label
in ModulesToRemove:
364 if hasattr(process,label):
365 if hasattr(fastsim,label):
366 setattr(process,label,getattr(fastsim,label))
368 object = getattr(process,label)
369 list = tuple(process.sequences_().
keys())
371 sequence = getattr(process,name)
374 more = sequence.remove(object)
375 list = tuple(process.paths_().
keys())
377 path = getattr(process,name)
380 more = path.remove(object)
381 delattr(process,label)
384 if hasattr(process,
'hltGetConditions')
and hasattr(process,
'HLTriggerFirstPath'):
385 process.hltDummyConditions = cms.EDFilter(
"HLTBool", result = cms.bool(
True ) )
386 process.HLTriggerFirstPath.replace(process.hltGetConditions,process.hltDummyConditions)
387 if hasattr(process,
'hltPixelVertices'):
388 process.hltPixelVertices.beamSpot = cms.InputTag(
'offlineBeamSpot')
389 specialModules = (
'hltEcalRecHit',
'hltEcalPreshowerRecHit', )
390 for label
in specialModules:
391 if hasattr(process,label):
392 setattr(fastsim,label,getattr(process,label))
395 for label
in fastsim.producers_().
keys():
396 if hasattr(process,label):
397 setattr(process,label,getattr(fastsim,label))
398 for label
in fastsim.filters_().
keys():
399 if hasattr(process,label):
400 setattr(process,label,getattr(fastsim,label))
401 for label
in fastsim.analyzers_().
keys():
402 if hasattr(process,label):
403 setattr(process,label,getattr(fastsim,label))
404 for label
in fastsim.sequences_().
keys():
405 if hasattr(process,label):
406 setattr(process,label,getattr(fastsim,label))
411 (
'hltGtDigis',
'gtDigis'),
412 (
'hltL1GtObjectMap',
'gtDigis'),
413 (
'hltEcalDigis:ebDigis',
'ecalDigis:ebDigis'),
414 (
'hltEcalDigis:eeDigis',
'ecalDigis:eeDigis'),
415 (
'hltMuonCSCDigis',
'muonCSCDigis'),
416 (
'hltMuonCSCDigis:MuonCSCStripDigi',
'muonCSCDigis:MuonCSCStripDigi'),
417 (
'hltMuonCSCDigis:MuonCSCWireDigi',
'muonCSCDigis:MuonCSCWireDigi'),
418 (
'hltMuonDTDigis',
'muonDTDigis'),
419 (
'hltMuonRPCDigis',
'muonRPCDigis'),
420 (
'hltEcalPreshowerDigis',
'ecalPreshowerDigis'),
421 (
'hltHbhereco',
'hbhereco'),
422 (
'hltHoreco',
'horeco'),
423 (
'hltHfreco',
'hfreco'),
425 (
'hltIter2Merged',
'generalTracks'),
426 (
'hltIter2HighPtMerged',
'generalTracks'),
427 (
'hltIter2MergedForElectrons',
'generalTracks'),
428 (
'hltIter2MergedForPhotons',
'generalTracks'),
429 (
'hltIter2L3MuonMerged',
'generalTracks'),
430 (
'hltIter2MergedForBTag',
'generalTracks'),
431 (
'hltIter2MergedForTau',
'generalTracks'),
432 (
'hltIter2GlbTrkMuonMerged',
'generalTracks'),
433 (
'hltIter2HighPtTkMuMerged',
'generalTracks'),
434 (
'hltIter2HighPtTkMuIsoMerged',
'generalTracks'),
435 (
'hltIter2DisplacedJpsiMerged',
'generalTracks'),
436 (
'hltIter2DisplacedPsiPrimeMerged',
'generalTracks'),
437 (
'hltIter2DisplacedNRMuMuMerged',
'generalTracks'),
438 (
'hltIter0PFlowTrackSelectionHighPurityForBTag',
'generalTracks'),
439 (
'hltIter4HighPtMerged',
'generalTracks'),
441 (
'hltRegionalTracksForL3MuonIsolation',
'hltPixelTracks'),
443 (
'hltL1extraParticles',
'l1extraParticles'),
444 (
'hltL1extraParticles:Central',
'l1extraParticles:Central'),
445 (
'hltL1extraParticles:Forward',
'l1extraParticles:Forward'),
446 (
'hltL1extraParticles:Isolated',
'l1extraParticles:Isolated'),
447 (
'hltL1extraParticles:NonIsolated',
'l1extraParticles:NonIsolated'),
448 (
'hltL1extraParticles:Tau',
'l1extraParticles:Tau'),
449 (
'hltL1extraParticles:IsoTau',
'l1extraParticles:IsoTau'),
450 (
'hltOfflineBeamSpot',
'offlineBeamSpot'),
451 (
'hltOnlineBeamSpot',
'offlineBeamSpot'),
452 (
'hltSiStripClusters',
'MeasurementTrackerEvent'),
455 from HLTrigger.Configuration.CustomConfigs
import MassReplaceInputTag
456 for pair
in InputTags:
461 (
'GMTReadoutCollection',cms.InputTag(
'gtDigis'),cms.InputTag(
'gmtDigis')),
462 (
'killDeadChannels',cms.bool(
True),cms.bool(
False)),
463 (
'recoverEBFE',cms.bool(
True),cms.bool(
False)),
464 (
'recoverEEFE',cms.bool(
True),cms.bool(
False)),
465 (
'src',cms.InputTag(
'hltHcalTowerNoiseCleaner'),cms.InputTag(
'hltTowerMakerForAll')),
466 (
'initialSeeds',cms.InputTag(
'noSeedsHere'),cms.InputTag(
'globalPixelSeeds')),
467 (
'preFilteredSeeds',cms.bool(
True),cms.bool(
False)),
469 from HLTrigger.Configuration.CustomConfigs
import MassReplaceParameter
470 for thrice
in NamedParameters:
474 for label
in (
'hltEgammaElectronPixelSeeds',
'hltEgammaElectronPixelSeedsUnseeded',):
475 if hasattr(process,label):
476 getattr(process,label).SeedConfiguration.initialSeeds = cms.InputTag(
'globalPixelSeeds')
477 getattr(process,label).SeedConfiguration.preFilteredSeeds = cms.bool(
False)
478 if hasattr(fastsim,
'globalPixelSeeds'):
479 if hasattr(fastsim.globalPixelSeeds,
'outputSeedCollectionName'):
480 getattr(process,label).SeedConfiguration.initialSeeds = cms.InputTag(
'globalPixelSeeds',fastsim.globalPixelSeeds.outputSeedCollectionName.value())
484 fastsim.extend(process)
485 fastsim.setSchedule_(fastsim.schedule)