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