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)
22 if 'hltHbhereco' in process.__dict__:
23 process.hltHbhereco.pedestalSubtractionType = cms.int32( 1 )
24 process.hltHbhereco.pedestalUpperLimit = cms.double( 2.7 )
25 process.hltHbhereco.timeSlewParsType = cms.int32( 3 )
27 process.hltHbhereco.timeSlewPars = cms.vdouble( 9.27638, -2.05585, 0, 9.27638, -2.05585, 0, 9.27638, -2.05585, 0 )
28 process.hltHbhereco.respCorrM3 = cms.double( 1.0 )
36 fastsim = cms.ProcessFragment( process.name_() )
37 fastsim.load(
"FastSimulation.HighLevelTrigger.HLTSetup_cff" )
39 fastSimUnsupportedPaths = (
44 "HLT_*Calibration_v*",
49 "HLT_Activity_Ecal*_v*",
52 "HLT_L1SingleMuOpen_AntiBPTX_v*",
53 "HLT_JetE*_NoBPTX*_v*",
54 "HLT_L2Mu*_NoBPTX*_v*",
55 "HLT_PixelTracks_Multiplicity70_v*",
56 "HLT_PixelTracks_Multiplicity80_v*",
57 "HLT_PixelTracks_Multiplicity90_v*",
61 "HLT_GlobalRunHPDNoise_v*",
62 "HLT_L1TrackerCosmics_v*",
66 "HLT_DoubleMu33NoFiltersNoVtx_v*",
67 "HLT_DoubleMu38NoFiltersNoVtx_v*",
68 "HLT_Mu38NoFiltersNoVtx_Photon38_CaloIdL_v*",
69 "HLT_Mu42NoFiltersNoVtx_Photon42_CaloIdL_v*",
70 "HLT_DoubleMu23NoFiltersNoVtxDisplaced_v*",
71 "HLT_DoubleMu28NoFiltersNoVtxDisplaced_v*",
72 "HLT_Mu28NoFiltersNoVtxDisplaced_Photon28_CaloIdL_v*",
73 "HLT_Mu33NoFiltersNoVtxDisplaced_Photon33_CaloIdL_v*",
74 "HLT_HT350_DisplacedDijet80_Tight_DisplacedTrack_v*",
75 "HLT_HT350_DisplacedDijet80_DisplacedTrack_v*",
76 "HLT_HT500_DisplacedDijet40_Inclusive_v*",
77 "HLT_HT350_DisplacedDijet40_DisplacedTrack_v*",
78 "HLT_HT550_DisplacedDijet40_Inclusive_v*",
79 "HLT_HT350_DisplacedDijet80_DisplacedTrack_v*",
80 "HLT_HT400_DisplacedDijet40_Inclusive_v*",
81 "HLT_HT250_DisplacedDijet40_DisplacedTrack_v*",
82 "HLT_TrkMu15_DoubleTrkMu5NoFiltersNoVtx_v*",
83 "HLT_TrkMu17_DoubleTrkMu8NoFiltersNoVtx_v*",
84 "HLT_MET75_IsoTrk50_v*",
85 "HLT_MET90_IsoTrk50_v*",
86 "HLT_VBF_DisplacedJet40_DisplacedTrack_v*",
87 "HLT_VBF_DisplacedJet40_TightID_DisplacedTrack_v*",
88 "HLT_VBF_DisplacedJet40_VTightID_DisplacedTrack_v*",
89 "HLT_VBF_DisplacedJet40_VVTightID_DisplacedTrack_v*",
90 "HLT_VBF_DisplacedJet40_Hadronic_2PromptTrack_v*",
91 "HLT_VBF_DisplacedJet40_DisplacedTrack_2TrackIP2DSig5_v*",
92 "HLT_Mu33NoFiltersNoVtxDisplaced_DisplacedJet50_Tight_v*",
93 "HLT_Mu33NoFiltersNoVtxDisplaced_DisplacedJet50_Loose_v*",
94 "HLT_Mu38NoFiltersNoVtxDisplaced_DisplacedJet60_Tight_v*",
95 "HLT_Mu38NoFiltersNoVtxDisplaced_DisplacedJet60_Loose_v*",
96 "HLT_Mu38NoFiltersNoVtx_DisplacedJet60_Loose_v*",
97 "HLT_Mu28NoFiltersNoVtx_DisplacedJet40_Loose_v*",
98 "HLT_Mu28NoFiltersNoVtx_CentralCaloJet40_v*",
99 "HLT_Mu23NoFiltersNoVtx_Photon23_CaloIdL_v*",
100 "HLT_DoubleMu18NoFiltersNoVtx_v*",
101 "HLT_DoubleMuNoFiltersNoVtx_SaveObjects_v*",
102 "MC_DoubleMuNoFiltersNoVtx_v*",
104 "HLT_L1MuOpenNotHF2Pixel_SingleTrack*",
105 "HLT_L1TOTEM0_RomanPotsAND_PixelClusters*",
108 ESModulesToRemove = (
131 "hltCkfL1SeededTrackCandidates",
132 "hltCtfL1SeededithMaterialTracks",
133 "hltCkf3HitL1SeededTrackCandidates",
134 "hltCtf3HitL1SeededWithMaterialTracks",
135 "hltCkf3HitActivityTrackCandidates",
136 "hltCtf3HitActivityWithMaterialTracks",
137 "hltActivityCkfTrackCandidatesForGSF",
138 "hltL1SeededCkfTrackCandidatesForGSF",
139 "hltMuCkfTrackCandidates",
141 "hltTau3MuCkfTrackCandidates",
142 "hltTau3MuCtfWithMaterialTracks",
143 "hltMuTrackJpsiCkfTrackCandidates",
144 "hltMuTrackJpsiCtfTracks",
145 "hltMuTrackJpsiEffCkfTrackCandidates",
146 "hltMuTrackJpsiEffCtfTracks",
147 "hltJpsiTkPixelSeedFromL3Candidate",
148 "hltCkfTrackCandidatesJpsiTk",
149 "hltCtfWithMaterialTracksJpsiTk",
150 "hltMuTrackCkfTrackCandidatesOnia",
151 "hltMuTrackCtfTracksOnia",
154 "hltL3TrajSeedOIHit",
155 "hltL3TrajSeedIOHit",
156 "hltL3NoFiltersTrajSeedOIHit",
157 "hltL3NoFiltersTrajSeedIOHit",
158 "hltL3TrackCandidateFromL2OIState",
159 "hltL3TrackCandidateFromL2OIHit",
160 "hltL3TrackCandidateFromL2IOHit",
161 "hltL3TrackCandidateFromL2NoVtx",
166 "hltESRawToRecHitFacility",
170 "hltEgammaCkfTrackCandidatesForGSF",
171 "hltEgammaGsfTracks",
172 "hltEgammaCkfTrackCandidatesForGSFUnseeded",
173 "hltEgammaGsfTracksUnseeded",
175 "hltPFJetCkfTrackCandidates",
176 "hltPFJetCtfWithMaterialTracks",
177 "hltPFlowTrackSelectionHighPurity",
179 "hltDisplacedHT250L1FastJetRegionalPixelSeedGenerator",
180 "hltDisplacedHT250L1FastJetRegionalCkfTrackCandidates",
181 "hltDisplacedHT250L1FastJetRegionalCtfWithMaterialTracks",
182 "hltDisplacedHT300L1FastJetRegionalPixelSeedGenerator",
183 "hltDisplacedHT300L1FastJetRegionalCkfTrackCandidates",
184 "hltDisplacedHT300L1FastJetRegionalCtfWithMaterialTracks",
185 "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJet",
186 "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJet",
187 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJet",
188 "hltBLifetimeRegionalPixelSeedGeneratorHbbVBF",
189 "hltBLifetimeRegionalCkfTrackCandidatesHbbVBF",
190 "hltBLifetimeRegionalCtfWithMaterialTracksHbbVBF",
191 "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
192 "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
193 "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
194 "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
195 "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
196 "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
198 "hltBLifetimeRegionalPixelSeedGeneratorHbb",
199 "hltBLifetimeRegionalCkfTrackCandidatesHbb",
200 "hltBLifetimeRegionalCtfWithMaterialTracksHbb",
201 "hltBLifetimeRegionalPixelSeedGeneratorbbPhi",
202 "hltBLifetimeRegionalCkfTrackCandidatesbbPhi",
203 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhi",
204 "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
205 "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
206 "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
207 "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
208 "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
209 "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
210 "hltBLifetimeFastRegionalPixelSeedGeneratorHbbVBF",
211 "hltBLifetimeFastRegionalCkfTrackCandidatesHbbVBF",
212 "hltBLifetimeFastRegionalCtfWithMaterialTracksHbbVBF",
213 "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJetFastPV",
214 "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJetFastPV",
215 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJetFastPV",
216 "hltFastPixelBLifetimeRegionalPixelSeedGeneratorHbb",
217 "hltFastPixelBLifetimeRegionalCkfTrackCandidatesHbb",
218 "hltFastPixelBLifetimeRegionalCtfWithMaterialTracksHbb",
220 "hltPixelTracksForMinBias",
221 "hltPixelTracksForMinBias01",
222 "hltPixelTracksForHighMult",
223 "hltRegionalPixelTracks",
225 "hltPixelTracksL3Muon",
226 "hltPixelTracksGlbTrkMuon",
227 "hltPixelTracksHighPtTkMuIso",
228 "hltPixelTracksHybrid",
229 "hltPixelTracksForPhotons",
230 "hltPixelTracksForEgamma",
231 "hltPixelTracksElectrons",
232 "hltPixelTracksForHighPt",
233 "hltHighPtPixelTracks",
234 "hltPixelTracksForNoPU",
236 "hltFastPixelHitsVertex",
237 "hltFastPixelTracks",
238 "hltFastPixelTracksRecover",
240 "hltPixelLayerPairs",
241 "hltPixelLayerTriplets",
242 "hltPixelLayerTripletsReg",
243 "hltPixelLayerTripletsHITHB",
244 "hltPixelLayerTripletsHITHE",
245 "hltMixedLayerPairs",
247 "hltFastPrimaryVertexbbPhi",
248 "hltPixelTracksFastPVbbPhi",
249 "hltPixelTracksRecoverbbPhi",
250 "hltFastPixelHitsVertexVHbb",
251 "hltFastPixelTracksVHbb",
252 "hltFastPixelTracksRecoverVHbb",
254 "hltFastPrimaryVertex",
255 "hltFastPVPixelVertexFilter",
256 "hltFastPVPixelTracks",
257 "hltFastPVPixelTracksRecover",
269 "hltScalersRawToDigi",
270 "hltEcalPreshowerDigis",
272 "hltEcalDetIdToBeRecovered",
276 SequencesToRemove = (
277 "HLTL1SeededEgammaRegionalRecoTrackerSequence",
278 "HLTEcalActivityEgammaRegionalRecoTrackerSequence",
279 "HLTPixelMatchElectronActivityTrackingSequence",
280 "HLTDoLocalStripSequence",
281 "HLTDoLocalPixelSequence",
282 "HLTDoLocalPixelSequenceRegL2Tau",
283 "HLTDoLocalStripSequenceReg",
284 "HLTDoLocalPixelSequenceReg",
285 "HLTDoLocalStripSequenceRegForBTag",
286 "HLTDoLocalPixelSequenceRegForBTag",
287 "HLTDoLocalPixelSequenceRegForNoPU",
291 "HLTRecopixelvertexingSequence",
294 "HLTBeginSequenceNZS",
295 "HLTBeginSequenceBPTX",
296 "HLTBeginSequenceAntiBPTX",
297 "HLTHBHENoiseSequence",
298 "HLTIterativeTrackingIter04",
299 "HLTIterativeTrackingIter02",
300 "HLTIterativeTracking",
301 "HLTIterativeTrackingForHighPt",
302 "HLTIterativeTrackingTau3Mu",
303 "HLTIterativeTrackingReg",
304 "HLTIterativeTrackingForElectronIter02",
305 "HLTIterativeTrackingForPhotonsIter02",
306 "HLTIterativeTrackingL3MuonIter02",
307 "HLTIterativeTrackingGlbTrkMuonIter02",
308 "HLTIterativeTrackingL3MuonRegIter02",
309 "HLTIterativeTrackingHighPtTkMu",
310 "HLTIterativeTrackingHighPtTkMuIsoIter02",
311 "HLTIterativeTrackingForBTagIter02",
312 "HLTIterativeTrackingForBTagIter12",
313 "HLTIterativeTrackingForTauIter04",
314 "HLTIterativeTrackingForTauIter02",
315 "HLTIterativeTrackingDisplacedJpsiIter02",
316 "HLTIterativeTrackingDisplacedPsiPrimeIter02",
317 "HLTIterativeTrackingDisplacedNRMuMuIter02",
318 "HLTIterativeTrackingForBTagIteration0",
319 "HLTIterativeTrackingIteration4DisplacedJets",
320 "HLTRegionalCKFTracksForL3Isolation",
321 "HLTHBHENoiseCleanerSequence",
325 for label
in ESModulesToRemove:
326 if (hasattr(process,label)):
327 delattr(process,label)
332 HLTSchedule = tuple( path.label_()
for path
in process.HLTSchedule)
333 for black
in fastSimUnsupportedPaths:
334 compiled = re.compile(fnmatch.translate(black))
335 for path
in HLTSchedule:
336 if compiled.search(path)
is not None:
337 ExplicitList += [path]
339 for path
in ExplicitList:
340 if path
not in UniqueList:
342 for path
in UniqueList:
343 process.schedule.remove(getattr(process,path))
344 process.setSchedule_(process.schedule)
348 if hasattr(process,
'streams'):
349 delattr(process,
'streams')
350 if hasattr(process,
'datasets'):
351 delattr(process,
'datasets')
354 for label
in SequencesToRemove:
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 for label
in ModulesToRemove:
376 if hasattr(process,label):
377 if hasattr(fastsim,label):
378 setattr(process,label,getattr(fastsim,label))
380 object = getattr(process,label)
381 list = tuple(process.sequences_().
keys())
383 sequence = getattr(process,name)
386 more = sequence.remove(object)
387 list = tuple(process.paths_().
keys())
389 path = getattr(process,name)
392 more = path.remove(object)
393 delattr(process,label)
396 if hasattr(process,
'hltGetConditions')
and hasattr(process,
'HLTriggerFirstPath'):
397 process.hltDummyConditions = cms.EDFilter(
"HLTBool", result = cms.bool(
True ) )
398 process.HLTriggerFirstPath.replace(process.hltGetConditions,process.hltDummyConditions)
399 if hasattr(process,
'hltPixelVertices'):
400 process.hltPixelVertices.beamSpot = cms.InputTag(
'offlineBeamSpot')
401 specialModules = (
'hltEcalRecHit',
'hltEcalPreshowerRecHit', )
402 for label
in specialModules:
403 if hasattr(process,label):
404 setattr(fastsim,label,getattr(process,label))
407 for label
in fastsim.producers_().
keys():
408 if hasattr(process,label):
409 setattr(process,label,getattr(fastsim,label))
410 for label
in fastsim.filters_().
keys():
411 if hasattr(process,label):
412 setattr(process,label,getattr(fastsim,label))
413 for label
in fastsim.analyzers_().
keys():
414 if hasattr(process,label):
415 setattr(process,label,getattr(fastsim,label))
416 for label
in fastsim.sequences_().
keys():
417 if hasattr(process,label):
418 setattr(process,label,getattr(fastsim,label))
423 (
'hltGtDigis',
'gtDigis'),
424 (
'hltL1GtObjectMap',
'gtDigis'),
425 (
'hltEcalDigis:ebDigis',
'ecalDigis:ebDigis'),
426 (
'hltEcalDigis:eeDigis',
'ecalDigis:eeDigis'),
427 (
'hltMuonCSCDigis',
'muonCSCDigis'),
428 (
'hltMuonCSCDigis:MuonCSCStripDigi',
'muonCSCDigis:MuonCSCStripDigi'),
429 (
'hltMuonCSCDigis:MuonCSCWireDigi',
'muonCSCDigis:MuonCSCWireDigi'),
430 (
'hltMuonDTDigis',
'muonDTDigis'),
431 (
'hltMuonRPCDigis',
'muonRPCDigis'),
432 (
'hltEcalPreshowerDigis',
'ecalPreshowerDigis'),
433 (
'hltHbhereco',
'hbhereco'),
434 (
'hltHoreco',
'horeco'),
435 (
'hltHfreco',
'hfreco'),
437 (
'hltIter2Merged',
'generalTracks'),
438 (
'hltIter2HighPtMerged',
'generalTracks'),
439 (
'hltIter2MergedForElectrons',
'generalTracks'),
440 (
'hltIter2MergedForPhotons',
'generalTracks'),
441 (
'hltIter2L3MuonMerged',
'generalTracks'),
442 (
'hltIter2MergedForBTag',
'generalTracks'),
443 (
'hltIter2MergedForTau',
'generalTracks'),
444 (
'hltIter2GlbTrkMuonMerged',
'generalTracks'),
445 (
'hltIter2HighPtTkMuMerged',
'generalTracks'),
446 (
'hltIter2HighPtTkMuIsoMerged',
'generalTracks'),
447 (
'hltIter2DisplacedJpsiMerged',
'generalTracks'),
448 (
'hltIter2DisplacedPsiPrimeMerged',
'generalTracks'),
449 (
'hltIter2DisplacedNRMuMuMerged',
'generalTracks'),
450 (
'hltIter0PFlowTrackSelectionHighPurityForBTag',
'generalTracks'),
451 (
'hltIter4HighPtMerged',
'generalTracks'),
453 (
'hltRegionalTracksForL3MuonIsolation',
'hltPixelTracks'),
455 (
'hltL1extraParticles',
'l1extraParticles'),
456 (
'hltL1extraParticles:Central',
'l1extraParticles:Central'),
457 (
'hltL1extraParticles:Forward',
'l1extraParticles:Forward'),
458 (
'hltL1extraParticles:Isolated',
'l1extraParticles:Isolated'),
459 (
'hltL1extraParticles:NonIsolated',
'l1extraParticles:NonIsolated'),
460 (
'hltL1extraParticles:Tau',
'l1extraParticles:Tau'),
461 (
'hltL1extraParticles:IsoTau',
'l1extraParticles:IsoTau'),
462 (
'hltOfflineBeamSpot',
'offlineBeamSpot'),
463 (
'hltOnlineBeamSpot',
'offlineBeamSpot'),
464 (
'hltSiStripClusters',
'MeasurementTrackerEvent'),
467 from HLTrigger.Configuration.CustomConfigs
import MassReplaceInputTag
468 for pair
in InputTags:
473 (
'GMTReadoutCollection',cms.InputTag(
'gtDigis'),cms.InputTag(
'gmtDigis')),
474 (
'killDeadChannels',cms.bool(
True),cms.bool(
False)),
475 (
'recoverEBFE',cms.bool(
True),cms.bool(
False)),
476 (
'recoverEEFE',cms.bool(
True),cms.bool(
False)),
477 (
'src',cms.InputTag(
'hltHcalTowerNoiseCleaner'),cms.InputTag(
'hltTowerMakerForAll')),
478 (
'initialSeeds',cms.InputTag(
'noSeedsHere'),cms.InputTag(
'globalPixelSeeds')),
479 (
'preFilteredSeeds',cms.bool(
True),cms.bool(
False)),
481 from HLTrigger.Configuration.CustomConfigs
import MassReplaceParameter
482 for thrice
in NamedParameters:
486 for label
in (
'hltEgammaElectronPixelSeeds',
'hltEgammaElectronPixelSeedsUnseeded',):
487 if hasattr(process,label):
488 getattr(process,label).SeedConfiguration.initialSeeds = cms.InputTag(
'globalPixelSeeds')
489 getattr(process,label).SeedConfiguration.preFilteredSeeds = cms.bool(
False)
490 if hasattr(fastsim,
'globalPixelSeeds'):
491 if hasattr(fastsim.globalPixelSeeds,
'outputSeedCollectionName'):
492 getattr(process,label).SeedConfiguration.initialSeeds = cms.InputTag(
'globalPixelSeeds',fastsim.globalPixelSeeds.outputSeedCollectionName.value())
496 fastsim.extend(process)
497 fastsim.setSchedule_(fastsim.schedule)