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