CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
reco_TLR_42X.py
Go to the documentation of this file.
2 
3 def memorySavingTracking(process):
4  toRemove={}
5  #list of modules in iterative tracking
6  ## remove rekeying of clusters refs from track producer
7  trackProducers=['preFilterZeroStepTracks',
8  'preFilterStepOneTracks',
9  'secWithMaterialTracks',
10  'thWithMaterialTracks',
11  'fourthWithMaterialTracks',
12  'fifthWithMaterialTracks',
13  ]
14 
15  for tp in trackProducers:
16  m=getattr(process,tp)
17  if hasattr(m,"clusterRemovalInfo"):
18  #print "removing cluter rekeying from",tp
19  delattr(m,"clusterRemovalInfo")
20 
21  measurementTrackers=['MeasurementTracker',
22  'newMeasurementTracker',
23  'secMeasurementTracker',
24  'thMeasurementTracker',
25  'fourthMeasurementTracker',
26  'fifthMeasurementTracker',
27  ]
28 
29  # list of measurement tracker, component names
30  ## create the clusterRef to skip creators (MT+'ToSkip')
31  for mt in measurementTrackers:
32  es=getattr(process,mt)
33  ## modify MT to point to the full cluster list
34  #if es.pixelClusterProducer.value() == 'siPixelClusters':
35  # continue
36 
37  #old trackclusterremoval module
38  removalModule=es.pixelClusterProducer.value()
39 
40  if (removalModule != 'siPixelClusters'):
41  es.skipClusters = cms.InputTag(removalModule)
42  es.pixelClusterProducer = 'siPixelClusters'
43  es.stripClusterProducer = 'siStripClusters'
44  #print mt,es.skipClusters,es.pixelClusterProducer,es.stripClusterProducer
45  tcremoval = getattr(process,removalModule)
46  #print removalModule,"turned to using new scheme"
47  tcremoval.clusterLessSolution= cms.bool(True)
48  tcremoval.stripClusters = 'siStripClusters'
49  tcremoval.pixelClusters = 'siPixelClusters'
50  skipTrackQualityFilter=False
51  if (skipTrackQualityFilter):
52  tcremoval.TrackQuality = cms.string('highPurity')
53  #remove the QualityFilter module from the path
54  toRemove[tcremoval.trajectories.value()]=True
55  qf=getattr(process,tcremoval.trajectories.value())
56  tcremoval.trajectories = qf.recTracks
57  #else:
58  #print mt,'no cluster to skip',es.pixelClusterProducer,es.stripClusterProducer
59 
60  patternRecoModules=[
61  'fifthTrackCandidates',
62  'fourthTrackCandidates',
63  'newTrackCandidateMaker',
64  'secTrackCandidates',
65  'stepOneTrackCandidateMaker',
66  'thTrackCandidates'
67  ]
68 
69  for ckfm in patternRecoModules:
70  ckf=getattr(process,ckfm)
71  builder=getattr(process,ckf.TrajectoryBuilder.value())
72  mtn= builder.MeasurementTrackerName.value()
73  if mtn!='':
74  #make it look at the central MT
75  builder.MeasurementTrackerName=''
76  mt=getattr(process,mtn)
77  # transfer the cluster removal from the MT to the builder
78  builder.clustersToSkip = mt.skipClusters
79  #print "setting",ckf.TrajectoryBuilder.value(),"via",ckfm,"to look at central MT"
80  #print "removing MT:",mtn
81  delattr(process,mtn)
82  #else:
83  #print ckfm,"untouched"
84 
85  #all seeding layers should point to the same rechits collections
86  for esp in process.es_producers_().keys():
87  es = getattr(process,esp)
88  if es._TypedParameterizable__type != 'SeedingLayersESProducer':
89  continue
90  for pm in es.parameters_().keys():
91  p=getattr(es,pm)
92  if p.pythonTypeName() == 'cms.PSet':
93  if hasattr(p,'HitProducer'):
94  #print "pixel",pm,p
95  #pixel case
96  if p.HitProducer != 'siPixelRecHits':
97  toRemove[p.HitProducer.value()]=True
98  skip=getattr(process,p.HitProducer.value()).src
99  p.HitProducer = 'siPixelRecHits'
100  #and set the skipping
101  p.skipClusters = cms.InputTag(skip.value())
102  #print esp,"modified for new skipping"
103  #print esp,pm,p
104 
105  if hasattr(p,'matchedRecHits'):
106  #print "strip",pm,p
107  #strip case
108  ## rename the collection
109  if p.matchedRecHits.moduleLabel != 'siStripMatchedRecHits':
110  toRemove[p.matchedRecHits.moduleLabel]=True
111  skip=getattr(process,p.matchedRecHits.moduleLabel).ClusterProducer
112  p.matchedRecHits.setModuleLabel('siStripMatchedRecHits')
113  #and set the skipping
114  p.skipClusters = cms.InputTag(skip.value())
115  #print esp,pm,p
116 
117 
118  for edp in process.producers_():
119  p=getattr(process,edp)
120  if hasattr(p,'ClusterCheckPSet'):
121  #print "resetting cluster check for",edp
122  p.ClusterCheckPSet.PixelClusterCollectionLabel = 'siPixelClusters'
123  p.ClusterCheckPSet.ClusterCollectionLabel = 'siStripClusters'
124 
125  #force useless module to be removed
126  toRemove['secStripRecHits']=True
127  toRemove['fourthPixelRecHits']=True
128  toRemove['fifthPixelRecHits']=True
129 
130  for tr in toRemove:
131  if hasattr(process,tr):
132  #print "removing",tr
133  process.reconstruction_step.remove(getattr(process,tr))
134 
135  delattr(process.newCombinedSeeds,'clusterRemovalInfos')
136 
137  return (process)
138 
139 
140 def customiseCommon(process):
141 
142  process = memorySavingTracking(process)
143 
144  return (process)
145 
146 
147 ##############################################################################
148 def customisePPData(process):
149  process= customiseCommon(process)
150 
151  ## particle flow HF cleaning
152  process.particleFlowRecHitHCAL.LongShortFibre_Cut = 30.
153  process.particleFlowRecHitHCAL.ApplyPulseDPG = True
154 
155  ## HF cleaning for data only
156  process.hcalRecAlgos.SeverityLevels[3].RecHitFlags.remove("HFDigiTime")
157  process.hcalRecAlgos.SeverityLevels[4].RecHitFlags.append("HFDigiTime")
158 
159  ##beam-halo-id for data only
160  process.CSCHaloData.ExpectedBX = cms.int32(3)
161 
162  ## hcal hit flagging
163  process.hfreco.PETstat.flagsToSkip = 2
164  process.hfreco.S8S1stat.flagsToSkip = 18
165  process.hfreco.S9S1stat.flagsToSkip = 26
166 
167  ##Ecal time bias correction
168  process.ecalGlobalUncalibRecHit.doEBtimeCorrection = True
169  process.ecalGlobalUncalibRecHit.doEEtimeCorrection = True
170 
171  return process
172 
173 
174 ##############################################################################
175 def customisePPMC(process):
176  process=customiseCommon(process)
177 
178  return process
179 
180 ##############################################################################
181 def customiseCosmicData(process):
182 
183  return process
184 
185 ##############################################################################
186 def customiseCosmicMC(process):
187 
188  return process
189 
190 ##############################################################################
191 def customiseVALSKIM(process):
192  process= customisePPData(process)
193  process.reconstruction.remove(process.lumiProducer)
194  return process
195 
196 ##############################################################################
197 def customiseExpress(process):
198  process= customisePPData(process)
199 
201  process.offlineBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
202 
203  return process
204 
205 ##############################################################################
206 def customisePrompt(process):
207  process= customisePPData(process)
208  return process
209 
210 ##############################################################################
211 ##############################################################################
212 
213 def customiseCommonHI(process):
214 
215  ###############################################################################################
216  ####
217  #### Top level replaces for handling strange scenarios of early HI collisions
218  ####
219 
220  ## Offline Silicon Tracker Zero Suppression
221  process.siStripZeroSuppression.Algorithms.CommonModeNoiseSubtractionMode = cms.string("IteratedMedian")
222  process.siStripZeroSuppression.Algorithms.CutToAvoidSignal = cms.double(2.0)
223  process.siStripZeroSuppression.Algorithms.Iterations = cms.int32(3)
224  process.siStripZeroSuppression.storeCM = cms.bool(True)
225 
226 
227  ###
228  ### end of top level replacements
229  ###
230  ###############################################################################################
231 
232  return process
233 
234 ##############################################################################
235 def customiseExpressHI(process):
236  process= customiseCommonHI(process)
237 
239  process.offlineBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
240 
241  return process
242 
243 ##############################################################################
244 def customisePromptHI(process):
245  process= customiseCommonHI(process)
246 
248  process.offlineBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
249 
250  return process
251 
252 ##############################################################################
def customiseCosmicMC
def customiseExpress
def customiseCommonHI
def customiseExpressHI
def customiseVALSKIM
def customiseCosmicData
def customisePromptHI
def memorySavingTracking
Definition: reco_TLR_42X.py:3