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