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 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
254 from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018
255 for e in [pp_on_XeXe_2017, pp_on_AA_2018]:
256  e.toModify(photonConvTrajSeedFromSingleLeg,
257  RegionFactoryPSet = dict(RegionPSet = dict(ptMin = 999999.0,
258  originRadius = 0,
259  originHalfLength = 0)
260  )
261  )
262 
263 # TRACKER DATA CONTROL
264 
265 # QUALITY CUTS DURING TRACK BUILDING
267 convCkfTrajectoryFilter = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
268  maxLostHits = 1,
269  minimumNumberOfHits = 3,
270  minPt = 0.1
271  )
272 
273 
274 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
275 convStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
276  ComponentName = cms.string('convStepChi2Est'),
277  nSigma = cms.double(3.0),
278  MaxChi2 = cms.double(30.0),
279  MaxDisplacement = cms.double(100),
280  MaxSagitta = cms.double(-1.),
281  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight'))
282 )
283 
284 
285 # TRACK BUILDING
287 _convCkfTrajectoryBuilderBase = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
288  trajectoryFilter = cms.PSet(refToPSet_ = cms.string('convCkfTrajectoryFilter')),
289  minNrOfHitsForRebuild = 3,
290  maxCand = 1,
291 )
292 convCkfTrajectoryBuilder = _convCkfTrajectoryBuilderBase.clone(
293  estimator = cms.string('convStepChi2Est')
294  )
295 trackingPhase2PU140.toReplaceWith(convCkfTrajectoryBuilder, _convCkfTrajectoryBuilderBase.clone(
296  maxCand = 2,
297 ))
298 
299 # MAKING OF TRACK CANDIDATES
301 convTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
302  src = cms.InputTag('photonConvTrajSeedFromSingleLeg:convSeedCandidates'),
303  clustersToSkip = cms.InputTag('convClusters'),
304  TrajectoryBuilderPSet = cms.PSet(refToPSet_ = cms.string('convCkfTrajectoryBuilder'))
305 )
306 trackingPhase2PU140.toModify(convTrackCandidates,
307  clustersToSkip = None,
308  phase2clustersToSkip = cms.InputTag("convClusters")
309 )
310 
312 convStepFitterSmoother = TrackingTools.TrackFitters.RungeKuttaFitters_cff.KFFittingSmootherWithOutliersRejectionAndRK.clone(
313  ComponentName = 'convStepFitterSmoother',
314  EstimateCut = 30,
315  Smoother = cms.string('convStepRKSmoother')
316  )
317 
318 convStepRKTrajectorySmoother = TrackingTools.TrackFitters.RungeKuttaFitters_cff.RKTrajectorySmoother.clone(
319  ComponentName = cms.string('convStepRKSmoother'),
320  errorRescaling = 10.0
321  )
322 
323 
324 # TRACK FITTING
326 convStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
327  src = 'convTrackCandidates',
328  AlgorithmName = cms.string('conversionStep'),
329  Fitter = 'convStepFitterSmoother',
330  )
331 
332 
333 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
334 convStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
335  src='convStepTracks',
336  trackSelectors= cms.VPSet(
337  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
338  name = 'convStepLoose',
339  applyAdaptedPVCuts = False,
340  chi2n_par = 3.0,
341  res_par = ( 0.003, 0.001 ),
342  minNumberLayers = 3,
343  maxNumberLostLayers = 1,
344  minNumber3DLayers = 1,
345  d0_par1 = ( 5., 8.0 ), # not sure these values are sane....
346  dz_par1 = ( 5., 8.0 ),
347  d0_par2 = ( 5., 8.0 ),
348  dz_par2 = ( 5., 8.0 )
349  ),
350  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
351  name = 'convStepTight',
352  preFilterName = 'convStepLoose',
353  chi2n_par = 2.5,
354  res_par = ( 0.003, 0.001 ),
355  minNumberLayers = 3,
356  maxNumberLostLayers = 1,
357  minNumber3DLayers = 1,
358  d0_par1 = ( 5., 8.0 ),
359  dz_par1 = ( 5., 8.0 ),
360  d0_par2 = ( 5., 8.0 ),
361  dz_par2 = ( 5., 8.0 )
362  ),
363  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
364  name = 'convStep',
365  preFilterName = 'convStepTight',
366  chi2n_par = 2.0,
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  ) #end of vpset
377  ) #end of clone
378 
379 ConvStepTask = cms.Task( convClusters
380  , convLayerPairs
381  , photonConvTrajSeedFromSingleLeg
382  , convTrackCandidates
383  , convStepTracks
384  , convStepSelector
385  #+ Conv2Step #full quad-seeding sequence
386  )
387 ConvStep = cms.Sequence( ConvStepTask )
388 
389 
390 ### Quad-seeding sequence disabled (#+ Conv2Step)
391 # if enabled, the quad-seeded tracks have to be merged with the single-leg seeded tracks
392 # in RecoTracker.FinalTrackSelectors.MergeTrackCollections_cff change:
393 ###
394 #conversionStepTracks = RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
395 # TrackProducers = cms.VInputTag(cms.InputTag('convStepTracks')),
396 # hasSelector=cms.vint32(1),
397 # selectedTrackQuals = cms.VInputTag(cms.InputTag("convStepSelector","convStep")
398 # ),
399 # setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(1), pQual=cms.bool(True) )
400 # ),
401 # copyExtras = True,
402 # makeReKeyedSeeds = cms.untracked.bool(False)
403 # )
404 ###
405 # TO this:
406 ###
407 #conversionStepTracks = RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
408 # TrackProducers = cms.VInputTag(
409 # cms.InputTag('convStepTracks'),
410 # cms.InputTag('conv2StepTracks')
411 # ),
412 # hasSelector=cms.vint32(1,1),
413 # selectedTrackQuals = cms.VInputTag(
414 # cms.InputTag("convStepSelector","convStep"),
415 # cms.InputTag("conv2StepSelector","conv2Step")
416 # ),
417 # setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1), pQual=cms.bool(True) )
418 # ),
419 # copyExtras = True,
420 # makeReKeyedSeeds = cms.untracked.bool(False)
421 # )
422 ###