CMS 3D CMS Logo

ConversionStep_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
4 
7 
8 from RecoLocalTracker.SubCollectionProducers.trackClusterRemover_cfi import trackClusterRemover as _trackClusterRemover
9 _convClustersBase = _trackClusterRemover.clone(
10  maxChi2 = 30.0,
11  trajectories = 'tobTecStepTracks',
12  pixelClusters = 'siPixelClusters',
13  stripClusters = 'siStripClusters',
14  oldClusterRemovalInfo = 'tobTecStepClusters',
15  TrackQuality = 'highPurity'
16 )
17 
18 convClusters = _convClustersBase.clone(
19  trackClassifier = 'tobTecStep:QualityMasks',
20 )
21 
22 
23 #Phase2 : configuring the phase2 track Cluster Remover
24 from RecoLocalTracker.SubCollectionProducers.phase2trackClusterRemover_cfi import phase2trackClusterRemover as _phase2trackClusterRemover
25 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
26 trackingPhase2PU140.toReplaceWith(convClusters, _phase2trackClusterRemover.clone(
27  maxChi2 = 30.0,
28  phase2pixelClusters = 'siPixelClusters',
29  phase2OTClusters = 'siPhase2Clusters',
30  TrackQuality = 'highPurity',
31  minNumberOfLayersWithMeasBeforeFiltering = 0,
32  trajectories = 'detachedQuadStepTracks',
33  oldClusterRemovalInfo = 'detachedQuadStepClusters',
34  overrideTrkQuals = 'detachedQuadStepSelector:detachedQuadStepTrk'
35 ))
36 from Configuration.ProcessModifiers.trackingIters01_cff import trackingIters01
37 trackingIters01.toModify(convClusters,
38  trajectories = "highPtTripletStepTracks",
39  oldClusterRemovalInfo = "highPtTripletStepClusters",
40  overrideTrkQuals = "highPtTripletStepSelector:highPtTripletStep"
41 )
42 from Configuration.ProcessModifiers.trackingLST_cff import trackingLST
43 (trackingIters01 & trackingPhase2PU140 & trackingLST).toModify(convClusters,
44  overrideTrkQuals = ""
45 )
46 
47 _convLayerPairsStripOnlyLayers = ['TIB1+TID1_pos',
48  'TIB1+TID1_neg',
49  'TIB1+TID2_pos',
50  'TIB1+TID2_neg',
51  'TIB1+TIB2',
52  'TIB1+MTIB3',
53 
54  'TIB2+TID1_pos',
55  'TIB2+TID1_neg',
56  'TIB2+TID2_pos',
57  'TIB2+TID2_neg',
58  'TIB2+MTIB3',
59  'TIB2+MTIB4',
60 
61  'MTIB3+MTIB4',
62  'MTIB3+TOB1',
63  'MTIB3+TID1_pos',
64  'MTIB3+TID1_neg',
65 
66  'MTIB4+TOB1',
67  'MTIB4+TOB2',
68 
69  'TOB1+TOB2',
70  'TOB1+MTOB3',
71  'TOB1+TEC1_pos',
72  'TOB1+TEC1_neg',
73 
74  'TOB2+MTOB3',
75  'TOB2+MTOB4',
76  'TOB2+TEC1_pos',
77  'TOB2+TEC1_neg',
78 
79  #NB: re-introduce these combinations when large displaced
80  # tracks, reconstructed only in TOB will be available
81  # For instance think at the OutIn Ecal Seeded tracks
82  #'MTOB3+MTOB4',
83  #'MTOB3+MTOB5',
84  #'MTOB3+TEC1_pos',
85  #'MTOB3+TEC1_neg',
86  #
87  #'MTOB4+MTOB5',
88  #'MTOB4+MTOB6',
89  #
90  #'MTOB5+MTOB6',
91 
92  'TID1_pos+TID2_pos',
93  'TID2_pos+TID3_pos',
94  'TID3_pos+TEC1_pos',
95 
96  'TID1_neg+TID2_neg',
97  'TID2_neg+TID3_neg',
98  'TID3_neg+TEC1_neg',
99 
100  'TEC1_pos+TEC2_pos',
101  'TEC2_pos+TEC3_pos',
102  'TEC3_pos+TEC4_pos',
103  'TEC4_pos+TEC5_pos',
104  'TEC5_pos+TEC6_pos',
105  'TEC6_pos+TEC7_pos',
106  'TEC7_pos+TEC8_pos',
107 
108  'TEC1_neg+TEC2_neg',
109  'TEC2_neg+TEC3_neg',
110  'TEC3_neg+TEC4_neg',
111  'TEC4_neg+TEC5_neg',
112  'TEC5_neg+TEC6_neg',
113  'TEC6_neg+TEC7_neg',
114  'TEC7_neg+TEC8_neg']
115 
116 _convLayerPairsLayerList = _convLayerPairsStripOnlyLayers
117 _convLayerPairsLayerList =['BPix1+BPix2',
118 
119  'BPix2+BPix3',
120  'BPix2+FPix1_pos',
121  'BPix2+FPix1_neg',
122  'BPix2+FPix2_pos',
123  'BPix2+FPix2_neg',
124 
125  'FPix1_pos+FPix2_pos',
126  'FPix1_neg+FPix2_neg',
127 
128  'BPix3+TIB1',
129  'BPix3+TIB2']
130 _convLayerPairsLayerList.extend(_convLayerPairsStripOnlyLayers)
131 
132 
134 
135 convLayerPairs = _mod.seedingLayersEDProducer.clone(
136  layerList = _convLayerPairsLayerList,
137  BPix = dict(
138  TTRHBuilder = cms.string('WithTrackAngle'),
139  HitProducer = cms.string('siPixelRecHits'),
140  skipClusters = cms.InputTag('convClusters'),
141  ),
142  FPix = dict(
143  TTRHBuilder = cms.string('WithTrackAngle'),
144  HitProducer = cms.string('siPixelRecHits'),
145  skipClusters = cms.InputTag('convClusters'),
146  ),
147  TIB = dict(
148  TTRHBuilder = cms.string('WithTrackAngle'),
149  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
150  matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
151  skipClusters = cms.InputTag('convClusters'),
152  ),
153  MTIB = dict(
154  TTRHBuilder = cms.string('WithTrackAngle'),
155  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
156  rphiRecHits = cms.InputTag('siStripMatchedRecHits','rphiRecHit'),
157  skipClusters = cms.InputTag('convClusters'),
158  ),
159  TID = dict(
160  useSimpleRphiHitsCleaner = cms.bool(False),
161  matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
162  useRingSlector = cms.bool(True),
163  TTRHBuilder = cms.string('WithTrackAngle'),
164  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
165  maxRing = cms.int32(2),
166  minRing = cms.int32(1),
167  skipClusters = cms.InputTag('convClusters'),
168  ),
169  TEC = dict(
170  useSimpleRphiHitsCleaner = cms.bool(False),
171  minRing = cms.int32(1),
172  matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
173  useRingSlector = cms.bool(True),
174  TTRHBuilder = cms.string('WithTrackAngle'),
175  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
176  rphiRecHits = cms.InputTag('siStripMatchedRecHits','rphiRecHitUnmatched'),
177  maxRing = cms.int32(7),
178  stereoRecHits = cms.InputTag('siStripMatchedRecHits','stereoRecHitUnmatched'),
179  skipClusters = cms.InputTag('convClusters'),
180  ),
181  TOB = dict(
182  matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
183  TTRHBuilder = cms.string('WithTrackAngle'),
184  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
185  skipClusters = cms.InputTag('convClusters'),
186  ),
187  MTOB = dict(
188  TTRHBuilder = cms.string('WithTrackAngle'),
189  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
190  rphiRecHits = cms.InputTag('siStripMatchedRecHits','rphiRecHit'),
191  skipClusters = cms.InputTag('convClusters'),
192  ),
193  )
194 
195 #this was done by Sam Harper (Aug 2017) and is a best guess (and I do guess wrong sometimes)
196 #in general I kept all the old layer pairs and added sensible phaseI combinations
197 #most pairs are adjacent layers (with some small exceptions) so I stuck to that
198 _convLayerPairsLayerListPhaseI = ['BPix1+BPix2',
199 
200  'BPix2+BPix3',
201  'BPix3+BPix4',#added for PhaseI
202 
203  'BPix2+FPix1_pos',
204  'BPix2+FPix1_neg',
205  'BPix2+FPix2_pos',
206  'BPix2+FPix2_neg',
207  'BPix3+FPix1_pos', #added for phaseI
208  'BPix3+FPix1_neg', #added for phaseI
209 
210  'FPix1_pos+FPix2_pos',
211  'FPix1_neg+FPix2_neg',
212 
213  'FPix2_pos+FPix3_pos', #added for phaseI
214  'FPix2_neg+FPix3_neg',#added for phaseI
215 
216  'BPix3+TIB1',
217  #'BPix3+TIB2' #removed for phaseI
218  'BPix4+TIB1', #added for phase I
219  'BPix4+TIB2', #added for phase I
220  ]
221 _convLayerPairsLayerListPhaseI.extend(_convLayerPairsStripOnlyLayers)
222 
223 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
224 trackingPhase1.toModify(convLayerPairs, layerList = _convLayerPairsLayerListPhaseI)
225 
226 
227 trackingPhase2PU140.toReplaceWith(convLayerPairs, cms.EDProducer('SeedingLayersEDProducer',
228  layerList = cms.vstring('BPix1+BPix2',
229  'BPix2+BPix3',
230  'BPix3+BPix4',
231 
232  'BPix1+FPix1_pos',
233  'BPix1+FPix1_neg',
234  'BPix2+FPix1_pos',
235  'BPix2+FPix1_neg',
236  'BPix3+FPix1_pos',
237  'BPix3+FPix1_neg',
238 
239  'FPix1_pos+FPix2_pos',
240  'FPix1_neg+FPix2_neg',
241  'FPix2_pos+FPix3_pos',
242  'FPix2_neg+FPix3_neg'
243  ),
244 
245  BPix = cms.PSet(
246  hitErrorRZ = cms.double(0.006),
247  hitErrorRPhi = cms.double(0.0027),
248  TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
249  HitProducer = cms.string('siPixelRecHits'),
250  useErrorsFromParam = cms.bool(True),
251  skipClusters = cms.InputTag('convClusters'),
252  ),
253  FPix = cms.PSet(
254  hitErrorRZ = cms.double(0.0036),
255  hitErrorRPhi = cms.double(0.0051),
256  TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
257  HitProducer = cms.string('siPixelRecHits'),
258  useErrorsFromParam = cms.bool(True),
259  skipClusters = cms.InputTag('convClusters'),
260  )
261  )
262 )
263 
264 photonConvTrajSeedFromSingleLeg.TrackRefitter = 'generalTracks'
265 photonConvTrajSeedFromSingleLeg.primaryVerticesTag = 'firstStepPrimaryVertices'
266 #photonConvTrajSeedFromQuadruplets.TrackRefitter = 'generalTracks'
267 #photonConvTrajSeedFromQuadruplets.primaryVerticesTag = 'pixelVertices'
268 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
269 trackingLowPU.toModify(photonConvTrajSeedFromSingleLeg, primaryVerticesTag = 'pixelVertices')
270 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
271 pp_on_AA.toModify(photonConvTrajSeedFromSingleLeg, vtxMinDoF = 999999.)
272 
273 # TRACKER DATA CONTROL
274 
275 # QUALITY CUTS DURING TRACK BUILDING
277 convCkfTrajectoryFilter = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
278  maxLostHits = 1,
279  minimumNumberOfHits = 3,
280  minPt = 0.1
281 )
282 
283 
284 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
285 convStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
286  ComponentName = 'convStepChi2Est',
287  nSigma = 3.0,
288  MaxChi2 = 30.0,
289  MaxDisplacement = 100,
290  MaxSagitta = -1.,
291  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTight')
292 )
293 
294 
295 # TRACK BUILDING
297 _convCkfTrajectoryBuilderBase = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
298  trajectoryFilter = dict(refToPSet_ = 'convCkfTrajectoryFilter'),
299  minNrOfHitsForRebuild = 3,
300  maxCand = 1
301 )
302 
303 convCkfTrajectoryBuilder = _convCkfTrajectoryBuilderBase.clone(
304  estimator = 'convStepChi2Est'
305 )
306 
307 trackingPhase2PU140.toReplaceWith(convCkfTrajectoryBuilder, _convCkfTrajectoryBuilderBase.clone(
308  maxCand = 2
309 ))
310 
311 # MAKING OF TRACK CANDIDATES
313 convTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
314  src = 'photonConvTrajSeedFromSingleLeg:convSeedCandidates',
315  clustersToSkip = 'convClusters',
316  TrajectoryBuilderPSet = dict(refToPSet_ = 'convCkfTrajectoryBuilder')
317 )
318 
319 trackingPhase2PU140.toModify(convTrackCandidates,
320  clustersToSkip = '',
321  phase2clustersToSkip = 'convClusters'
322 )
323 
325 convStepFitterSmoother = TrackingTools.TrackFitters.RungeKuttaFitters_cff.KFFittingSmootherWithOutliersRejectionAndRK.clone(
326  ComponentName = 'convStepFitterSmoother',
327  EstimateCut = 30,
328  Smoother = 'convStepRKSmoother'
329 )
330 
331 convStepRKTrajectorySmoother = TrackingTools.TrackFitters.RungeKuttaFitters_cff.RKTrajectorySmoother.clone(
332  ComponentName = 'convStepRKSmoother',
333  errorRescaling = 10.0
334 )
335 
336 
337 # TRACK FITTING
339 convStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
340  src = 'convTrackCandidates',
341  AlgorithmName = 'conversionStep',
342  Fitter = 'convStepFitterSmoother'
343 )
344 
345 
346 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
347 convStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
348  src='convStepTracks',
349  trackSelectors= cms.VPSet(
350  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
351  name = 'convStepLoose',
352  applyAdaptedPVCuts = False,
353  chi2n_par = 3.0,
354  res_par = ( 0.003, 0.001 ),
355  minNumberLayers = 3,
356  maxNumberLostLayers = 1,
357  minNumber3DLayers = 1,
358  d0_par1 = ( 5., 8.0 ), # not sure these values are sane....
359  dz_par1 = ( 5., 8.0 ),
360  d0_par2 = ( 5., 8.0 ),
361  dz_par2 = ( 5., 8.0 )
362  ),
363  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
364  name = 'convStepTight',
365  preFilterName = 'convStepLoose',
366  chi2n_par = 2.5,
367  res_par = ( 0.003, 0.001 ),
368  minNumberLayers = 3,
369  maxNumberLostLayers = 1,
370  minNumber3DLayers = 1,
371  d0_par1 = ( 5., 8.0 ),
372  dz_par1 = ( 5., 8.0 ),
373  d0_par2 = ( 5., 8.0 ),
374  dz_par2 = ( 5., 8.0 )
375  ),
376  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
377  name = 'convStep',
378  preFilterName = 'convStepTight',
379  chi2n_par = 2.0,
380  res_par = ( 0.003, 0.001 ),
381  minNumberLayers = 3,
382  maxNumberLostLayers = 1,
383  minNumber3DLayers = 1,
384  d0_par1 = ( 5., 8.0 ),
385  dz_par1 = ( 5., 8.0 ),
386  d0_par2 = ( 5., 8.0 ),
387  dz_par2 = ( 5., 8.0 )
388  ),
389  ) #end of vpset
390 ) #end of clone
391 
392 ConvStepTask = cms.Task( convClusters
393  , convLayerPairs
394  , photonConvTrajSeedFromSingleLeg
395  , convTrackCandidates
396  , convStepTracks
397  , convStepSelector
398  #+ Conv2Step #full quad-seeding sequence
399  )
400 ConvStep = cms.Sequence( ConvStepTask )
401 
402 
403