CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
customizeHLTforMC.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 def customizeHLTforFastSim(process,_fastSim=True):
4  process=customizeHLTforMC(process,_fastSim)
5  return process
6 
7 def customizeHLTforFullSim(process,_fastSim=False):
8  process=customizeHLTforMC(process,_fastSim)
9  return process
10 
11 def customizeHLTforMC(process,_fastSim=False):
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"""
15 
16  # PFRecHitProducerHCAL
17  if 'hltParticleFlowRecHitHCAL' in process.__dict__:
18  process.hltParticleFlowRecHitHCAL.ApplyPulseDPG = cms.bool(False)
19  process.hltParticleFlowRecHitHCAL.LongShortFibre_Cut = cms.double(1000000000.0)
20 
21  # customise hltHbhereco to use the Method 3 time slew parametrization and response correction for Monte Carlo (PR #11091)
22  if 'hltHbhereco' in process.__dict__:
23  if process.hltHbhereco._TypedParameterizable__type == 'HcalHitReconstructor':
24  # 2015-2016 Run 2
25  process.hltHbhereco.pedestalSubtractionType = cms.int32( 1 )
26  process.hltHbhereco.pedestalUpperLimit = cms.double( 2.7 )
27  process.hltHbhereco.timeSlewParsType = cms.int32( 3 )
28  # new time slew parametrisation
29  process.hltHbhereco.timeSlewPars = cms.vdouble( 12.2999, -2.19142, 0, 12.2999, -2.19142, 0, 12.2999, -2.19142, 0 )
30  # old response correction, matching the 2015D 25ns data
31  process.hltHbhereco.respCorrM3 = cms.double( 1.0 )
32  else:
33  # 2017 Phase I
34  process.hltHbhereco.algorithm.respCorrM3 = cms.double( 1.0 )
35 
36  if _fastSim:
37 
38  fastsim = cms.ProcessFragment( process.name_() )
39  fastsim.load( "FastSimulation.HighLevelTrigger.HLTSetup_cff" )
40 
41  fastSimUnsupportedPaths = (
42 
43  # paths for which a recovery is not foreseen/possible
44  "AlCa_*_v*",
45  "DQM_*_v*",
46  "HLT_*Calibration_v*",
47  "HLT_DTErrors_v*",
48  "HLT_Random_v*",
49  "HLT_HcalNZS_v*",
50  "HLT_HcalPhiSym_v*",
51  "HLT_Activity_Ecal*_v*",
52  "HLT_IsoTrackHB_v*",
53  "HLT_IsoTrackHE_v*",
54  "HLT_L1SingleMuOpen_AntiBPTX_v*",
55  "HLT_JetE*_NoBPTX*_v*",
56  "HLT_L2Mu*_NoBPTX*_v*",
57  "HLT_Beam*_v*",
58  #"HLT_L1Tech_*_v*",
59  "HLT_HI*",
60  "HLT_PA*",
61  "HLT_GlobalRunHPDNoise_v*",
62  "HLT_L1TrackerCosmics_v*",
63  "HLT_HcalUTCA_v*",
64  "HLT_L1FatEvents_v*",
65 
66  # TODO: paths not supported by FastSim, but for which a recovery should be attempted
67  "HLT_DoubleMu33NoFiltersNoVtx_v*",
68  "HLT_DoubleMu38NoFiltersNoVtx_v*",
69  "HLT_Mu38NoFiltersNoVtx_Photon38_CaloIdL_v*",
70  "HLT_Mu42NoFiltersNoVtx_Photon42_CaloIdL_v*",
71  "HLT_DoubleMu23NoFiltersNoVtxDisplaced_v*",
72  "HLT_DoubleMu28NoFiltersNoVtxDisplaced_v*",
73  "HLT_Mu28NoFiltersNoVtxDisplaced_Photon28_CaloIdL_v*",
74  "HLT_Mu33NoFiltersNoVtxDisplaced_Photon33_CaloIdL_v*",
75  "HLT_HT350_DisplacedDijet80_Tight_DisplacedTrack_v*",
76  "HLT_HT350_DisplacedDijet80_DisplacedTrack_v*",
77  "HLT_HT500_DisplacedDijet40_Inclusive_v*",
78  "HLT_HT350_DisplacedDijet40_DisplacedTrack_v*",
79  "HLT_HT550_DisplacedDijet40_Inclusive_v*",
80  "HLT_HT350_DisplacedDijet80_DisplacedTrack_v*",
81  "HLT_HT400_DisplacedDijet40_Inclusive_v*",
82  "HLT_HT250_DisplacedDijet40_DisplacedTrack_v*",
83  "HLT_HT200_DisplacedDijet40_DisplacedTrack_v*",
84  "HLT_HT350_DisplacedDijet40_Inclusive_v*",
85  "HLT_TrkMu15_DoubleTrkMu5NoFiltersNoVtx_v*",
86  "HLT_TrkMu17_DoubleTrkMu8NoFiltersNoVtx_v*",
87  "HLT_MET60_IsoTrk*",
88  "HLT_MET75_IsoTrk50_v*",
89  "HLT_MET90_IsoTrk50_v*",
90  "HLT_VBF_DisplacedJet40_DisplacedTrack_v*",
91  "HLT_VBF_DisplacedJet40_TightID_DisplacedTrack_v*",
92  "HLT_VBF_DisplacedJet40_VTightID_DisplacedTrack_v*",
93  "HLT_VBF_DisplacedJet40_VVTightID_DisplacedTrack_v*",
94  "HLT_VBF_DisplacedJet40_Hadronic_2PromptTrack_v*",
95  "HLT_VBF_DisplacedJet40_DisplacedTrack_2TrackIP2DSig5_v*",
96  "HLT_Mu33NoFiltersNoVtxDisplaced_DisplacedJet50_Tight_v*",
97  "HLT_Mu33NoFiltersNoVtxDisplaced_DisplacedJet50_Loose_v*",
98  "HLT_Mu38NoFiltersNoVtxDisplaced_DisplacedJet60_Tight_v*",
99  "HLT_Mu38NoFiltersNoVtxDisplaced_DisplacedJet60_Loose_v*",
100  "HLT_Mu38NoFiltersNoVtx_DisplacedJet60_Loose_v*",
101  "HLT_Mu28NoFiltersNoVtx_DisplacedJet40_Loose_v*",
102  "HLT_Mu28NoFiltersNoVtx_CentralCaloJet40_v*",
103  "HLT_Mu23NoFiltersNoVtx_Photon23_CaloIdL_v*",
104  "HLT_DoubleMu18NoFiltersNoVtx_v*",
105  "HLT_DoubleMuNoFiltersNoVtx_SaveObjects_v*",
106  "MC_DoubleMuNoFiltersNoVtx_v*",
107  "HLT_L1MuOpenNotHF2Pixel_SingleTrack*",
108  "HLT_L1TOTEM0_RomanPotsAND_PixelClusters*",
109  )
110 
111  ESModulesToRemove = (
112 # "CaloTowerGeometryFromDBEP",
113 # "CastorGeometryFromDBEP",
114 # "EcalBarrelGeometryFromDBEP",
115 # "EcalEndcapGeometryFromDBEP",
116 # "EcalPreshowerGeometryFromDBEP",
117 # "HcalGeometryFromDBEP",
118 # "ZdcGeometryFromDBEP",
119 # "XMLFromDBSource",
120 # "sistripconn",
121 
122 # "navigationSchoolESProducer",
123 # "TransientTrackBuilderESProducer",
124 # "SteppingHelixPropagatorAny",
125 # "OppositeMaterialPropagator",
126 # "MaterialPropagator",
127 # "CaloTowerConstituentsMapBuilder",
128 # "CaloTopologyBuilder",
129  )
130 
131  ModulesToRemove = (
132  # "hltL3MuonIsolations",
133  "hltCkfL1SeededTrackCandidates",
134  "hltCtfL1SeededithMaterialTracks",
135  "hltCkf3HitL1SeededTrackCandidates",
136  "hltCtf3HitL1SeededWithMaterialTracks",
137  "hltCkf3HitActivityTrackCandidates",
138  "hltCtf3HitActivityWithMaterialTracks",
139  "hltActivityCkfTrackCandidatesForGSF",
140  "hltL1SeededCkfTrackCandidatesForGSF",
141  "hltMuCkfTrackCandidates",
142  "hltMuCtfTracks",
143  "hltTau3MuCkfTrackCandidates",
144  "hltTau3MuCtfWithMaterialTracks",
145  "hltMuTrackJpsiCkfTrackCandidates",
146  "hltMuTrackJpsiCtfTracks",
147  "hltMuTrackJpsiEffCkfTrackCandidates",
148  "hltMuTrackJpsiEffCtfTracks",
149  "hltJpsiTkPixelSeedFromL3Candidate",
150  "hltCkfTrackCandidatesJpsiTk",
151  "hltCtfWithMaterialTracksJpsiTk",
152  "hltMuTrackCkfTrackCandidatesOnia",
153  "hltMuTrackCtfTracksOnia",
154 
155  "hltFEDSelector",
156  "hltL3TrackCandidateFromL2OIState",
157  "hltL3TrackCandidateFromL2OIHit",
158  "hltL3TrackCandidateFromL2IOHit",
159  "hltL3TrackCandidateFromL2NoVtx",
160  "hltHcalDigis",
161  "hltHcalDigisL1EGSeeded",
162  "hltHcalDigisL1EGUnseeded",
163  "hltHoreco",
164  "hltHfreco",
165  "hltHbhereco",
166  "hltHbherecoMethod2L1EGSeeded",
167  "hltHbherecoMethod2L1EGUnseeded",
168  "hltESRawToRecHitFacility",
169  "hltEcalRecHitAll",
170  "hltESRecHitAll",
171  # === eGamma
172  "hltEgammaCkfTrackCandidatesForGSF",
173  "hltEgammaGsfTracks",
174  "hltEgammaCkfTrackCandidatesForGSFUnseeded",
175  "hltEgammaGsfTracksUnseeded",
176  # === hltPF
177  "hltPFJetCkfTrackCandidates",
178  "hltPFJetCtfWithMaterialTracks",
179  "hltPFlowTrackSelectionHighPurity",
180  # === hltFastJet
181  "hltDisplacedHT250L1FastJetRegionalPixelSeedGenerator",
182  "hltDisplacedHT250L1FastJetRegionalCkfTrackCandidates",
183  "hltDisplacedHT250L1FastJetRegionalCtfWithMaterialTracks",
184  "hltDisplacedHT300L1FastJetRegionalPixelSeedGenerator",
185  "hltDisplacedHT300L1FastJetRegionalCkfTrackCandidates",
186  "hltDisplacedHT300L1FastJetRegionalCtfWithMaterialTracks",
187  "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJet",
188  "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJet",
189  "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJet",
190  "hltBLifetimeRegionalPixelSeedGeneratorHbbVBF",
191  "hltBLifetimeRegionalCkfTrackCandidatesHbbVBF",
192  "hltBLifetimeRegionalCtfWithMaterialTracksHbbVBF",
193  "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
194  "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
195  "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
196  "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20HbbL1FastJet",
197  "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20HbbL1FastJet",
198  "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20HbbL1FastJet",
199  # === hltBLifetimeRegional
200  "hltBLifetimeRegionalPixelSeedGeneratorHbb",
201  "hltBLifetimeRegionalCkfTrackCandidatesHbb",
202  "hltBLifetimeRegionalCtfWithMaterialTracksHbb",
203  "hltBLifetimeRegionalPixelSeedGeneratorbbPhi",
204  "hltBLifetimeRegionalCkfTrackCandidatesbbPhi",
205  "hltBLifetimeRegionalCtfWithMaterialTracksbbPhi",
206  "hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
207  "hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
208  "hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
209  "hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb",
210  "hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb",
211  "hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb",
212  "hltBLifetimeFastRegionalPixelSeedGeneratorHbbVBF",
213  "hltBLifetimeFastRegionalCkfTrackCandidatesHbbVBF",
214  "hltBLifetimeFastRegionalCtfWithMaterialTracksHbbVBF",
215  "hltBLifetimeRegionalPixelSeedGeneratorbbPhiL1FastJetFastPV",
216  "hltBLifetimeRegionalCkfTrackCandidatesbbPhiL1FastJetFastPV",
217  "hltBLifetimeRegionalCtfWithMaterialTracksbbPhiL1FastJetFastPV",
218  "hltFastPixelBLifetimeRegionalPixelSeedGeneratorHbb",
219  "hltFastPixelBLifetimeRegionalCkfTrackCandidatesHbb",
220  "hltFastPixelBLifetimeRegionalCtfWithMaterialTracksHbb",
221 
222  "hltPixelTracksForMinBias",
223  "hltPixelTracksForMinBias01",
224  "hltPixelTracksForHighMult",
225  "hltRegionalPixelTracks",
226  "hltPixelTracksReg",
227  "hltPixelTracksL3Muon",
228  "hltPixelTracksGlbTrkMuon",
229  "hltPixelTracksHighPtTkMuIso",
230  "hltPixelTracksHybrid",
231  "hltPixelTracksForPhotons",
232  "hltPixelTracksForEgamma",
233  "hltPixelTracksElectrons",
234  "hltPixelTracksForHighPt",
235  "hltHighPtPixelTracks",
236  "hltPixelTracksForNoPU",
237  "hltPixelTracksForSeedsTau3mu",
238  "hltPixelTracksGlbDiTrkMuon",
239 
240  "hltPixelTracksHitTripletsForMinBias",
241  "hltPixelTracksHitTripletsForMinBias01",
242  "hltPixelTracksHitTripletsForHighMult",
243  "hltRegionalPixelTracksHitTriplets",
244  "hltPixelTracksHitTripletsReg",
245  "hltPixelTracksHitTripletsL3Muon",
246  "hltPixelTracksHitTripletsGlbTrkMuon",
247  "hltPixelTracksHitTripletsHighPtTkMuIso",
248  "hltPixelTracksHitTripletsHybrid",
249  "hltPixelTracksHitTripletsForPhotons",
250  "hltPixelTracksHitTripletsForEgamma",
251  "hltPixelTracksHitTripletsElectrons",
252  "hltPixelTracksHitTripletsForHighPt",
253  "hltHighPtPixelTracksHitTriplets",
254  "hltPixelTracksHitTripletsForNoPU",
255  "hltPixelTracksHitTripletsForSeedsTau3mu",
256  "hltPixelTracksHitTripletsGlbDiTrkMuon",
257  "hltPixelTracksHitTriplets",
258 
259  "hltPixelTracksHitDoubletsForMinBias",
260  "hltPixelTracksHitDoubletsForMinBias01",
261  "hltPixelTracksHitDoubletsForHighMult",
262  "hltRegionalPixelTracksHitDoublets",
263  "hltPixelTracksHitDoubletsReg",
264  "hltPixelTracksHitDoubletsL3Muon",
265  "hltPixelTracksHitDoubletsGlbTrkMuon",
266  "hltPixelTracksHitDoubletsHighPtTkMuIso",
267  "hltPixelTracksHitDoubletsHybrid",
268  "hltPixelTracksHitDoubletsForPhotons",
269  "hltPixelTracksHitDoubletsForEgamma",
270  "hltPixelTracksHitDoubletsElectrons",
271  "hltPixelTracksHitDoubletsForHighPt",
272  "hltHighPtPixelTracksHitDoublets",
273  "hltPixelTracksHitDoubletsForNoPU",
274  "hltPixelTracksHitDoubletsForSeedsTau3mu",
275  "hltPixelTracksHitDoubletsGlbDiTrkMuon",
276  "hltPixelTracksHitDoublets",
277 
278  "hltPixelTracksTrackingRegionsForMinBias",
279  "hltPixelTracksTrackingRegionsForMinBias01",
280  "hltPixelTracksTrackingRegionsForHighMult",
281  "hltRegionalPixelTracksTrackingRegions",
282  "hltPixelTracksTrackingRegionsReg",
283  "hltPixelTracksTrackingRegionsL3Muon",
284  "hltPixelTracksTrackingRegionsGlbTrkMuon",
285  "hltPixelTracksTrackingRegionsHighPtTkMuIso",
286  "hltPixelTracksTrackingRegionsHybrid",
287  "hltPixelTracksTrackingRegionsForPhotons",
288  "hltPixelTracksTrackingRegionsForEgamma",
289  "hltPixelTracksTrackingRegionsElectrons",
290  "hltPixelTracksTrackingRegionsForHighPt",
291  "hltHighPtPixelTracksTrackingRegions",
292  "hltPixelTracksTrackingRegionsForNoPU",
293  "hltPixelTracksTrackingRegionsForSeedsTau3mu",
294  "hltPixelTracksTrackingRegionsGlbDiTrkMuon",
295  "hltPixelTracksTrackingRegions",
296 
297  "hltFastPixelHitsVertex",
298  "hltFastPixelTracks",
299  "hltFastPixelTracksRecover",
300 
301  "hltPixelLayerPairs",
302  "hltPixelLayerTriplets",
303  "hltPixelLayerTripletsReg",
304  "hltPixelLayerTripletsHITHB",
305  "hltPixelLayerTripletsHITHE",
306  "hltPixelLayerTripletsAfterSplitting",
307  "hltMixedLayerPairs",
308 
309  "hltFastPrimaryVertexbbPhi",
310  "hltPixelTracksFastPVbbPhi",
311  "hltPixelTracksRecoverbbPhi",
312  "hltFastPixelHitsVertexVHbb",
313  "hltFastPixelTracksVHbb",
314  "hltFastPixelTracksRecoverVHbb",
315 
316  "hltFastPrimaryVertex",
317  "hltFastPVPixelVertexFilter",
318  "hltFastPVPixelTracks",
319  "hltFastPVPixelTracksHitTriplets",
320  "hltFastPVPixelTracksHitDoublets",
321  "hltFastPVPixelTracksTrackingRegions",
322  "hltFastPVPixelTracksRecover",
323  "hltFastPVPixelTracksHitTripletsRecover",
324  "hltFastPVPixelTracksHitDoubletsRecover",
325  "hltFastPVPixelTracksTrackingRegionsRecover",
326 
327  "hltPAGoodHighPurityFullTracks",
328 
329  # "hltPixelMatchElectronsActivity",
330 
331  "hltMuonCSCDigis",
332  "hltMuonDTDigis",
333  "hltMuonRPCDigis",
334 # "hltGtDigis",
335 # "hltL1GtTrigReport",
336  # "hltCsc2DRecHits",
337  # "hltDt1DRecHits",
338  # "hltRpcRecHits",
339  "hltScalersRawToDigi",
340  "hltEcalPreshowerDigis",
341  "hltEcalDigis",
342  "hltEcalDetIdToBeRecovered",
343 
344  )
345 
346  SequencesToRemove = (
347  "HLTL1SeededEgammaRegionalRecoTrackerSequence",
348  "HLTEcalActivityEgammaRegionalRecoTrackerSequence",
349  "HLTPixelMatchElectronActivityTrackingSequence",
350  "HLTDoLocalStripSequence",
351  "HLTDoLocalPixelSequence",
352  "HLTDoLocalPixelSequenceRegL2Tau",
353  "HLTDoLocalStripSequenceReg",
354  "HLTDoLocalPixelSequenceReg",
355  "HLTDoLocalStripSequenceRegForBTag",
356  "HLTDoLocalPixelSequenceRegForBTag",
357  "HLTDoLocalPixelSequenceRegForNoPU",
358  "HLTDoLocalPixelSequenceAfterSplitting",
359  "HLTPADoLocalStripSequenceAfterSplitting",
360  "HLTBeginSequence",
361  "HLTBeginSequenceL1Fat",
362  "HLTBeginSequenceNZS",
363  "HLTBeginSequenceBPTX",
364  "HLTBeginSequenceAntiBPTX",
365  "HLTHBHENoiseSequence",
366  "HLTIterativeTrackingIter04",
367  "HLTIterativeTrackingIter02",
368  "HLTIterativeTracking",
369  "HLTIterativeTrackingForHighPt",
370  "HLTIterativeTrackingTau3Mu",
371  "HLTIterativeTrackingGlbDiTrkMuonIter02",
372  "HLTIterativeTrackingReg",
373  "HLTIterativeTrackingForPA",
374  "HLTPAIterativeTracking",
375  "HLTIterativeTrackingForElectronIter02",
376  "HLTIterativeTrackingForPhotonsIter02",
377  "HLTIterativeTrackingL3MuonIter02",
378  "HLTIterativeTrackingGlbTrkMuonIter02",
379  "HLTIterativeTrackingL3MuonRegIter02",
380  "HLTIterativeTrackingHighPtTkMu",
381  "HLTIterativeTrackingHighPtTkMuIsoIter02",
382  "HLTIterativeTrackingForBTagIter02",
383  "HLTIterativeTrackingForBTagIter12",
384  "HLTIterativeTrackingForTauIter04",
385  "HLTIterativeTrackingForTauIter02",
386  "HLTIterativeTrackingDisplacedJpsiIter02",
387  "HLTIterativeTrackingDisplacedPsiPrimeIter02",
388  "HLTIterativeTrackingDisplacedNRMuMuIter02",
389  "HLTIterativeTrackingDisplacedTau3muIter02",
390  "HLTIterativeTrackingForBTagIteration0",
391  "HLTIterativeTrackingIteration4DisplacedJets",
392  "HLTRegionalCKFTracksForL3Isolation",
393  "HLTHBHENoiseCleanerSequence",
394  )
395 
396 # Removing ESmodules
397  for label in ESModulesToRemove:
398  if (hasattr(process,label)):
399  delattr(process,label)
400 
401 # Removing paths
402  import fnmatch,re
403  ExplicitList = []
404  HLTSchedule = tuple( path.label_() for path in process.HLTSchedule)
405  for path in HLTSchedule:
406  getattr(process,path).insert(1,process.HLTL1UnpackerSequence)
407  for black in fastSimUnsupportedPaths:
408  compiled = re.compile(fnmatch.translate(black))
409  for path in HLTSchedule:
410  if compiled.search(path) is not None:
411  ExplicitList += [path]
412  UniqueList = []
413  for path in ExplicitList:
414  if path not in UniqueList:
415  UniqueList += [path]
416  for path in UniqueList:
417  process.schedule.remove(getattr(process,path))
418  process.setSchedule_(process.schedule)
419  process.prune()
420 
421 # Removing streams and datasets PSets
422  if hasattr(process,'streams'):
423  delattr(process,'streams')
424  if hasattr(process,'datasets'):
425  delattr(process,'datasets')
426 
427 # Removing sequences, possibly to be taken from fastsim import
428  for label in SequencesToRemove:
429  if hasattr(process,label):
430  if hasattr(fastsim,label):
431  setattr(process,label,getattr(fastsim,label))
432  else:
433  object = getattr(process,label)
434  list = tuple(process.sequences_().keys())
435  for name in list:
436  sequence = getattr(process,name)
437  more=True
438  while more:
439  more = sequence.remove(object)
440  list = tuple(process.paths_().keys())
441  for name in list:
442  path = getattr(process,name)
443  more=True
444  while more:
445  more = path.remove(object)
446  delattr(process,label)
447 
448 # Removing modules, possibly to be taken from fastsim import
449  for label in ModulesToRemove:
450  if hasattr(process,label):
451  if hasattr(fastsim,label):
452  setattr(process,label,getattr(fastsim,label))
453  else:
454  object = getattr(process,label)
455  # remove from sequences
456  list = tuple(process.sequences_().keys())
457  for name in list:
458  sequence = getattr(process,name)
459  more=True
460  while more:
461  more = sequence.remove(object)
462  # remove from paths
463  list = tuple(process.paths_().keys())
464  for name in list:
465  path = getattr(process,name)
466  more=True
467  while more:
468  more = path.remove(object)
469  # remove from end paths
470  list = tuple(process.endpaths_().keys())
471  for name in list:
472  path = getattr(process,name)
473  more=True
474  while more:
475  more = path.remove(object)
476  delattr(process,label)
477 
478 # Special transformations:
479  if hasattr(process,'hltGetConditions') and hasattr(process,'HLTriggerFirstPath'):
480  process.hltDummyConditions = cms.EDFilter( "HLTBool", result = cms.bool( True ) )
481  process.HLTriggerFirstPath.replace(process.hltGetConditions,process.hltDummyConditions)
482  if hasattr(process,'hltPixelVertices'):
483  process.hltPixelVertices.beamSpot = cms.InputTag('offlineBeamSpot')
484  specialModules = ( 'hltEcalRecHit', 'hltEcalPreshowerRecHit', )
485  for label in specialModules:
486  if hasattr(process,label):
487  setattr(fastsim,label,getattr(process,label))
488 
489 # Use fastsim imports
490  for label in fastsim.producers_().keys():
491  if hasattr(process,label):
492  setattr(process,label,getattr(fastsim,label))
493  for label in fastsim.filters_().keys():
494  if hasattr(process,label):
495  setattr(process,label,getattr(fastsim,label))
496  for label in fastsim.analyzers_().keys():
497  if hasattr(process,label):
498  setattr(process,label,getattr(fastsim,label))
499  for label in fastsim.sequences_().keys():
500  if hasattr(process,label):
501  setattr(process,label,getattr(fastsim,label))
502 
503 # Update InputTags
504 
505  InputTags = (
506 # ('hltGtDigis','gtDigis'),
507 # ('hltL1GtObjectMap','gtDigis'),
508  ('hltEcalDigis:ebDigis','ecalDigis:ebDigis'),
509  ('hltEcalDigis:eeDigis','ecalDigis:eeDigis'),
510  ('hltMuonCSCDigis','muonCSCDigis'),
511  ('hltMuonCSCDigis:MuonCSCStripDigi','muonCSCDigis:MuonCSCStripDigi'),
512  ('hltMuonCSCDigis:MuonCSCWireDigi','muonCSCDigis:MuonCSCWireDigi'),
513  ('hltMuonDTDigis','muonDTDigis'),
514  ('hltMuonRPCDigis','muonRPCDigis'),
515  ('hltEcalPreshowerDigis','ecalPreshowerDigis'),
516  ('hltHbhereco', 'hbhereco'),
517  ('hltHbherecoMethod2L1EGSeeded', 'hbhereco'),
518  ('hltHbherecoMethod2L1EGUnseeded', 'hbhereco'),
519  ('hltHoreco', 'horeco'),
520  ('hltHfreco', 'hfreco'),
521 
522  ('hltIter2Merged', 'generalTracks'),
523  ('hltIter2HighPtMerged', 'generalTracks'),
524  ('hltIter2MergedForElectrons', 'generalTracks'),
525  ('hltIter2MergedForPhotons', 'generalTracks'),
526  ('hltIter2L3MuonMerged', 'generalTracks'),
527  ('hltIter2MergedForBTag', 'generalTracks'),
528  ('hltIter2MergedForTau', 'generalTracks'),
529  ('hltIter2GlbTrkMuonMerged', 'generalTracks'),
530  ('hltIter2HighPtTkMuMerged', 'generalTracks'),
531  ('hltIter2HighPtTkMuIsoMerged', 'generalTracks'),
532  ('hltIter2DisplacedJpsiMerged', 'generalTracks'),
533  ('hltIter2DisplacedPsiPrimeMerged', 'generalTracks'),
534  ('hltIter2DisplacedNRMuMuMerged', 'generalTracks'),
535  ('hltIter2DisplacedTau3muMerged', 'generalTracks'),
536  ('hltIter2GlbDiTrkMuonMerged', 'generalTracks'),
537  ('hltIter0PFlowTrackSelectionHighPurityForBTag', 'generalTracks'),
538  ('hltIter4HighPtMerged', 'generalTracks'),
539  ('hltIterativeTrackingForPAMerged', 'generalTracks'),
540  #('hltPAIterativeTrackingMerged', 'generalTracks'),
541  ('hltPAIterativeTrackingMerged', 'generalTracks'),
542  ('hltPAGoodHighPurityFullTracks','generalTracks'),
543 
544  ('hltFastPVPixelTracks','hltPixelTracks'),
545  ('hltFastPVPixelTracksRecover','hltPixelTracks'),
546  ('hltPixelTracksL3Muon','hltPixelTracks'),
547  ('hltPixelTracksGlbTrkMuon','hltPixelTracks'),
548  ('hltPixelTracksHighPtTkMuIso','hltPixelTracks'),
549  ('hltPixelTracksHybrid','hltPixelTracks'),
550  ('hltPixelTracksForPhotons','hltPixelTracks'),
551  ('hltPixelTracksForEgamma','hltPixelTracks'),
552  ('hltPixelTracksElectrons','hltPixelTracks'),
553  ('hltPixelTracksForHighPt','hltPixelTracks'),
554  ('hltHighPtPixelTracks','hltPixelTracks'),
555  ('hltPixelTracksForNoPU','hltPixelTracks'),
556  ('hltPixelTracksForSeedsTau3mu','hltPixelTracks'),
557  ('hltPixelTracksGlbDiTrkMuon','hltPixelTracks'),
558 
559  ('hltL1extraParticles','l1extraParticles'),
560  ('hltL1extraParticles:Central','l1extraParticles:Central'),
561  ('hltL1extraParticles:Forward','l1extraParticles:Forward'),
562  ('hltL1extraParticles:Isolated','l1extraParticles:Isolated'),
563  ('hltL1extraParticles:NonIsolated','l1extraParticles:NonIsolated'),
564  ('hltL1extraParticles:Tau','l1extraParticles:Tau'),
565  ('hltL1extraParticles:IsoTau','l1extraParticles:IsoTau'),
566  ('hltOfflineBeamSpot','offlineBeamSpot'),
567  ('hltOnlineBeamSpot','offlineBeamSpot'),
568  ('hltSiStripClusters','MeasurementTrackerEvent'),
569  ('hltSiStripClustersAfterSplitting','MeasurementTrackerEvent'),
570  )
571  from HLTrigger.Configuration.CustomConfigs import MassReplaceInputTag
572  for pair in InputTags:
573  process = MassReplaceInputTag(process,pair[0],pair[1])
574 
575 # Update top-level named parameters
576  NamedParameters = (
577 # ('GMTReadoutCollection',cms.InputTag('gtDigis'),cms.InputTag('gmtDigis')),
578  ('killDeadChannels',cms.bool(True),cms.bool(False)),
579  ('recoverEBFE',cms.bool(True),cms.bool(False)),
580  ('recoverEEFE',cms.bool(True),cms.bool(False)),
581  ('src',cms.InputTag('hltHcalTowerNoiseCleaner'),cms.InputTag('hltTowerMakerForAll')),
582  ('src',cms.InputTag('hltHcalTowerNoiseCleanerWithrechit'),cms.InputTag('hltTowerMakerForAll')),
583  ('initialSeeds',cms.InputTag('noSeedsHere'),cms.InputTag('hltPixelPairSeeds')),
584  ('preFilteredSeeds',cms.bool(True),cms.bool(False)),
585  )
586  from HLTrigger.Configuration.CustomConfigs import MassReplaceParameter
587  for thrice in NamedParameters:
588  process = MassReplaceParameter(process,thrice[0],thrice[1],thrice[2])
589 
590 # Update nested named parameters
591  for label in ('hltEgammaElectronPixelSeeds','hltEgammaElectronPixelSeedsUnseeded',):
592  if hasattr(process,label):
593  getattr(process,label).SeedConfiguration.initialSeeds = cms.InputTag('hltPixelPairSeeds')
594  getattr(process,label).SeedConfiguration.preFilteredSeeds = cms.bool(False)
595 
596 # Extending fastsim import
597  fastsim.extend(process)
598  fastsim.setSchedule_(fastsim.schedule)
599  fastsim.prune()
600 
601 # muon seeds
602  import FastSimulation.HighLevelTrigger.full2fast as full2fast
603  if hasattr(fastsim,"hltL3TrajSeedOIHit"):
604  full2fast.modify_hltL3TrajSeedOIHit(fastsim.hltL3TrajSeedOIHit)
605  if hasattr(fastsim,"hltL3NoFiltersTrajSeedOIHit"):
606  full2fast.modify_hltL3TrajSeedOIHit(fastsim.hltL3NoFiltersTrajSeedOIHit)
607  if hasattr(fastsim,"hltL3TrajSeedIOHit"):
608  full2fast.modify_hltL3TrajSeedIOHit(fastsim.hltL3TrajSeedIOHit)
609  if hasattr(fastsim,"hltL3NoFiltersTrajSeedIOHit"):
610  full2fast.modify_hltL3NoFiltersTrajSeedIOHit(fastsim.hltL3NoFiltersTrajSeedIOHit)
611 
612  return fastsim
613 
614  else:
615 
616  return process
def modify_hltL3TrajSeedOIHit
Definition: full2fast.py:3
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:49
def MassReplaceParameter
def modify_hltL3TrajSeedIOHit
Definition: full2fast.py:12