CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
124 
125 convLayerPairs = _mod.seedingLayersEDProducer.clone(
126  layerList = _convLayerPairsLayerList,
127  BPix = dict(
128  TTRHBuilder = cms.string('WithTrackAngle'),
129  HitProducer = cms.string('siPixelRecHits'),
130  skipClusters = cms.InputTag('convClusters'),
131  ),
132  FPix = dict(
133  TTRHBuilder = cms.string('WithTrackAngle'),
134  HitProducer = cms.string('siPixelRecHits'),
135  skipClusters = cms.InputTag('convClusters'),
136  ),
137  TIB = dict(
138  TTRHBuilder = cms.string('WithTrackAngle'),
139  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
140  matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
141  skipClusters = cms.InputTag('convClusters'),
142  ),
143  MTIB = dict(
144  TTRHBuilder = cms.string('WithTrackAngle'),
145  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
146  rphiRecHits = cms.InputTag('siStripMatchedRecHits','rphiRecHit'),
147  skipClusters = cms.InputTag('convClusters'),
148  ),
149  TID = dict(
150  useSimpleRphiHitsCleaner = cms.bool(False),
151  matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
152  useRingSlector = cms.bool(True),
153  TTRHBuilder = cms.string('WithTrackAngle'),
154  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
155  maxRing = cms.int32(2),
156  minRing = cms.int32(1),
157  skipClusters = cms.InputTag('convClusters'),
158  ),
159  TEC = dict(
160  useSimpleRphiHitsCleaner = cms.bool(False),
161  minRing = cms.int32(1),
162  matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
163  useRingSlector = cms.bool(True),
164  TTRHBuilder = cms.string('WithTrackAngle'),
165  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
166  rphiRecHits = cms.InputTag('siStripMatchedRecHits','rphiRecHitUnmatched'),
167  maxRing = cms.int32(7),
168  stereoRecHits = cms.InputTag('siStripMatchedRecHits','stereoRecHitUnmatched'),
169  skipClusters = cms.InputTag('convClusters'),
170  ),
171  TOB = dict(
172  matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
173  TTRHBuilder = cms.string('WithTrackAngle'),
174  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
175  skipClusters = cms.InputTag('convClusters'),
176  ),
177  MTOB = dict(
178  TTRHBuilder = cms.string('WithTrackAngle'),
179  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
180  rphiRecHits = cms.InputTag('siStripMatchedRecHits','rphiRecHit'),
181  skipClusters = cms.InputTag('convClusters'),
182  ),
183  )
184 
185 #this was done by Sam Harper (Aug 2017) and is a best guess (and I do guess wrong sometimes)
186 #in general I kept all the old layer pairs and added sensible phaseI combinations
187 #most pairs are adjacent layers (with some small exceptions) so I stuck to that
188 _convLayerPairsLayerListPhaseI = ['BPix1+BPix2',
189 
190  'BPix2+BPix3',
191  'BPix3+BPix4',#added for PhaseI
192 
193  'BPix2+FPix1_pos',
194  'BPix2+FPix1_neg',
195  'BPix2+FPix2_pos',
196  'BPix2+FPix2_neg',
197  'BPix3+FPix1_pos', #added for phaseI
198  'BPix3+FPix1_neg', #added for phaseI
199 
200  'FPix1_pos+FPix2_pos',
201  'FPix1_neg+FPix2_neg',
202 
203  'FPix2_pos+FPix3_pos', #added for phaseI
204  'FPix2_neg+FPix3_neg',#added for phaseI
205 
206  'BPix3+TIB1',
207  #'BPix3+TIB2' #removed for phaseI
208  'BPix4+TIB1', #added for phase I
209  'BPix4+TIB2', #added for phase I
210  ]
211 _convLayerPairsLayerListPhaseI.extend(_convLayerPairsStripOnlyLayers)
212 
213 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
214 trackingPhase1.toModify(convLayerPairs, layerList = _convLayerPairsLayerListPhaseI)
215 
216 
217 trackingPhase2PU140.toReplaceWith(convLayerPairs, cms.EDProducer('SeedingLayersEDProducer',
218  layerList = cms.vstring('BPix1+BPix2',
219  'BPix2+BPix3',
220  'BPix3+BPix4',
221 
222  'BPix1+FPix1_pos',
223  'BPix1+FPix1_neg',
224  'BPix2+FPix1_pos',
225  'BPix2+FPix1_neg',
226  'BPix3+FPix1_pos',
227  'BPix3+FPix1_neg',
228 
229  'FPix1_pos+FPix2_pos',
230  'FPix1_neg+FPix2_neg',
231  'FPix2_pos+FPix3_pos',
232  'FPix2_neg+FPix3_neg'
233  ),
234 
235  BPix = cms.PSet(
236  hitErrorRZ = cms.double(0.006),
237  hitErrorRPhi = cms.double(0.0027),
238  TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
239  HitProducer = cms.string('siPixelRecHits'),
240  useErrorsFromParam = cms.bool(True),
241  skipClusters = cms.InputTag('convClusters'),
242  ),
243  FPix = cms.PSet(
244  hitErrorRZ = cms.double(0.0036),
245  hitErrorRPhi = cms.double(0.0051),
246  TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
247  HitProducer = cms.string('siPixelRecHits'),
248  useErrorsFromParam = cms.bool(True),
249  skipClusters = cms.InputTag('convClusters'),
250  )
251  )
252 )
253 
254 photonConvTrajSeedFromSingleLeg.TrackRefitter = 'generalTracks'
255 photonConvTrajSeedFromSingleLeg.primaryVerticesTag = 'firstStepPrimaryVertices'
256 #photonConvTrajSeedFromQuadruplets.TrackRefitter = 'generalTracks'
257 #photonConvTrajSeedFromQuadruplets.primaryVerticesTag = 'pixelVertices'
258 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
259 trackingLowPU.toModify(photonConvTrajSeedFromSingleLeg, primaryVerticesTag = 'pixelVertices')
260 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
261 pp_on_AA.toModify(photonConvTrajSeedFromSingleLeg, vtxMinDoF = 999999.)
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 = 'convStepChi2Est',
277  nSigma = 3.0,
278  MaxChi2 = 30.0,
279  MaxDisplacement = 100,
280  MaxSagitta = -1.,
281  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTight')
282 )
283 
284 
285 # TRACK BUILDING
287 _convCkfTrajectoryBuilderBase = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
288  trajectoryFilter = dict(refToPSet_ = 'convCkfTrajectoryFilter'),
289  minNrOfHitsForRebuild = 3,
290  maxCand = 1
291 )
292 
293 convCkfTrajectoryBuilder = _convCkfTrajectoryBuilderBase.clone(
294  estimator = 'convStepChi2Est'
295 )
296 
297 trackingPhase2PU140.toReplaceWith(convCkfTrajectoryBuilder, _convCkfTrajectoryBuilderBase.clone(
298  maxCand = 2
299 ))
300 
301 # MAKING OF TRACK CANDIDATES
303 convTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
304  src = 'photonConvTrajSeedFromSingleLeg:convSeedCandidates',
305  clustersToSkip = 'convClusters',
306  TrajectoryBuilderPSet = dict(refToPSet_ = 'convCkfTrajectoryBuilder')
307 )
308 
309 trackingPhase2PU140.toModify(convTrackCandidates,
310  clustersToSkip = '',
311  phase2clustersToSkip = 'convClusters'
312 )
313 
315 convStepFitterSmoother = TrackingTools.TrackFitters.RungeKuttaFitters_cff.KFFittingSmootherWithOutliersRejectionAndRK.clone(
316  ComponentName = 'convStepFitterSmoother',
317  EstimateCut = 30,
318  Smoother = 'convStepRKSmoother'
319 )
320 
321 convStepRKTrajectorySmoother = TrackingTools.TrackFitters.RungeKuttaFitters_cff.RKTrajectorySmoother.clone(
322  ComponentName = 'convStepRKSmoother',
323  errorRescaling = 10.0
324 )
325 
326 
327 # TRACK FITTING
329 convStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
330  src = 'convTrackCandidates',
331  AlgorithmName = 'conversionStep',
332  Fitter = 'convStepFitterSmoother'
333 )
334 
335 
336 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
337 convStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
338  src='convStepTracks',
339  trackSelectors= cms.VPSet(
340  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
341  name = 'convStepLoose',
342  applyAdaptedPVCuts = False,
343  chi2n_par = 3.0,
344  res_par = ( 0.003, 0.001 ),
345  minNumberLayers = 3,
346  maxNumberLostLayers = 1,
347  minNumber3DLayers = 1,
348  d0_par1 = ( 5., 8.0 ), # not sure these values are sane....
349  dz_par1 = ( 5., 8.0 ),
350  d0_par2 = ( 5., 8.0 ),
351  dz_par2 = ( 5., 8.0 )
352  ),
353  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
354  name = 'convStepTight',
355  preFilterName = 'convStepLoose',
356  chi2n_par = 2.5,
357  res_par = ( 0.003, 0.001 ),
358  minNumberLayers = 3,
359  maxNumberLostLayers = 1,
360  minNumber3DLayers = 1,
361  d0_par1 = ( 5., 8.0 ),
362  dz_par1 = ( 5., 8.0 ),
363  d0_par2 = ( 5., 8.0 ),
364  dz_par2 = ( 5., 8.0 )
365  ),
366  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
367  name = 'convStep',
368  preFilterName = 'convStepTight',
369  chi2n_par = 2.0,
370  res_par = ( 0.003, 0.001 ),
371  minNumberLayers = 3,
372  maxNumberLostLayers = 1,
373  minNumber3DLayers = 1,
374  d0_par1 = ( 5., 8.0 ),
375  dz_par1 = ( 5., 8.0 ),
376  d0_par2 = ( 5., 8.0 ),
377  dz_par2 = ( 5., 8.0 )
378  ),
379  ) #end of vpset
380 ) #end of clone
381 
382 ConvStepTask = cms.Task( convClusters
383  , convLayerPairs
384  , photonConvTrajSeedFromSingleLeg
385  , convTrackCandidates
386  , convStepTracks
387  , convStepSelector
388  #+ Conv2Step #full quad-seeding sequence
389  )
390 ConvStep = cms.Sequence( ConvStepTask )
391 
392 
393