CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
customizeHLTforMC Namespace Reference

Functions

def customizeHLTforFastSim
 
def customizeHLTforFullSim
 
def customizeHLTforMC
 

Function Documentation

def customizeHLTforMC.customizeHLTforFastSim (   process,
  _fastSim = True 
)

Definition at line 3 of file customizeHLTforMC.py.

3 
4 def customizeHLTforFastSim(process,_fastSim=True):
5  process=customizeHLTforMC(process,_fastSim)
6  return process
def customizeHLTforMC.customizeHLTforFullSim (   process,
  _fastSim = False 
)

Definition at line 7 of file customizeHLTforMC.py.

7 
8 def customizeHLTforFullSim(process,_fastSim=False):
9  process=customizeHLTforMC(process,_fastSim)
10  return process
def customizeHLTforMC.customizeHLTforMC (   process,
  _fastSim = False 
)
adapt the HLT to run on MC, instead of data
see Configuration/StandardSequences/Reconstruction_Data_cff.py
which does the opposite, for RECO

Definition at line 11 of file customizeHLTforMC.py.

References edm::eventsetup::heterocontainer.insert(), relativeConstraints.keys, ConfigBuilder.MassReplaceInputTag(), CustomConfigs.MassReplaceParameter(), full2fast.modify_hltL3TrajSeedIOHit(), and full2fast.modify_hltL3TrajSeedOIHit().

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