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+TIB3',
42 
43  'TIB2+TID1_pos',
44  'TIB2+TID1_neg',
45  'TIB2+TID2_pos',
46  'TIB2+TID2_neg',
47  'TIB2+TIB3',
48  'TIB2+TIB4',
49 
50  'TIB3+TIB4',
51  'TIB3+TOB1',
52  'TIB3+TID1_pos',
53  'TIB3+TID1_neg',
54 
55  'TIB4+TOB1',
56  'TIB4+TOB2',
57 
58  'TOB1+TOB2',
59  'TOB1+TOB3',
60  'TOB1+TEC1_pos',
61  'TOB1+TEC1_neg',
62 
63  'TOB2+TOB3',
64  'TOB2+TOB4',
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  #'TOB3+TOB4',
72  #'TOB3+TOB5',
73  #'TOB3+TEC1_pos',
74  #'TOB3+TEC1_neg',
75  #
76  #'TOB4+TOB5',
77  #'TOB4+TOB6',
78  #
79  #'TOB5+TOB6',
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  TIB1 = 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  TIB2 = cms.PSet(
141  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
142  matchedRecHits = cms.InputTag("siStripMatchedRecHits","matchedRecHit"),
143  skipClusters = cms.InputTag('convClusters'),
144  ),
145  TIB3 = cms.PSet(
146  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
147  rphiRecHits = cms.InputTag("siStripMatchedRecHits","rphiRecHit"),
148  skipClusters = cms.InputTag('convClusters'),
149  ),
150  TIB4 = cms.PSet(
151  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
152  rphiRecHits = cms.InputTag("siStripMatchedRecHits","rphiRecHit"),
153  skipClusters = cms.InputTag('convClusters'),
154  ),
155  TID1 = cms.PSet(
156  useSimpleRphiHitsCleaner = cms.bool(False),
157  matchedRecHits = cms.InputTag("siStripMatchedRecHits","matchedRecHit"),
158  useRingSlector = cms.bool(True),
159  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
160  maxRing = cms.int32(2),
161  minRing = cms.int32(1),
162  skipClusters = cms.InputTag('convClusters'),
163  ),
164  TID2 = cms.PSet(
165  useSimpleRphiHitsCleaner = cms.bool(False),
166  matchedRecHits = cms.InputTag("siStripMatchedRecHits","matchedRecHit"),
167  useRingSlector = cms.bool(True),
168  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
169  maxRing = cms.int32(2),
170  minRing = cms.int32(1),
171  skipClusters = cms.InputTag('convClusters'),
172  ),
173  TID3 = cms.PSet(
174  useSimpleRphiHitsCleaner = cms.bool(False),
175  matchedRecHits = cms.InputTag("siStripMatchedRecHits","matchedRecHit"),
176  useRingSlector = cms.bool(True),
177  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
178  maxRing = cms.int32(2),
179  minRing = cms.int32(1),
180  skipClusters = cms.InputTag('convClusters'),
181  ),
182  TEC = cms.PSet(
183  useSimpleRphiHitsCleaner = cms.bool(False),
184  minRing = cms.int32(1),
185  matchedRecHits = cms.InputTag("siStripMatchedRecHits","matchedRecHit"),
186  useRingSlector = cms.bool(True),
187  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
188  rphiRecHits = cms.InputTag("siStripMatchedRecHits","rphiRecHitUnmatched"),
189  maxRing = cms.int32(7),
190  stereoRecHits = cms.InputTag("siStripMatchedRecHits","stereoRecHitUnmatched"),
191  skipClusters = cms.InputTag('convClusters'),
192  ),
193  TOB1 = cms.PSet(
194  matchedRecHits = cms.InputTag("siStripMatchedRecHits","matchedRecHit"),
195  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
196  skipClusters = cms.InputTag('convClusters'),
197  ),
198  TOB2 = cms.PSet(
199  matchedRecHits = cms.InputTag("siStripMatchedRecHits","matchedRecHit"),
200  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
201  skipClusters = cms.InputTag('convClusters'),
202  ),
203  TOB3 = cms.PSet(
204  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
205  rphiRecHits = cms.InputTag("siStripMatchedRecHits","rphiRecHit"),
206  skipClusters = cms.InputTag('convClusters'),
207  ),
208  TOB4 = cms.PSet(
209  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
210  rphiRecHits = cms.InputTag("siStripMatchedRecHits","rphiRecHit"),
211  skipClusters = cms.InputTag('convClusters'),
212  ),
213  TOB5 = cms.PSet(
214  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
215  rphiRecHits = cms.InputTag("siStripMatchedRecHits","rphiRecHit"),
216  skipClusters = cms.InputTag('convClusters'),
217  ),
218  TOB6 = cms.PSet(
219  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
220  rphiRecHits = cms.InputTag("siStripMatchedRecHits","rphiRecHit"),
221  skipClusters = cms.InputTag('convClusters'),
222  )
223  )
224 
225 #this was done by Sam Harper (Aug 2017) and is a best guess (and I do guess wrong sometimes)
226 #in general I kept all the old layer pairs and added sensible phaseI combinations
227 #most pairs are adjacent layers (with some small exceptions) so I stuck to that
228 _convLayerPairsLayerListPhaseI = ['BPix1+BPix2',
229 
230  'BPix2+BPix3',
231  'BPix3+BPix4',#added for PhaseI
232 
233  'BPix2+FPix1_pos',
234  'BPix2+FPix1_neg',
235  'BPix2+FPix2_pos',
236  'BPix2+FPix2_neg',
237  'BPix3+FPix1_pos', #added for phaseI
238  'BPix3+FPix1_neg', #added for phaseI
239 
240  'FPix1_pos+FPix2_pos',
241  'FPix1_neg+FPix2_neg',
242 
243  'FPix2_pos+FPix3_pos', #added for phaseI
244  'FPix2_neg+FPix3_neg',#added for phaseI
245 
246  'BPix3+TIB1',
247  #'BPix3+TIB2' #removed for phaseI
248  'BPix4+TIB1', #added for phase I
249  'BPix4+TIB2', #added for phase I
250  ]
251 _convLayerPairsLayerListPhaseI.extend(_convLayerPairsStripOnlyLayers)
252 
253 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
254 trackingPhase1.toModify(convLayerPairs, layerList = cms.vstring(_convLayerPairsLayerListPhaseI))
255 
256 
257 trackingPhase2PU140.toReplaceWith(convLayerPairs, cms.EDProducer("SeedingLayersEDProducer",
258  layerList = cms.vstring('BPix1+BPix2',
259  'BPix2+BPix3',
260  'BPix3+BPix4',
261 
262  'BPix1+FPix1_pos',
263  'BPix1+FPix1_neg',
264  'BPix2+FPix1_pos',
265  'BPix2+FPix1_neg',
266  'BPix3+FPix1_pos',
267  'BPix3+FPix1_neg',
268 
269  'FPix1_pos+FPix2_pos',
270  'FPix1_neg+FPix2_neg',
271  'FPix2_pos+FPix3_pos',
272  'FPix2_neg+FPix3_neg'
273  ),
274 
275  BPix = cms.PSet(
276  hitErrorRZ = cms.double(0.006),
277  hitErrorRPhi = cms.double(0.0027),
278  TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
279  HitProducer = cms.string('siPixelRecHits'),
280  useErrorsFromParam = cms.bool(True),
281  skipClusters = cms.InputTag('convClusters'),
282  ),
283  FPix = cms.PSet(
284  hitErrorRZ = cms.double(0.0036),
285  hitErrorRPhi = cms.double(0.0051),
286  TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
287  HitProducer = cms.string('siPixelRecHits'),
288  useErrorsFromParam = cms.bool(True),
289  skipClusters = cms.InputTag('convClusters'),
290  )
291  )
292 )
293 
294 photonConvTrajSeedFromSingleLeg.TrackRefitter = cms.InputTag('generalTracks')
295 photonConvTrajSeedFromSingleLeg.primaryVerticesTag = cms.InputTag('firstStepPrimaryVertices')
296 #photonConvTrajSeedFromQuadruplets.TrackRefitter = cms.InputTag('generalTracks')
297 #photonConvTrajSeedFromQuadruplets.primaryVerticesTag = cms.InputTag('pixelVertices')
298 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
299 trackingLowPU.toModify(photonConvTrajSeedFromSingleLeg, primaryVerticesTag = "pixelVertices")
300 
301 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
302 pp_on_XeXe_2017.toModify(photonConvTrajSeedFromSingleLeg,
303  RegionFactoryPSet = dict(RegionPSet = dict(ptMin = 999999.0,
304  originRadius = 0,
305  originHalfLength = 0
306  ))
307  )
308 
309 # TRACKER DATA CONTROL
310 
311 # QUALITY CUTS DURING TRACK BUILDING
313 convCkfTrajectoryFilter = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
314  maxLostHits = 1,
315  minimumNumberOfHits = 3,
316  minPt = 0.1
317  )
318 
319 
320 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
321 convStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
322  ComponentName = cms.string('convStepChi2Est'),
323  nSigma = cms.double(3.0),
324  MaxChi2 = cms.double(30.0),
325  MaxDisplacement = cms.double(100),
326  MaxSagitta = cms.double(-1.),
327  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight'))
328 )
329 
330 
331 # TRACK BUILDING
333 _convCkfTrajectoryBuilderBase = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
334  trajectoryFilter = cms.PSet(refToPSet_ = cms.string('convCkfTrajectoryFilter')),
335  minNrOfHitsForRebuild = 3,
336  maxCand = 1,
337 )
338 convCkfTrajectoryBuilder = _convCkfTrajectoryBuilderBase.clone(
339  estimator = cms.string('convStepChi2Est')
340  )
341 trackingPhase2PU140.toReplaceWith(convCkfTrajectoryBuilder, _convCkfTrajectoryBuilderBase.clone(
342  maxCand = 2,
343 ))
344 
345 # MAKING OF TRACK CANDIDATES
347 convTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
348  src = cms.InputTag('photonConvTrajSeedFromSingleLeg:convSeedCandidates'),
349  clustersToSkip = cms.InputTag('convClusters'),
350  TrajectoryBuilderPSet = cms.PSet(refToPSet_ = cms.string('convCkfTrajectoryBuilder'))
351 )
352 trackingPhase2PU140.toModify(convTrackCandidates,
353  clustersToSkip = None,
354  phase2clustersToSkip = cms.InputTag("convClusters")
355 )
356 
358 convStepFitterSmoother = TrackingTools.TrackFitters.RungeKuttaFitters_cff.KFFittingSmootherWithOutliersRejectionAndRK.clone(
359  ComponentName = 'convStepFitterSmoother',
360  EstimateCut = 30,
361  Smoother = cms.string('convStepRKSmoother')
362  )
363 
364 convStepRKTrajectorySmoother = TrackingTools.TrackFitters.RungeKuttaFitters_cff.RKTrajectorySmoother.clone(
365  ComponentName = cms.string('convStepRKSmoother'),
366  errorRescaling = 10.0
367  )
368 
369 
370 # TRACK FITTING
372 convStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
373  src = 'convTrackCandidates',
374  AlgorithmName = cms.string('conversionStep'),
375  Fitter = 'convStepFitterSmoother',
376  )
377 
378 
379 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
380 convStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
381  src='convStepTracks',
382  trackSelectors= cms.VPSet(
383  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
384  name = 'convStepLoose',
385  applyAdaptedPVCuts = False,
386  chi2n_par = 3.0,
387  res_par = ( 0.003, 0.001 ),
388  minNumberLayers = 3,
389  maxNumberLostLayers = 1,
390  minNumber3DLayers = 1,
391  d0_par1 = ( 5., 8.0 ), # not sure these values are sane....
392  dz_par1 = ( 5., 8.0 ),
393  d0_par2 = ( 5., 8.0 ),
394  dz_par2 = ( 5., 8.0 )
395  ),
396  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
397  name = 'convStepTight',
398  preFilterName = 'convStepLoose',
399  chi2n_par = 2.5,
400  res_par = ( 0.003, 0.001 ),
401  minNumberLayers = 3,
402  maxNumberLostLayers = 1,
403  minNumber3DLayers = 1,
404  d0_par1 = ( 5., 8.0 ),
405  dz_par1 = ( 5., 8.0 ),
406  d0_par2 = ( 5., 8.0 ),
407  dz_par2 = ( 5., 8.0 )
408  ),
409  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
410  name = 'convStep',
411  preFilterName = 'convStepTight',
412  chi2n_par = 2.0,
413  res_par = ( 0.003, 0.001 ),
414  minNumberLayers = 3,
415  maxNumberLostLayers = 1,
416  minNumber3DLayers = 1,
417  d0_par1 = ( 5., 8.0 ),
418  dz_par1 = ( 5., 8.0 ),
419  d0_par2 = ( 5., 8.0 ),
420  dz_par2 = ( 5., 8.0 )
421  ),
422  ) #end of vpset
423  ) #end of clone
424 
425 ConvStep = cms.Sequence( convClusters
426  + convLayerPairs
427  + photonConvTrajSeedFromSingleLeg
428  + convTrackCandidates
429  + convStepTracks
430  + convStepSelector
431  #+ Conv2Step #full quad-seeding sequence
432  )
433 
434 
435 ### Quad-seeding sequence disabled (#+ Conv2Step)
436 # if enabled, the quad-seeded tracks have to be merged with the single-leg seeded tracks
437 # in RecoTracker.FinalTrackSelectors.MergeTrackCollections_cff change:
438 ###
439 #conversionStepTracks = RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
440 # TrackProducers = cms.VInputTag(cms.InputTag('convStepTracks')),
441 # hasSelector=cms.vint32(1),
442 # selectedTrackQuals = cms.VInputTag(cms.InputTag("convStepSelector","convStep")
443 # ),
444 # setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(1), pQual=cms.bool(True) )
445 # ),
446 # copyExtras = True,
447 # makeReKeyedSeeds = cms.untracked.bool(False)
448 # )
449 ###
450 # TO this:
451 ###
452 #conversionStepTracks = RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
453 # TrackProducers = cms.VInputTag(
454 # cms.InputTag('convStepTracks'),
455 # cms.InputTag('conv2StepTracks')
456 # ),
457 # hasSelector=cms.vint32(1,1),
458 # selectedTrackQuals = cms.VInputTag(
459 # cms.InputTag("convStepSelector","convStep"),
460 # cms.InputTag("conv2StepSelector","conv2Step")
461 # ),
462 # setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1), pQual=cms.bool(True) )
463 # ),
464 # copyExtras = True,
465 # makeReKeyedSeeds = cms.untracked.bool(False)
466 # )
467 ###