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