File indexing completed on 2024-04-06 12:03:39
0001 import FWCore.ParameterSet.Config as cms
0002
0003 def memorySavingTracking(process):
0004 toRemove={}
0005
0006
0007 trackProducers=['preFilterZeroStepTracks',
0008 'preFilterStepOneTracks',
0009 'secWithMaterialTracks',
0010 'thWithMaterialTracks',
0011 'fourthWithMaterialTracks',
0012 'fifthWithMaterialTracks',
0013 ]
0014
0015 for tp in trackProducers:
0016 m=getattr(process,tp)
0017 if hasattr(m,"clusterRemovalInfo"):
0018
0019 delattr(m,"clusterRemovalInfo")
0020
0021 measurementTrackers=['MeasurementTracker',
0022 'newMeasurementTracker',
0023 'secMeasurementTracker',
0024 'thMeasurementTracker',
0025 'fourthMeasurementTracker',
0026 'fifthMeasurementTracker',
0027 ]
0028
0029
0030
0031 for mt in measurementTrackers:
0032 es=getattr(process,mt)
0033
0034
0035
0036
0037
0038 removalModule=es.pixelClusterProducer.value()
0039
0040 if (removalModule != 'siPixelClusters'):
0041 es.skipClusters = cms.InputTag(removalModule)
0042 es.pixelClusterProducer = 'siPixelClusters'
0043 es.stripClusterProducer = 'siStripClusters'
0044
0045 tcremoval = getattr(process,removalModule)
0046
0047 tcremoval.clusterLessSolution= cms.bool(True)
0048 tcremoval.stripClusters = 'siStripClusters'
0049 tcremoval.pixelClusters = 'siPixelClusters'
0050 skipTrackQualityFilter=False
0051 if (skipTrackQualityFilter):
0052 tcremoval.TrackQuality = cms.string('highPurity')
0053
0054 toRemove[tcremoval.trajectories.value()]=True
0055 qf=getattr(process,tcremoval.trajectories.value())
0056 tcremoval.trajectories = qf.recTracks
0057
0058
0059
0060 patternRecoModules=[
0061 'fifthTrackCandidates',
0062 'fourthTrackCandidates',
0063 'newTrackCandidateMaker',
0064 'secTrackCandidates',
0065 'stepOneTrackCandidateMaker',
0066 'thTrackCandidates'
0067 ]
0068
0069 for ckfm in patternRecoModules:
0070 ckf=getattr(process,ckfm)
0071 builder=getattr(process,ckf.TrajectoryBuilder.value())
0072 mtn= builder.MeasurementTrackerName.value()
0073 if mtn!='':
0074
0075 builder.MeasurementTrackerName=''
0076 mt=getattr(process,mtn)
0077
0078 builder.clustersToSkip = mt.skipClusters
0079
0080
0081 delattr(process,mtn)
0082
0083
0084
0085
0086 for esp in process.es_producers_().keys():
0087 es = getattr(process,esp)
0088 if es._TypedParameterizable__type != 'SeedingLayersESProducer':
0089 continue
0090 for pm in es.parameters_().keys():
0091 p=getattr(es,pm)
0092 if p.pythonTypeName() == 'cms.PSet':
0093 if hasattr(p,'HitProducer'):
0094
0095
0096 if p.HitProducer != 'siPixelRecHits':
0097 toRemove[p.HitProducer.value()]=True
0098 skip=getattr(process,p.HitProducer.value()).src
0099 p.HitProducer = 'siPixelRecHits'
0100
0101 p.skipClusters = cms.InputTag(skip.value())
0102
0103
0104
0105 if hasattr(p,'matchedRecHits'):
0106
0107
0108
0109 if p.matchedRecHits.moduleLabel != 'siStripMatchedRecHits':
0110 toRemove[p.matchedRecHits.moduleLabel]=True
0111 skip=getattr(process,p.matchedRecHits.moduleLabel).ClusterProducer
0112 p.matchedRecHits.setModuleLabel('siStripMatchedRecHits')
0113
0114 p.skipClusters = cms.InputTag(skip.value())
0115
0116
0117
0118 for edp in process.producers_():
0119 p=getattr(process,edp)
0120 if hasattr(p,'ClusterCheckPSet'):
0121
0122 p.ClusterCheckPSet.PixelClusterCollectionLabel = 'siPixelClusters'
0123 p.ClusterCheckPSet.ClusterCollectionLabel = 'siStripClusters'
0124
0125
0126 toRemove['secStripRecHits']=True
0127 toRemove['fourthPixelRecHits']=True
0128 toRemove['fifthPixelRecHits']=True
0129
0130 for tr in toRemove:
0131 if hasattr(process,tr):
0132
0133 process.reconstruction_step.remove(getattr(process,tr))
0134
0135 delattr(process.newCombinedSeeds,'clusterRemovalInfos')
0136
0137 return (process)
0138
0139
0140 def customiseCommon(process):
0141
0142 process = memorySavingTracking(process)
0143
0144 return (process)
0145
0146
0147
0148 def customisePPData(process):
0149 process= customiseCommon(process)
0150
0151
0152 process.particleFlowRecHitHCAL.LongShortFibre_Cut = 30.
0153 process.particleFlowRecHitHCAL.ApplyPulseDPG = True
0154
0155
0156 process.hcalRecAlgos.SeverityLevels[3].RecHitFlags.remove("HFDigiTime")
0157 process.hcalRecAlgos.SeverityLevels[4].RecHitFlags.append("HFDigiTime")
0158
0159
0160 process.CSCHaloData.ExpectedBX = cms.int32(3)
0161
0162
0163 process.hfreco.PETstat.flagsToSkip = 2
0164 process.hfreco.S8S1stat.flagsToSkip = 18
0165 process.hfreco.S9S1stat.flagsToSkip = 26
0166
0167 return process
0168
0169
0170
0171 def customisePPMC(process):
0172 process=customiseCommon(process)
0173
0174 return process
0175
0176
0177 def customiseCosmicData(process):
0178
0179 return process
0180
0181
0182 def customiseCosmicMC(process):
0183
0184 return process
0185
0186
0187 def customiseVALSKIM(process):
0188 process= customisePPData(process)
0189 process.reconstruction.remove(process.lumiProducer)
0190 return process
0191
0192
0193 def customiseExpress(process):
0194 process= customisePPData(process)
0195
0196 import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi
0197 process.offlineBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
0198
0199 return process
0200
0201
0202 def customisePrompt(process):
0203 process= customisePPData(process)
0204 return process
0205
0206
0207
0208
0209 def customiseCommonHI(process):
0210
0211
0212
0213
0214
0215
0216
0217 process.siStripZeroSuppression.Algorithms.CommonModeNoiseSubtractionMode = cms.string("IteratedMedian")
0218 process.siStripZeroSuppression.Algorithms.CutToAvoidSignal = cms.double(2.0)
0219 process.siStripZeroSuppression.Algorithms.Iterations = cms.int32(3)
0220 process.siStripZeroSuppression.storeCM = cms.bool(True)
0221
0222
0223
0224
0225
0226
0227
0228 return process
0229
0230
0231 def customiseExpressHI(process):
0232 process= customiseCommonHI(process)
0233
0234 import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi
0235 process.offlineBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
0236
0237 return process
0238
0239
0240 def customisePromptHI(process):
0241 process= customiseCommonHI(process)
0242
0243 import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi
0244 process.offlineBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
0245
0246 return process
0247
0248