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*",
91 "HLT_L1MuOpenNotHF2Pixel_SingleTrack*",
92 "HLT_L1TOTEM0_RomanPotsAND_PixelClusters*",
118 "hltCkfL1SeededTrackCandidates",
119 "hltCtfL1SeededithMaterialTracks",
120 "hltCkf3HitL1SeededTrackCandidates",
121 "hltCtf3HitL1SeededWithMaterialTracks",
122 "hltCkf3HitActivityTrackCandidates",
123 "hltCtf3HitActivityWithMaterialTracks",
124 "hltActivityCkfTrackCandidatesForGSF",
125 "hltL1SeededCkfTrackCandidatesForGSF",
126 "hltMuCkfTrackCandidates",
128 "hltTau3MuCkfTrackCandidates",
129 "hltTau3MuCtfWithMaterialTracks",
130 "hltMuTrackJpsiCkfTrackCandidates",
131 "hltMuTrackJpsiCtfTracks",
132 "hltMuTrackJpsiEffCkfTrackCandidates",
133 "hltMuTrackJpsiEffCtfTracks",
134 "hltJpsiTkPixelSeedFromL3Candidate",
135 "hltCkfTrackCandidatesJpsiTk",
136 "hltCtfWithMaterialTracksJpsiTk",
137 "hltMuTrackCkfTrackCandidatesOnia",
138 "hltMuTrackCtfTracksOnia",
141 "hltL3TrajSeedOIHit",
142 "hltL3TrajSeedIOHit",
143 "hltL3NoFiltersTrajSeedOIHit",
144 "hltL3NoFiltersTrajSeedIOHit",
145 "hltL3TrackCandidateFromL2OIState",
146 "hltL3TrackCandidateFromL2OIHit",
147 "hltL3TrackCandidateFromL2IOHit",
148 "hltL3TrackCandidateFromL2NoVtx",
153 "hltESRawToRecHitFacility",
157 "hltEgammaCkfTrackCandidatesForGSF",
158 "hltEgammaGsfTracks",
159 "hltEgammaCkfTrackCandidatesForGSFUnseeded",
160 "hltEgammaGsfTracksUnseeded",
162 "hltPFJetCkfTrackCandidates",
163 "hltPFJetCtfWithMaterialTracks",
164 "hltPFlowTrackSelectionHighPurity",
166 "hltDisplacedHT250L1FastJetRegionalPixelSeedGenerator",
167 "hltDisplacedHT250L1FastJetRegionalCkfTrackCandidates",
168 "hltDisplacedHT250L1FastJetRegionalCtfWithMaterialTracks",
169 "hltDisplacedHT300L1FastJetRegionalPixelSeedGenerator",
170 "hltDisplacedHT300L1FastJetRegionalCkfTrackCandidates",
171 "hltDisplacedHT300L1FastJetRegionalCtfWithMaterialTracks",
172 "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJet",
173 "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJet",
174 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJet",
175 "hltBLifetimeRegionalPixelSeedGeneratorHbbVBF",
176 "hltBLifetimeRegionalCkfTrackCandidatesHbbVBF",
177 "hltBLifetimeRegionalCtfWithMaterialTracksHbbVBF",
178 "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
179 "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
180 "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
181 "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
182 "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
183 "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
185 "hltBLifetimeRegionalPixelSeedGeneratorHbb",
186 "hltBLifetimeRegionalCkfTrackCandidatesHbb",
187 "hltBLifetimeRegionalCtfWithMaterialTracksHbb",
188 "hltBLifetimeRegionalPixelSeedGeneratorbbPhi",
189 "hltBLifetimeRegionalCkfTrackCandidatesbbPhi",
190 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhi",
191 "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
192 "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
193 "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
194 "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
195 "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
196 "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
197 "hltBLifetimeFastRegionalPixelSeedGeneratorHbbVBF",
198 "hltBLifetimeFastRegionalCkfTrackCandidatesHbbVBF",
199 "hltBLifetimeFastRegionalCtfWithMaterialTracksHbbVBF",
200 "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJetFastPV",
201 "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJetFastPV",
202 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJetFastPV",
203 "hltFastPixelBLifetimeRegionalPixelSeedGeneratorHbb",
204 "hltFastPixelBLifetimeRegionalCkfTrackCandidatesHbb",
205 "hltFastPixelBLifetimeRegionalCtfWithMaterialTracksHbb",
207 "hltPixelTracksForMinBias",
208 "hltPixelTracksForMinBias01",
209 "hltPixelTracksForHighMult",
210 "hltRegionalPixelTracks",
212 "hltPixelTracksL3Muon",
213 "hltPixelTracksGlbTrkMuon",
214 "hltPixelTracksHighPtTkMuIso",
215 "hltPixelTracksHybrid",
216 "hltPixelTracksForPhotons",
217 "hltPixelTracksForEgamma",
218 "hltPixelTracksElectrons",
219 "hltPixelTracksForHighPt",
220 "hltHighPtPixelTracks",
221 "hltPixelTracksForNoPU",
223 "hltFastPixelHitsVertex",
224 "hltFastPixelTracks",
225 "hltFastPixelTracksRecover",
227 "hltPixelLayerPairs",
228 "hltPixelLayerTriplets",
229 "hltPixelLayerTripletsReg",
230 "hltPixelLayerTripletsHITHB",
231 "hltPixelLayerTripletsHITHE",
232 "hltMixedLayerPairs",
234 "hltFastPrimaryVertexbbPhi",
235 "hltPixelTracksFastPVbbPhi",
236 "hltPixelTracksRecoverbbPhi",
237 "hltFastPixelHitsVertexVHbb",
238 "hltFastPixelTracksVHbb",
239 "hltFastPixelTracksRecoverVHbb",
241 "hltFastPrimaryVertex",
242 "hltFastPVPixelVertexFilter",
243 "hltFastPVPixelTracks",
244 "hltFastPVPixelTracksRecover",
256 "hltScalersRawToDigi",
257 "hltEcalPreshowerDigis",
259 "hltEcalDetIdToBeRecovered",
263 SequencesToRemove = (
264 "HLTL1SeededEgammaRegionalRecoTrackerSequence",
265 "HLTEcalActivityEgammaRegionalRecoTrackerSequence",
266 "HLTPixelMatchElectronActivityTrackingSequence",
267 "HLTDoLocalStripSequence",
268 "HLTDoLocalPixelSequence",
269 "HLTDoLocalPixelSequenceRegL2Tau",
270 "HLTDoLocalStripSequenceReg",
271 "HLTDoLocalPixelSequenceReg",
272 "HLTDoLocalStripSequenceRegForBTag",
273 "HLTDoLocalPixelSequenceRegForBTag",
274 "HLTDoLocalPixelSequenceRegForNoPU",
278 "HLTRecopixelvertexingSequence",
281 "HLTBeginSequenceNZS",
282 "HLTBeginSequenceBPTX",
283 "HLTBeginSequenceAntiBPTX",
284 "HLTHBHENoiseSequence",
285 "HLTIterativeTrackingIter04",
286 "HLTIterativeTrackingIter02",
287 "HLTIterativeTracking",
288 "HLTIterativeTrackingForHighPt",
289 "HLTIterativeTrackingTau3Mu",
290 "HLTIterativeTrackingReg",
291 "HLTIterativeTrackingForElectronIter02",
292 "HLTIterativeTrackingForPhotonsIter02",
293 "HLTIterativeTrackingL3MuonIter02",
294 "HLTIterativeTrackingGlbTrkMuonIter02",
295 "HLTIterativeTrackingL3MuonRegIter02",
296 "HLTIterativeTrackingHighPtTkMu",
297 "HLTIterativeTrackingHighPtTkMuIsoIter02",
298 "HLTIterativeTrackingForBTagIter02",
299 "HLTIterativeTrackingForBTagIter12",
300 "HLTIterativeTrackingForTauIter04",
301 "HLTIterativeTrackingForTauIter02",
302 "HLTIterativeTrackingDisplacedJpsiIter02",
303 "HLTIterativeTrackingDisplacedPsiPrimeIter02",
304 "HLTIterativeTrackingDisplacedNRMuMuIter02",
305 "HLTIterativeTrackingForBTagIteration0",
306 "HLTIterativeTrackingIteration4DisplacedJets",
307 "HLTRegionalCKFTracksForL3Isolation",
308 "HLTHBHENoiseCleanerSequence",
312 for label
in ESModulesToRemove:
313 if (hasattr(process,label)):
314 delattr(process,label)
319 HLTSchedule = tuple( path.label_()
for path
in process.HLTSchedule)
320 for black
in fastSimUnsupportedPaths:
321 compiled = re.compile(fnmatch.translate(black))
322 for path
in HLTSchedule:
323 if compiled.search(path)
is not None:
324 ExplicitList += [path]
326 for path
in ExplicitList:
327 if path
not in UniqueList:
329 for path
in UniqueList:
330 process.schedule.remove(getattr(process,path))
331 process.setSchedule_(process.schedule)
335 if hasattr(process,
'streams'):
336 delattr(process,
'streams')
337 if hasattr(process,
'datasets'):
338 delattr(process,
'datasets')
341 for label
in SequencesToRemove:
342 if hasattr(process,label):
343 if hasattr(fastsim,label):
344 setattr(process,label,getattr(fastsim,label))
346 object = getattr(process,label)
347 list = tuple(process.sequences_().
keys())
349 sequence = getattr(process,name)
352 more = sequence.remove(object)
353 list = tuple(process.paths_().
keys())
355 path = getattr(process,name)
358 more = path.remove(object)
359 delattr(process,label)
362 for label
in ModulesToRemove:
363 if hasattr(process,label):
364 if hasattr(fastsim,label):
365 setattr(process,label,getattr(fastsim,label))
367 object = getattr(process,label)
368 list = tuple(process.sequences_().
keys())
370 sequence = getattr(process,name)
373 more = sequence.remove(object)
374 list = tuple(process.paths_().
keys())
376 path = getattr(process,name)
379 more = path.remove(object)
380 delattr(process,label)
383 if hasattr(process,
'hltGetConditions')
and hasattr(process,
'HLTriggerFirstPath'):
384 process.hltDummyConditions = cms.EDFilter(
"HLTBool", result = cms.bool(
True ) )
385 process.HLTriggerFirstPath.replace(process.hltGetConditions,process.hltDummyConditions)
386 if hasattr(process,
'hltPixelVertices'):
387 process.hltPixelVertices.beamSpot = cms.InputTag(
'offlineBeamSpot')
388 specialModules = (
'hltEcalRecHit',
'hltEcalPreshowerRecHit', )
389 for label
in specialModules:
390 if hasattr(process,label):
391 setattr(fastsim,label,getattr(process,label))
394 for label
in fastsim.producers_().
keys():
395 if hasattr(process,label):
396 setattr(process,label,getattr(fastsim,label))
397 for label
in fastsim.filters_().
keys():
398 if hasattr(process,label):
399 setattr(process,label,getattr(fastsim,label))
400 for label
in fastsim.analyzers_().
keys():
401 if hasattr(process,label):
402 setattr(process,label,getattr(fastsim,label))
403 for label
in fastsim.sequences_().
keys():
404 if hasattr(process,label):
405 setattr(process,label,getattr(fastsim,label))
410 (
'hltGtDigis',
'gtDigis'),
411 (
'hltL1GtObjectMap',
'gtDigis'),
412 (
'hltEcalDigis:ebDigis',
'ecalDigis:ebDigis'),
413 (
'hltEcalDigis:eeDigis',
'ecalDigis:eeDigis'),
414 (
'hltMuonCSCDigis',
'muonCSCDigis'),
415 (
'hltMuonCSCDigis:MuonCSCStripDigi',
'muonCSCDigis:MuonCSCStripDigi'),
416 (
'hltMuonCSCDigis:MuonCSCWireDigi',
'muonCSCDigis:MuonCSCWireDigi'),
417 (
'hltMuonDTDigis',
'muonDTDigis'),
418 (
'hltMuonRPCDigis',
'muonRPCDigis'),
419 (
'hltEcalPreshowerDigis',
'ecalPreshowerDigis'),
420 (
'hltHbhereco',
'hbhereco'),
421 (
'hltHoreco',
'horeco'),
422 (
'hltHfreco',
'hfreco'),
424 (
'hltIter2Merged',
'generalTracks'),
425 (
'hltIter2HighPtMerged',
'generalTracks'),
426 (
'hltIter2MergedForElectrons',
'generalTracks'),
427 (
'hltIter2MergedForPhotons',
'generalTracks'),
428 (
'hltIter2L3MuonMerged',
'generalTracks'),
429 (
'hltIter2MergedForBTag',
'generalTracks'),
430 (
'hltIter2MergedForTau',
'generalTracks'),
431 (
'hltIter2GlbTrkMuonMerged',
'generalTracks'),
432 (
'hltIter2HighPtTkMuMerged',
'generalTracks'),
433 (
'hltIter2HighPtTkMuIsoMerged',
'generalTracks'),
434 (
'hltIter2DisplacedJpsiMerged',
'generalTracks'),
435 (
'hltIter2DisplacedPsiPrimeMerged',
'generalTracks'),
436 (
'hltIter2DisplacedNRMuMuMerged',
'generalTracks'),
437 (
'hltIter0PFlowTrackSelectionHighPurityForBTag',
'generalTracks'),
438 (
'hltIter4HighPtMerged',
'generalTracks'),
440 (
'hltRegionalTracksForL3MuonIsolation',
'hltPixelTracks'),
442 (
'hltL1extraParticles',
'l1extraParticles'),
443 (
'hltL1extraParticles:Central',
'l1extraParticles:Central'),
444 (
'hltL1extraParticles:Forward',
'l1extraParticles:Forward'),
445 (
'hltL1extraParticles:Isolated',
'l1extraParticles:Isolated'),
446 (
'hltL1extraParticles:NonIsolated',
'l1extraParticles:NonIsolated'),
447 (
'hltL1extraParticles:Tau',
'l1extraParticles:Tau'),
448 (
'hltL1extraParticles:IsoTau',
'l1extraParticles:IsoTau'),
449 (
'hltOfflineBeamSpot',
'offlineBeamSpot'),
450 (
'hltOnlineBeamSpot',
'offlineBeamSpot'),
451 (
'hltSiStripClusters',
'MeasurementTrackerEvent'),
454 from HLTrigger.Configuration.CustomConfigs
import MassReplaceInputTag
455 for pair
in InputTags:
460 (
'GMTReadoutCollection',cms.InputTag(
'gtDigis'),cms.InputTag(
'gmtDigis')),
461 (
'killDeadChannels',cms.bool(
True),cms.bool(
False)),
462 (
'recoverEBFE',cms.bool(
True),cms.bool(
False)),
463 (
'recoverEEFE',cms.bool(
True),cms.bool(
False)),
464 (
'src',cms.InputTag(
'hltHcalTowerNoiseCleaner'),cms.InputTag(
'hltTowerMakerForAll')),
465 (
'initialSeeds',cms.InputTag(
'noSeedsHere'),cms.InputTag(
'globalPixelSeeds')),
466 (
'preFilteredSeeds',cms.bool(
True),cms.bool(
False)),
468 from HLTrigger.Configuration.CustomConfigs
import MassReplaceParameter
469 for thrice
in NamedParameters:
473 for label
in (
'hltEgammaElectronPixelSeeds',
'hltEgammaElectronPixelSeedsUnseeded',):
474 if hasattr(process,label):
475 getattr(process,label).SeedConfiguration.initialSeeds = cms.InputTag(
'globalPixelSeeds')
476 getattr(process,label).SeedConfiguration.preFilteredSeeds = cms.bool(
False)
477 if hasattr(fastsim,
'globalPixelSeeds'):
478 if hasattr(fastsim.globalPixelSeeds,
'outputSeedCollectionName'):
479 getattr(process,label).SeedConfiguration.initialSeeds = cms.InputTag(
'globalPixelSeeds',fastsim.globalPixelSeeds.outputSeedCollectionName.value())
483 fastsim.extend(process)
484 fastsim.setSchedule_(fastsim.schedule)