CMS 3D CMS Logo

PixelPairStep_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016 as _tracker_apv_vfp30_2016
3 import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg
4 from Configuration.Eras.Modifier_fastSim_cff import fastSim
5 
6 # NEW CLUSTERS (remove previously used clusters)
7 pixelPairStepClusters = _cfg.clusterRemoverForIter("PixelPairStep")
8 for _eraName, _postfix, _era in _cfg.nonDefaultEras():
9  _era.toReplaceWith(pixelPairStepClusters, _cfg.clusterRemoverForIter("PixelPairStep", _eraName, _postfix))
10 
11 
12 # SEEDING LAYERS
13 pixelPairStepSeedLayers = cms.EDProducer("SeedingLayersEDProducer",
14  layerList = cms.vstring('BPix1+BPix2', 'BPix1+BPix3', 'BPix2+BPix3',
15  'BPix1+FPix1_pos', 'BPix1+FPix1_neg',
16  'BPix2+FPix1_pos', 'BPix2+FPix1_neg',
17  'FPix1_pos+FPix2_pos', 'FPix1_neg+FPix2_neg'),
18  BPix = cms.PSet(
19  TTRHBuilder = cms.string('WithTrackAngle'),
20  HitProducer = cms.string('siPixelRecHits'),
21  skipClusters = cms.InputTag('pixelPairStepClusters')
22  ),
23  FPix = cms.PSet(
24  TTRHBuilder = cms.string('WithTrackAngle'),
25  HitProducer = cms.string('siPixelRecHits'),
26  skipClusters = cms.InputTag('pixelPairStepClusters')
27  )
28 )
29 # layers covering the region not covered by quadruplets (so it is
30 # just acting as backup of triplets)
31 _layerListForPhase1 = [
32  'BPix1+BPix2', 'BPix1+BPix3', 'BPix2+BPix3',
33  'BPix1+FPix1_pos', 'BPix1+FPix1_neg',
34  'BPix2+FPix1_pos', 'BPix2+FPix1_neg',
35 ]
36 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
37 from Configuration.Eras.Modifier_trackingPhase1QuadProp_cff import trackingPhase1QuadProp
38 trackingPhase1.toModify(pixelPairStepSeedLayers, layerList = _layerListForPhase1)
39 trackingPhase1QuadProp.toModify(pixelPairStepSeedLayers, layerList = _layerListForPhase1)
40 
41 # only layers covering the region not covered by quadruplets
42 # (so it is just acting as backup of triplets)
43 _layerListForPhase2 = [
44  'BPix1+BPix2', 'BPix1+BPix3', 'BPix2+BPix3',
45  'BPix1+FPix1_pos', 'BPix1+FPix1_neg',
46  'BPix2+FPix1_pos', 'BPix2+FPix1_neg'
47 ]
48 # modifing these errors seems to make no difference
49 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
50 trackingPhase2PU140.toModify(pixelPairStepSeedLayers,
51  layerList = _layerListForPhase2,
52  BPix = dict(
53  useErrorsFromParam = cms.bool(True),
54  hitErrorRPhi = cms.double(0.0016),
55  hitErrorRZ = cms.double(0.0035),
56  TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
57  ),
58  FPix = dict(
59  useErrorsFromParam = cms.bool(True),
60  hitErrorRPhi = cms.double(0.0030),
61  hitErrorRZ = cms.double(0.0020),
62  TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
63  )
64 )
65 
66 # TrackingRegion
67 from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cff import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices
68 pixelPairStepTrackingRegions = _globalTrackingRegionWithVertices.clone(RegionPSet = dict(
69  ptMin = 0.6,
70  originRadius = 0.015,
71  fixedError = 0.03,
72  useMultipleScattering = True,
73 ))
74 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
75 trackingLowPU.toModify(pixelPairStepTrackingRegions, RegionPSet=dict(useMultipleScattering=False))
76 _region_Phase1 = dict(
77  useMultipleScattering = False,
78  maxNVertices = 5,
79 )
80 trackingPhase1.toModify(pixelPairStepTrackingRegions, RegionPSet=_region_Phase1)
81 trackingPhase1QuadProp.toModify(pixelPairStepTrackingRegions, RegionPSet=_region_Phase1)
82 trackingPhase2PU140.toModify(pixelPairStepTrackingRegions, RegionPSet=_region_Phase1)
83 fastSim.toModify(pixelPairStepTrackingRegions, RegionPSet=dict(VertexCollection = "firstStepPrimaryVerticesBeforeMixing"))
84 
85 # SEEDS
86 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
87 pixelPairStepHitDoublets = _hitPairEDProducer.clone(
88  seedingLayers = "pixelPairStepSeedLayers",
89  trackingRegions = "pixelPairStepTrackingRegions",
90  produceSeedingHitSets = True,
91 )
92 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsEDProducer_cff import seedCreatorFromRegionConsecutiveHitsEDProducer as _seedCreatorFromRegionConsecutiveHitsEDProducer
93 pixelPairStepSeeds = _seedCreatorFromRegionConsecutiveHitsEDProducer.clone(
94  seedingHitSets = "pixelPairStepHitDoublets",
95  SeedComparitorPSet = dict(# FIXME: is this defined in any cfi that could be imported instead of copy-paste?
96  ComponentName = 'PixelClusterShapeSeedComparitor',
97  FilterAtHelixStage = cms.bool(True),
98  FilterPixelHits = cms.bool(True),
99  FilterStripHits = cms.bool(False),
100  ClusterShapeHitFilterName = cms.string('ClusterShapeHitFilter'),
101  ClusterShapeCacheSrc = cms.InputTag('siPixelClusterShapeCache'),
102  )
103 )
104 
105 # Clone for the phase1 recovery mode
106 pixelPairStepSeedsA = pixelPairStepSeeds.clone()
107 
108 #have to do it after making pixelPairStepSeedsA since pixelPairStepSeedsB clones A
109 # and then modifies it
110 import FastSimulation.Tracking.TrajectorySeedProducer_cfi
111 fastSim.toReplaceWith(pixelPairStepSeeds,
112  FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
113  trackingRegions = "pixelPairStepTrackingRegions",
114  hitMasks = cms.InputTag("pixelPairStepMasks"),
115  seedFinderSelector = dict(layerList = pixelPairStepSeedLayers.layerList.value())
116  )
117 )
118 
119 # Recovery for L2L3
120 pixelPairStepSeedLayersB = pixelPairStepSeedLayers.clone(
121  layerList = [
122  'BPix1+BPix4',
123  ]
124 )
125 from RecoTracker.TkTrackingRegions.pointSeededTrackingRegion_cfi import pointSeededTrackingRegion as _pointSeededTrackingRegion
126 pixelPairStepTrackingRegionsB = _pointSeededTrackingRegion.clone(
127  RegionPSet = dict(
128  ptMin = 0.6,
129  originRadius = 0.015,
130  mode = "VerticesFixed",
131  zErrorVetex = 0.03,
132  vertexCollection = "firstStepPrimaryVertices",
133  beamSpot = "offlineBeamSpot",
134  maxNVertices = 5,
135  maxNRegions = 5,
136  whereToUseMeasurementTracker = "Never",
137  deltaEta = 1.2,
138  deltaPhi = 0.5,
139  points = dict(
140  eta = [0.0],
141  phi = [3.0],
142  )
143  )
144 )
145 pixelPairStepHitDoubletsB = pixelPairStepHitDoublets.clone(
146  seedingLayers = "pixelPairStepSeedLayersB",
147  trackingRegions = "pixelPairStepTrackingRegionsB",
148 )
149 pixelPairStepSeedsB = pixelPairStepSeedsA.clone(seedingHitSets = "pixelPairStepHitDoubletsB")
150 
151 # Merge
152 from RecoTracker.TkSeedGenerator.GlobalCombinedSeeds_cfi import globalCombinedSeeds as _globalCombinedSeeds
153 _pixelPairStepSeedsMerged = _globalCombinedSeeds.clone(
154  seedCollections = ["pixelPairStepSeedsA", "pixelPairStepSeedsB"],
155 )
156 (trackingPhase1 & ~fastSim).toReplaceWith(pixelPairStepSeeds, _pixelPairStepSeedsMerged)
157 trackingPhase1QuadProp.toReplaceWith(pixelPairStepSeeds, _pixelPairStepSeedsMerged)
158 
159 # QUALITY CUTS DURING TRACK BUILDING
161 _pixelPairStepTrajectoryFilterBase = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
162  minimumNumberOfHits = 3,
163  minPt = 0.1,
164 )
165 pixelPairStepTrajectoryFilterBase = _pixelPairStepTrajectoryFilterBase.clone(
166  seedPairPenalty =0,
167  maxCCCLostHits = 0,
168  minGoodStripCharge = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutLoose'))
169 )
170 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016
171 _tracker_apv_vfp30_2016.toModify(pixelPairStepTrajectoryFilterBase, maxCCCLostHits = 2)
172 trackingLowPU.toReplaceWith(pixelPairStepTrajectoryFilterBase, _pixelPairStepTrajectoryFilterBase)
173 trackingPhase1.toModify(pixelPairStepTrajectoryFilterBase, minimumNumberOfHits = 4)
174 trackingPhase1QuadProp.toModify(pixelPairStepTrajectoryFilterBase, minimumNumberOfHits = 4)
175 trackingPhase2PU140.toReplaceWith(pixelPairStepTrajectoryFilterBase, _pixelPairStepTrajectoryFilterBase.clone(
176  minimumNumberOfHits = 4,
177  maxLostHitsFraction = 1./10.,
178  constantValueForLostHitsFractionFilter = 0.701,
179 ))
180 import RecoPixelVertexing.PixelLowPtUtilities.StripSubClusterShapeTrajectoryFilter_cfi
181 pixelPairStepTrajectoryFilterShape = RecoPixelVertexing.PixelLowPtUtilities.StripSubClusterShapeTrajectoryFilter_cfi.StripSubClusterShapeTrajectoryFilterTIX12.clone()
182 pixelPairStepTrajectoryFilter = cms.PSet(
183  ComponentType = cms.string('CompositeTrajectoryFilter'),
184  filters = cms.VPSet(
185  cms.PSet( refToPSet_ = cms.string('pixelPairStepTrajectoryFilterBase')),
186  # cms.PSet( refToPSet_ = cms.string('pixelPairStepTrajectoryFilterShape'))
187  ),
188 )
190 trackingPhase2PU140.toModify(pixelPairStepTrajectoryFilter,
191  filters = pixelPairStepTrajectoryFilter.filters + [cms.PSet(refToPSet_ = cms.string('ClusterShapeTrajectoryFilter'))]
192 )
193 
194 
195 
196 pixelPairStepTrajectoryFilterInOut = pixelPairStepTrajectoryFilterBase.clone(
197  minimumNumberOfHits = 4,
198  seedExtension = 1,
199  strictSeedExtension = False, # allow inactive
200  pixelSeedExtension = False,
201 )
202 
203 
204 
205 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
206 pixelPairStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
207  ComponentName = cms.string('pixelPairStepChi2Est'),
208  nSigma = cms.double(3.0),
209  MaxChi2 = cms.double(9.0),
210  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutLoose')),
211  pTChargeCutThreshold = cms.double(15.)
212 )
213 _tracker_apv_vfp30_2016.toModify(pixelPairStepChi2Est,
214  clusterChargeCut = dict(refToPSet_ = "SiStripClusterChargeCutTiny")
215 )
216 trackingLowPU.toModify(pixelPairStepChi2Est,
217  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTiny'),
218 )
219 
220 # TRACK BUILDING
222 pixelPairStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
223  MeasurementTrackerName = '',
224  trajectoryFilter = cms.PSet(refToPSet_ = cms.string('pixelPairStepTrajectoryFilter')),
225  maxCand = 3,
226  estimator = cms.string('pixelPairStepChi2Est'),
227  maxDPhiForLooperReconstruction = cms.double(2.0),
228  maxPtForLooperReconstruction = cms.double(0.7)
229  )
230 trackingLowPU.toModify(pixelPairStepTrajectoryBuilder, maxCand = 2)
231 _seedExtension = dict(
232  inOutTrajectoryFilter = dict(refToPSet_ = "pixelPairStepTrajectoryFilterInOut"),
233  useSameTrajFilter = False,
234 )
235 trackingPhase1.toModify(pixelPairStepTrajectoryBuilder, **_seedExtension)
236 trackingPhase1QuadProp.toModify(pixelPairStepTrajectoryBuilder, **_seedExtension)
237 trackingPhase2PU140.toModify(pixelPairStepTrajectoryBuilder, **_seedExtension)
238 
239 
240 
241 
242 # MAKING OF TRACK CANDIDATES
244 pixelPairStepTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
245  src = cms.InputTag('pixelPairStepSeeds'),
246  clustersToSkip = cms.InputTag('pixelPairStepClusters'),
247  TrajectoryBuilderPSet = cms.PSet(refToPSet_ = cms.string('pixelPairStepTrajectoryBuilder')),
248  ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
249  numHitsForSeedCleaner = cms.int32(50),
250  onlyPixelHitsForSeedCleaner = cms.bool(True),
251 
252 )
253 trackingPhase2PU140.toModify(pixelPairStepTrackCandidates,
254  clustersToSkip = None,
255  phase2clustersToSkip = cms.InputTag("pixelPairStepClusters"),
256  TrajectoryCleaner = "pixelPairStepTrajectoryCleanerBySharedHits"
257 )
258 import FastSimulation.Tracking.TrackCandidateProducer_cfi
259 fastSim.toReplaceWith(pixelPairStepTrackCandidates,
260  FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
261  src = cms.InputTag("pixelPairStepSeeds"),
262  MinNumberOfCrossedLayers = 2, # ?
263  hitMasks = cms.InputTag("pixelPairStepMasks")
264  )
265 )
266 
267 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits as _trajectoryCleanerBySharedHits
268 pixelPairStepTrajectoryCleanerBySharedHits = _trajectoryCleanerBySharedHits.clone(
269  ComponentName = 'pixelPairStepTrajectoryCleanerBySharedHits',
270  fractionShared = 0.095,
271  allowSharedFirstHit = True
272 )
273 trackingPhase2PU140.toModify(pixelPairStepTrajectoryCleanerBySharedHits, fractionShared = 0.09)
274 
275 # TRACK FITTING
277 pixelPairStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
278  AlgorithmName = cms.string('pixelPairStep'),
279  src = 'pixelPairStepTrackCandidates',
280  Fitter = cms.string('FlexibleKFFittingSmoother')
281  )
282 fastSim.toModify(pixelPairStepTracks, TTRHBuilder = 'WithoutRefit')
283 
284 # Final selection
286 pixelPairStep = TrackMVAClassifierPrompt.clone()
287 pixelPairStep.src = 'pixelPairStepTracks'
288 pixelPairStep.mva.GBRForestLabel = 'MVASelectorIter2_13TeV'
289 pixelPairStep.qualityCuts = [-0.2,0.0,0.3]
290 
291 trackingPhase1.toModify(pixelPairStep, mva=dict(GBRForestLabel = 'MVASelectorPixelPairStep_Phase1'))
292 trackingPhase1QuadProp.toModify(pixelPairStep, mva=dict(GBRForestLabel = 'MVASelectorPixelPairStep_Phase1'))
293 fastSim.toModify(pixelPairStep, vertices = "firstStepPrimaryVerticesBeforeMixing")
294 
295 # For LowPU and Phase2PU140
297 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
298 pixelPairStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
299  src='pixelPairStepTracks',
300  useAnyMVA = cms.bool(True),
301  GBRForestLabel = cms.string('MVASelectorIter2'),
302  trackSelectors= cms.VPSet(
303  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
304  name = 'pixelPairStepLoose',
305  ), #end of pset
306  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
307  name = 'pixelPairStepTight',
308  preFilterName = 'pixelPairStepLoose',
309  ),
310  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
311  name = 'QualityMasks',
312  preFilterName = 'pixelPairStepTight',
313  ),
314  ),
315  vertices = cms.InputTag("pixelVertices")#end of vpset
316 ) #end of clone
317 trackingPhase2PU140.toModify(pixelPairStepSelector,
318  useAnyMVA = None,
319  GBRForestLabel = None,
320  trackSelectors= cms.VPSet(
321  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
322  name = 'pixelPairStepLoose',
323  chi2n_par = 0.7,
324  res_par = ( 0.003, 0.002 ),
325  minNumberLayers = 3,
326  maxNumberLostLayers = 2,
327  minNumber3DLayers = 3,
328  d0_par1 = ( 0.4, 4.0 ),
329  dz_par1 = ( 0.4, 4.0 ),
330  d0_par2 = ( 0.6, 4.0 ),
331  dz_par2 = ( 0.45, 4.0 )
332  ), #end of pset
333  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
334  name = 'pixelPairStepTight',
335  preFilterName = 'pixelPairStepLoose',
336  chi2n_par = 0.6,
337  res_par = ( 0.003, 0.002 ),
338  minNumberLayers = 4,
339  maxNumberLostLayers = 2,
340  minNumber3DLayers = 3,
341  d0_par1 = ( 0.35, 4.0 ),
342  dz_par1 = ( 0.35, 4.0 ),
343  d0_par2 = ( 0.5, 4.0 ),
344  dz_par2 = ( 0.4, 4.0 )
345  ),
346  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
347  name = 'pixelPairStep',
348  preFilterName = 'pixelPairStepTight',
349  chi2n_par = 0.5,
350  res_par = ( 0.003, 0.001 ),
351  minNumberLayers = 5,
352  maxNumberLostLayers = 2,
353  minNumber3DLayers = 4,
354  d0_par1 = ( 0.3, 4.0 ),
355  dz_par1 = ( 0.3, 4.0 ),
356  d0_par2 = ( 0.45, 4.0 ),
357  dz_par2 = ( 0.35, 4.0 )
358  ),
359  ), #end of vpset
360  vertices = "firstStepPrimaryVertices"
361 ) #end of clone
362 
363 
364 # Final sequence
365 PixelPairStep = cms.Sequence(pixelPairStepClusters*
366  pixelPairStepSeedLayers*
367  pixelPairStepTrackingRegions*
368  pixelPairStepHitDoublets*
369  pixelPairStepSeeds*
370  pixelPairStepTrackCandidates*
371  pixelPairStepTracks*
372  pixelPairStep)
373 _PixelPairStep_LowPU_Phase2PU140 = PixelPairStep.copy()
374 _PixelPairStep_LowPU_Phase2PU140.replace(pixelPairStep, pixelPairStepSelector)
375 trackingLowPU.toReplaceWith(PixelPairStep, _PixelPairStep_LowPU_Phase2PU140)
376 trackingPhase2PU140.toReplaceWith(PixelPairStep, _PixelPairStep_LowPU_Phase2PU140)
377 _PixelPairStep_Phase1 = PixelPairStep.copy()
378 _PixelPairStep_Phase1.replace(pixelPairStepSeeds,
379  pixelPairStepSeedsA *
380  pixelPairStepSeedLayersB*pixelPairStepTrackingRegionsB*pixelPairStepHitDoubletsB*pixelPairStepSeedsB*
381  pixelPairStepSeeds)
382 trackingPhase1.toReplaceWith(PixelPairStep, _PixelPairStep_Phase1)
383 trackingPhase1QuadProp.toReplaceWith(PixelPairStep, _PixelPairStep_Phase1)
384 
385 #fastSim
386 import FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi
387 pixelPairStepMasks = FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi.maskProducerFromClusterRemover(pixelPairStepClusters)
388 fastSim.toReplaceWith(PixelPairStep,
389  cms.Sequence(pixelPairStepMasks
390  +pixelPairStepTrackingRegions
391  +pixelPairStepSeeds
392  +pixelPairStepTrackCandidates
393  +pixelPairStepTracks
394  +pixelPairStep
395  )
396 )