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)
23 if 'hltHbhereco' in process.__dict__:
24 process.hltHbhereco.pedestalSubtractionType = cms.int32( 1 )
25 process.hltHbhereco.pedestalUpperLimit = cms.double( 2.7 )
26 process.hltHbhereco.timeSlewParsType = cms.int32( 3 )
28 process.hltHbhereco.timeSlewPars = cms.vdouble( 12.2999, -2.19142, 0, 12.2999, -2.19142, 0, 12.2999, -2.19142, 0 )
30 process.hltHbhereco.respCorrM3 = cms.double( 1.0 )
35 fastsim = cms.ProcessFragment( process.name_() )
36 fastsim.load(
"FastSimulation.HighLevelTrigger.HLTSetup_cff" )
38 fastSimUnsupportedPaths = (
43 "HLT_*Calibration_v*",
48 "HLT_Activity_Ecal*_v*",
51 "HLT_L1SingleMuOpen_AntiBPTX_v*",
52 "HLT_JetE*_NoBPTX*_v*",
53 "HLT_L2Mu*_NoBPTX*_v*",
57 "HLT_GlobalRunHPDNoise_v*",
58 "HLT_L1TrackerCosmics_v*",
62 "HLT_DoubleMu33NoFiltersNoVtx_v*",
63 "HLT_DoubleMu38NoFiltersNoVtx_v*",
64 "HLT_Mu38NoFiltersNoVtx_Photon38_CaloIdL_v*",
65 "HLT_Mu42NoFiltersNoVtx_Photon42_CaloIdL_v*",
66 "HLT_DoubleMu23NoFiltersNoVtxDisplaced_v*",
67 "HLT_DoubleMu28NoFiltersNoVtxDisplaced_v*",
68 "HLT_Mu28NoFiltersNoVtxDisplaced_Photon28_CaloIdL_v*",
69 "HLT_Mu33NoFiltersNoVtxDisplaced_Photon33_CaloIdL_v*",
70 "HLT_HT350_DisplacedDijet80_Tight_DisplacedTrack_v*",
71 "HLT_HT350_DisplacedDijet80_DisplacedTrack_v*",
72 "HLT_HT500_DisplacedDijet40_Inclusive_v*",
73 "HLT_HT350_DisplacedDijet40_DisplacedTrack_v*",
74 "HLT_HT550_DisplacedDijet40_Inclusive_v*",
75 "HLT_HT350_DisplacedDijet80_DisplacedTrack_v*",
76 "HLT_HT400_DisplacedDijet40_Inclusive_v*",
77 "HLT_HT250_DisplacedDijet40_DisplacedTrack_v*",
78 "HLT_HT200_DisplacedDijet40_DisplacedTrack_v*",
79 "HLT_HT350_DisplacedDijet40_Inclusive_v*",
80 "HLT_TrkMu15_DoubleTrkMu5NoFiltersNoVtx_v*",
81 "HLT_TrkMu17_DoubleTrkMu8NoFiltersNoVtx_v*",
83 "HLT_MET75_IsoTrk50_v*",
84 "HLT_MET90_IsoTrk50_v*",
85 "HLT_VBF_DisplacedJet40_DisplacedTrack_v*",
86 "HLT_VBF_DisplacedJet40_TightID_DisplacedTrack_v*",
87 "HLT_VBF_DisplacedJet40_VTightID_DisplacedTrack_v*",
88 "HLT_VBF_DisplacedJet40_VVTightID_DisplacedTrack_v*",
89 "HLT_VBF_DisplacedJet40_Hadronic_2PromptTrack_v*",
90 "HLT_VBF_DisplacedJet40_DisplacedTrack_2TrackIP2DSig5_v*",
91 "HLT_Mu33NoFiltersNoVtxDisplaced_DisplacedJet50_Tight_v*",
92 "HLT_Mu33NoFiltersNoVtxDisplaced_DisplacedJet50_Loose_v*",
93 "HLT_Mu38NoFiltersNoVtxDisplaced_DisplacedJet60_Tight_v*",
94 "HLT_Mu38NoFiltersNoVtxDisplaced_DisplacedJet60_Loose_v*",
95 "HLT_Mu38NoFiltersNoVtx_DisplacedJet60_Loose_v*",
96 "HLT_Mu28NoFiltersNoVtx_DisplacedJet40_Loose_v*",
97 "HLT_Mu28NoFiltersNoVtx_CentralCaloJet40_v*",
98 "HLT_Mu23NoFiltersNoVtx_Photon23_CaloIdL_v*",
99 "HLT_DoubleMu18NoFiltersNoVtx_v*",
100 "HLT_DoubleMuNoFiltersNoVtx_SaveObjects_v*",
101 "MC_DoubleMuNoFiltersNoVtx_v*",
102 "HLT_L1MuOpenNotHF2Pixel_SingleTrack*",
103 "HLT_L1TOTEM0_RomanPotsAND_PixelClusters*",
106 ESModulesToRemove = (
128 "hltCkfL1SeededTrackCandidates",
129 "hltCtfL1SeededithMaterialTracks",
130 "hltCkf3HitL1SeededTrackCandidates",
131 "hltCtf3HitL1SeededWithMaterialTracks",
132 "hltCkf3HitActivityTrackCandidates",
133 "hltCtf3HitActivityWithMaterialTracks",
134 "hltActivityCkfTrackCandidatesForGSF",
135 "hltL1SeededCkfTrackCandidatesForGSF",
136 "hltMuCkfTrackCandidates",
138 "hltTau3MuCkfTrackCandidates",
139 "hltTau3MuCtfWithMaterialTracks",
140 "hltMuTrackJpsiCkfTrackCandidates",
141 "hltMuTrackJpsiCtfTracks",
142 "hltMuTrackJpsiEffCkfTrackCandidates",
143 "hltMuTrackJpsiEffCtfTracks",
144 "hltJpsiTkPixelSeedFromL3Candidate",
145 "hltCkfTrackCandidatesJpsiTk",
146 "hltCtfWithMaterialTracksJpsiTk",
147 "hltMuTrackCkfTrackCandidatesOnia",
148 "hltMuTrackCtfTracksOnia",
151 "hltL3TrajSeedOIHit",
152 "hltL3TrajSeedIOHit",
153 "hltL3NoFiltersTrajSeedOIHit",
154 "hltL3NoFiltersTrajSeedIOHit",
155 "hltL3TrackCandidateFromL2OIState",
156 "hltL3TrackCandidateFromL2OIHit",
157 "hltL3TrackCandidateFromL2IOHit",
158 "hltL3TrackCandidateFromL2NoVtx",
163 "hltESRawToRecHitFacility",
167 "hltEgammaCkfTrackCandidatesForGSF",
168 "hltEgammaGsfTracks",
169 "hltEgammaCkfTrackCandidatesForGSFUnseeded",
170 "hltEgammaGsfTracksUnseeded",
172 "hltPFJetCkfTrackCandidates",
173 "hltPFJetCtfWithMaterialTracks",
174 "hltPFlowTrackSelectionHighPurity",
176 "hltDisplacedHT250L1FastJetRegionalPixelSeedGenerator",
177 "hltDisplacedHT250L1FastJetRegionalCkfTrackCandidates",
178 "hltDisplacedHT250L1FastJetRegionalCtfWithMaterialTracks",
179 "hltDisplacedHT300L1FastJetRegionalPixelSeedGenerator",
180 "hltDisplacedHT300L1FastJetRegionalCkfTrackCandidates",
181 "hltDisplacedHT300L1FastJetRegionalCtfWithMaterialTracks",
182 "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJet",
183 "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJet",
184 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJet",
185 "hltBLifetimeRegionalPixelSeedGeneratorHbbVBF",
186 "hltBLifetimeRegionalCkfTrackCandidatesHbbVBF",
187 "hltBLifetimeRegionalCtfWithMaterialTracksHbbVBF",
188 "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
189 "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
190 "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
191 "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
192 "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
193 "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
195 "hltBLifetimeRegionalPixelSeedGeneratorHbb",
196 "hltBLifetimeRegionalCkfTrackCandidatesHbb",
197 "hltBLifetimeRegionalCtfWithMaterialTracksHbb",
198 "hltBLifetimeRegionalPixelSeedGeneratorbbPhi",
199 "hltBLifetimeRegionalCkfTrackCandidatesbbPhi",
200 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhi",
201 "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
202 "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
203 "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
204 "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
205 "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
206 "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
207 "hltBLifetimeFastRegionalPixelSeedGeneratorHbbVBF",
208 "hltBLifetimeFastRegionalCkfTrackCandidatesHbbVBF",
209 "hltBLifetimeFastRegionalCtfWithMaterialTracksHbbVBF",
210 "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJetFastPV",
211 "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJetFastPV",
212 "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJetFastPV",
213 "hltFastPixelBLifetimeRegionalPixelSeedGeneratorHbb",
214 "hltFastPixelBLifetimeRegionalCkfTrackCandidatesHbb",
215 "hltFastPixelBLifetimeRegionalCtfWithMaterialTracksHbb",
217 "hltPixelTracksForMinBias",
218 "hltPixelTracksForMinBias01",
219 "hltPixelTracksForHighMult",
220 "hltRegionalPixelTracks",
222 "hltPixelTracksL3Muon",
223 "hltPixelTracksGlbTrkMuon",
224 "hltPixelTracksHighPtTkMuIso",
225 "hltPixelTracksHybrid",
226 "hltPixelTracksForPhotons",
227 "hltPixelTracksForEgamma",
228 "hltPixelTracksElectrons",
229 "hltPixelTracksForHighPt",
230 "hltHighPtPixelTracks",
231 "hltPixelTracksForNoPU",
233 "hltFastPixelHitsVertex",
234 "hltFastPixelTracks",
235 "hltFastPixelTracksRecover",
237 "hltPixelLayerPairs",
238 "hltPixelLayerTriplets",
239 "hltPixelLayerTripletsReg",
240 "hltPixelLayerTripletsHITHB",
241 "hltPixelLayerTripletsHITHE",
242 "hltMixedLayerPairs",
244 "hltFastPrimaryVertexbbPhi",
245 "hltPixelTracksFastPVbbPhi",
246 "hltPixelTracksRecoverbbPhi",
247 "hltFastPixelHitsVertexVHbb",
248 "hltFastPixelTracksVHbb",
249 "hltFastPixelTracksRecoverVHbb",
251 "hltFastPrimaryVertex",
252 "hltFastPVPixelVertexFilter",
253 "hltFastPVPixelTracks",
254 "hltFastPVPixelTracksRecover",
266 "hltScalersRawToDigi",
267 "hltEcalPreshowerDigis",
269 "hltEcalDetIdToBeRecovered",
273 SequencesToRemove = (
274 "HLTL1SeededEgammaRegionalRecoTrackerSequence",
275 "HLTEcalActivityEgammaRegionalRecoTrackerSequence",
276 "HLTPixelMatchElectronActivityTrackingSequence",
277 "HLTDoLocalStripSequence",
278 "HLTDoLocalPixelSequence",
279 "HLTDoLocalPixelSequenceRegL2Tau",
280 "HLTDoLocalStripSequenceReg",
281 "HLTDoLocalPixelSequenceReg",
282 "HLTDoLocalStripSequenceRegForBTag",
283 "HLTDoLocalPixelSequenceRegForBTag",
284 "HLTDoLocalPixelSequenceRegForNoPU",
286 "HLTBeginSequenceNZS",
287 "HLTBeginSequenceBPTX",
288 "HLTBeginSequenceAntiBPTX",
289 "HLTHBHENoiseSequence",
290 "HLTIterativeTrackingIter04",
291 "HLTIterativeTrackingIter02",
292 "HLTIterativeTracking",
293 "HLTIterativeTrackingForHighPt",
294 "HLTIterativeTrackingTau3Mu",
295 "HLTIterativeTrackingReg",
296 "HLTIterativeTrackingForPA",
297 "HLTPAIterativeTracking",
298 "HLTIterativeTrackingForElectronIter02",
299 "HLTIterativeTrackingForPhotonsIter02",
300 "HLTIterativeTrackingL3MuonIter02",
301 "HLTIterativeTrackingGlbTrkMuonIter02",
302 "HLTIterativeTrackingL3MuonRegIter02",
303 "HLTIterativeTrackingHighPtTkMu",
304 "HLTIterativeTrackingHighPtTkMuIsoIter02",
305 "HLTIterativeTrackingForBTagIter02",
306 "HLTIterativeTrackingForBTagIter12",
307 "HLTIterativeTrackingForTauIter04",
308 "HLTIterativeTrackingForTauIter02",
309 "HLTIterativeTrackingDisplacedJpsiIter02",
310 "HLTIterativeTrackingDisplacedPsiPrimeIter02",
311 "HLTIterativeTrackingDisplacedNRMuMuIter02",
312 "HLTIterativeTrackingForBTagIteration0",
313 "HLTIterativeTrackingIteration4DisplacedJets",
314 "HLTRegionalCKFTracksForL3Isolation",
315 "HLTHBHENoiseCleanerSequence",
319 for label
in ESModulesToRemove:
320 if (hasattr(process,label)):
321 delattr(process,label)
326 HLTSchedule = tuple( path.label_()
for path
in process.HLTSchedule)
327 for path
in HLTSchedule:
328 getattr(process,path).
insert(1,process.HLTL1UnpackerSequence)
329 for black
in fastSimUnsupportedPaths:
330 compiled = re.compile(fnmatch.translate(black))
331 for path
in HLTSchedule:
332 if compiled.search(path)
is not None:
333 ExplicitList += [path]
335 for path
in ExplicitList:
336 if path
not in UniqueList:
338 for path
in UniqueList:
339 process.schedule.remove(getattr(process,path))
340 process.setSchedule_(process.schedule)
344 if hasattr(process,
'streams'):
345 delattr(process,
'streams')
346 if hasattr(process,
'datasets'):
347 delattr(process,
'datasets')
350 for label
in SequencesToRemove:
351 if hasattr(process,label):
352 if hasattr(fastsim,label):
353 setattr(process,label,getattr(fastsim,label))
355 object = getattr(process,label)
356 list = tuple(process.sequences_().
keys())
358 sequence = getattr(process,name)
361 more = sequence.remove(object)
362 list = tuple(process.paths_().
keys())
364 path = getattr(process,name)
367 more = path.remove(object)
368 delattr(process,label)
371 for label
in ModulesToRemove:
372 if hasattr(process,label):
373 if hasattr(fastsim,label):
374 setattr(process,label,getattr(fastsim,label))
376 object = getattr(process,label)
378 list = tuple(process.sequences_().
keys())
380 sequence = getattr(process,name)
383 more = sequence.remove(object)
385 list = tuple(process.paths_().
keys())
387 path = getattr(process,name)
390 more = path.remove(object)
392 list = tuple(process.endpaths_().
keys())
394 path = getattr(process,name)
397 more = path.remove(object)
398 delattr(process,label)
401 if hasattr(process,
'hltGetConditions')
and hasattr(process,
'HLTriggerFirstPath'):
402 process.hltDummyConditions = cms.EDFilter(
"HLTBool", result = cms.bool(
True ) )
403 process.HLTriggerFirstPath.replace(process.hltGetConditions,process.hltDummyConditions)
404 if hasattr(process,
'hltPixelVertices'):
405 process.hltPixelVertices.beamSpot = cms.InputTag(
'offlineBeamSpot')
406 specialModules = (
'hltEcalRecHit',
'hltEcalPreshowerRecHit', )
407 for label
in specialModules:
408 if hasattr(process,label):
409 setattr(fastsim,label,getattr(process,label))
412 for label
in fastsim.producers_().
keys():
413 if hasattr(process,label):
414 setattr(process,label,getattr(fastsim,label))
415 for label
in fastsim.filters_().
keys():
416 if hasattr(process,label):
417 setattr(process,label,getattr(fastsim,label))
418 for label
in fastsim.analyzers_().
keys():
419 if hasattr(process,label):
420 setattr(process,label,getattr(fastsim,label))
421 for label
in fastsim.sequences_().
keys():
422 if hasattr(process,label):
423 setattr(process,label,getattr(fastsim,label))
430 (
'hltEcalDigis:ebDigis',
'ecalDigis:ebDigis'),
431 (
'hltEcalDigis:eeDigis',
'ecalDigis:eeDigis'),
432 (
'hltMuonCSCDigis',
'muonCSCDigis'),
433 (
'hltMuonCSCDigis:MuonCSCStripDigi',
'muonCSCDigis:MuonCSCStripDigi'),
434 (
'hltMuonCSCDigis:MuonCSCWireDigi',
'muonCSCDigis:MuonCSCWireDigi'),
435 (
'hltMuonDTDigis',
'muonDTDigis'),
436 (
'hltMuonRPCDigis',
'muonRPCDigis'),
437 (
'hltEcalPreshowerDigis',
'ecalPreshowerDigis'),
438 (
'hltHbhereco',
'hbhereco'),
439 (
'hltHoreco',
'horeco'),
440 (
'hltHfreco',
'hfreco'),
442 (
'hltIter2Merged',
'generalTracks'),
443 (
'hltIter2HighPtMerged',
'generalTracks'),
444 (
'hltIter2MergedForElectrons',
'generalTracks'),
445 (
'hltIter2MergedForPhotons',
'generalTracks'),
446 (
'hltIter2L3MuonMerged',
'generalTracks'),
447 (
'hltIter2MergedForBTag',
'generalTracks'),
448 (
'hltIter2MergedForTau',
'generalTracks'),
449 (
'hltIter2GlbTrkMuonMerged',
'generalTracks'),
450 (
'hltIter2HighPtTkMuMerged',
'generalTracks'),
451 (
'hltIter2HighPtTkMuIsoMerged',
'generalTracks'),
452 (
'hltIter2DisplacedJpsiMerged',
'generalTracks'),
453 (
'hltIter2DisplacedPsiPrimeMerged',
'generalTracks'),
454 (
'hltIter2DisplacedNRMuMuMerged',
'generalTracks'),
455 (
'hltIter0PFlowTrackSelectionHighPurityForBTag',
'generalTracks'),
456 (
'hltIter4HighPtMerged',
'generalTracks'),
457 (
'hltIterativeTrackingForPAMerged',
'generalTracks'),
458 (
'hltPAIterativeTrackingMerged',
'generalTracks'),
460 (
'hltFastPVPixelTracks',
'hltPixelTracks'),
461 (
'hltFastPVPixelTracksRecover',
'hltPixelTracks'),
462 (
'hltPixelTracksL3Muon',
'hltPixelTracks'),
463 (
'hltPixelTracksGlbTrkMuon',
'hltPixelTracks'),
464 (
'hltPixelTracksHighPtTkMuIso',
'hltPixelTracks'),
465 (
'hltPixelTracksHybrid',
'hltPixelTracks'),
466 (
'hltPixelTracksForPhotons',
'hltPixelTracks'),
467 (
'hltPixelTracksForEgamma',
'hltPixelTracks'),
468 (
'hltPixelTracksElectrons',
'hltPixelTracks'),
469 (
'hltPixelTracksForHighPt',
'hltPixelTracks'),
470 (
'hltHighPtPixelTracks',
'hltPixelTracks'),
471 (
'hltPixelTracksForNoPU',
'hltPixelTracks'),
473 (
'hltL1extraParticles',
'l1extraParticles'),
474 (
'hltL1extraParticles:Central',
'l1extraParticles:Central'),
475 (
'hltL1extraParticles:Forward',
'l1extraParticles:Forward'),
476 (
'hltL1extraParticles:Isolated',
'l1extraParticles:Isolated'),
477 (
'hltL1extraParticles:NonIsolated',
'l1extraParticles:NonIsolated'),
478 (
'hltL1extraParticles:Tau',
'l1extraParticles:Tau'),
479 (
'hltL1extraParticles:IsoTau',
'l1extraParticles:IsoTau'),
480 (
'hltOfflineBeamSpot',
'offlineBeamSpot'),
481 (
'hltOnlineBeamSpot',
'offlineBeamSpot'),
482 (
'hltSiStripClusters',
'MeasurementTrackerEvent'),
485 from HLTrigger.Configuration.CustomConfigs
import MassReplaceInputTag
486 for pair
in InputTags:
492 (
'killDeadChannels',cms.bool(
True),cms.bool(
False)),
493 (
'recoverEBFE',cms.bool(
True),cms.bool(
False)),
494 (
'recoverEEFE',cms.bool(
True),cms.bool(
False)),
495 (
'src',cms.InputTag(
'hltHcalTowerNoiseCleaner'),cms.InputTag(
'hltTowerMakerForAll')),
496 (
'src',cms.InputTag(
'hltHcalTowerNoiseCleanerWithrechit'),cms.InputTag(
'hltTowerMakerForAll')),
497 (
'initialSeeds',cms.InputTag(
'noSeedsHere'),cms.InputTag(
'hltPixelPairSeeds')),
498 (
'preFilteredSeeds',cms.bool(
True),cms.bool(
False)),
500 from HLTrigger.Configuration.CustomConfigs
import MassReplaceParameter
501 for thrice
in NamedParameters:
505 for label
in (
'hltEgammaElectronPixelSeeds',
'hltEgammaElectronPixelSeedsUnseeded',):
506 if hasattr(process,label):
507 getattr(process,label).SeedConfiguration.initialSeeds = cms.InputTag(
'hltPixelPairSeeds')
508 getattr(process,label).SeedConfiguration.preFilteredSeeds = cms.bool(
False)
511 fastsim.extend(process)
512 fastsim.setSchedule_(fastsim.schedule)
515 if hasattr(fastsim,
'hltL1extraParticles'):
516 getattr(fastsim,
'HLTBeginSequence').
remove(getattr(process,
'offlineBeamSpot'))
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)