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