CMS 3D CMS Logo

PixelLessStep_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg
3 
4 from Configuration.Eras.Modifier_fastSim_cff import fastSim
5 
6 #for dnn classifier
7 from Configuration.ProcessModifiers.trackdnn_cff import trackdnn
8 
9 ##########################################################################
10 # Large impact parameter tracking using TIB/TID/TEC stereo layer seeding #
11 ##########################################################################
12 
13 pixelLessStepClusters = _cfg.clusterRemoverForIter("PixelLessStep")
14 for _eraName, _postfix, _era in _cfg.nonDefaultEras():
15  _era.toReplaceWith(pixelLessStepClusters, _cfg.clusterRemoverForIter("PixelLessStep", _eraName, _postfix))
16 
17 
18 
19 # SEEDING LAYERS
21 pixelLessStepSeedLayers = cms.EDProducer("SeedingLayersEDProducer",
22  layerList = cms.vstring(
23  #TIB
24  'TIB1+TIB2+MTIB3','TIB1+TIB2+MTIB4',
25  #TIB+TID
26  'TIB1+TIB2+MTID1_pos','TIB1+TIB2+MTID1_neg',
27  #TID
28  'TID1_pos+TID2_pos+TID3_pos','TID1_neg+TID2_neg+TID3_neg',#ring 1-2 (matched)
29  'TID1_pos+TID2_pos+MTID3_pos','TID1_neg+TID2_neg+MTID3_neg',#ring 3 (mono)
30  'TID1_pos+TID2_pos+MTEC1_pos','TID1_neg+TID2_neg+MTEC1_neg',
31  #TID+TEC RING 1-3
32  'TID2_pos+TID3_pos+TEC1_pos','TID2_neg+TID3_neg+TEC1_neg',#ring 1-2 (matched)
33  'TID2_pos+TID3_pos+MTEC1_pos','TID2_neg+TID3_neg+MTEC1_neg',#ring 3 (mono)
34  #TEC RING 1-3
35  'TEC1_pos+TEC2_pos+TEC3_pos', 'TEC1_neg+TEC2_neg+TEC3_neg',
36  'TEC1_pos+TEC2_pos+MTEC3_pos','TEC1_neg+TEC2_neg+MTEC3_neg',
37  'TEC1_pos+TEC2_pos+TEC4_pos', 'TEC1_neg+TEC2_neg+TEC4_neg',
38  'TEC1_pos+TEC2_pos+MTEC4_pos','TEC1_neg+TEC2_neg+MTEC4_neg',
39  'TEC2_pos+TEC3_pos+TEC4_pos', 'TEC2_neg+TEC3_neg+TEC4_neg',
40  'TEC2_pos+TEC3_pos+MTEC4_pos','TEC2_neg+TEC3_neg+MTEC4_neg',
41  'TEC2_pos+TEC3_pos+TEC5_pos', 'TEC2_neg+TEC3_neg+TEC5_neg',
42  'TEC2_pos+TEC3_pos+TEC6_pos', 'TEC2_neg+TEC3_neg+TEC6_neg',
43  'TEC3_pos+TEC4_pos+TEC5_pos', 'TEC3_neg+TEC4_neg+TEC5_neg',
44  'TEC3_pos+TEC4_pos+MTEC5_pos','TEC3_neg+TEC4_neg+MTEC5_neg',
45  'TEC3_pos+TEC5_pos+TEC6_pos', 'TEC3_neg+TEC5_neg+TEC6_neg',
46  'TEC4_pos+TEC5_pos+TEC6_pos', 'TEC4_neg+TEC5_neg+TEC6_neg'
47  ),
48  TIB = cms.PSet(
49  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
50  matchedRecHits = cms.InputTag("siStripMatchedRecHits","matchedRecHit"),
51  skipClusters = cms.InputTag('pixelLessStepClusters')
52  ),
53  MTIB = cms.PSet(
54  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
55  skipClusters = cms.InputTag('pixelLessStepClusters'),
56  rphiRecHits = cms.InputTag("siStripMatchedRecHits","rphiRecHit")
57  ),
58  TID = cms.PSet(
59  matchedRecHits = cms.InputTag("siStripMatchedRecHits","matchedRecHit"),
60  skipClusters = cms.InputTag('pixelLessStepClusters'),
61  useRingSlector = cms.bool(True),
62  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
63  minRing = cms.int32(1),
64  maxRing = cms.int32(2)
65  ),
66  MTID = cms.PSet(
67  rphiRecHits = cms.InputTag("siStripMatchedRecHits","rphiRecHit"),
68  skipClusters = cms.InputTag('pixelLessStepClusters'),
69  useRingSlector = cms.bool(True),
70  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
71  minRing = cms.int32(3),
72  maxRing = cms.int32(3)
73  ),
74  TEC = cms.PSet(
75  matchedRecHits = cms.InputTag("siStripMatchedRecHits","matchedRecHit"),
76  skipClusters = cms.InputTag('pixelLessStepClusters'),
77  useRingSlector = cms.bool(True),
78  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
79  minRing = cms.int32(1),
80  maxRing = cms.int32(2)
81  ),
82  MTEC = cms.PSet(
83  rphiRecHits = cms.InputTag("siStripMatchedRecHits","rphiRecHit"),
84  skipClusters = cms.InputTag('pixelLessStepClusters'),
85  useRingSlector = cms.bool(True),
86  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
87  minRing = cms.int32(3),
88  maxRing = cms.int32(3)
89  )
90 )
91 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
92 trackingLowPU.toModify(pixelLessStepSeedLayers,
93  layerList = [
94  'TIB1+TIB2',
95  'TID1_pos+TID2_pos','TID2_pos+TID3_pos',
96  'TEC1_pos+TEC2_pos','TEC2_pos+TEC3_pos','TEC3_pos+TEC4_pos','TEC3_pos+TEC5_pos','TEC4_pos+TEC5_pos',
97  'TID1_neg+TID2_neg','TID2_neg+TID3_neg',
98  'TEC1_neg+TEC2_neg','TEC2_neg+TEC3_neg','TEC3_neg+TEC4_neg','TEC3_neg+TEC5_neg','TEC4_neg+TEC5_neg'
99  ],
100  TIB = dict(clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTiny')),
101  TID = dict(clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTiny')),
102  TEC = dict(clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTiny')),
103  MTIB = None,
104  MTID = None,
105  MTEC = None,
106 )
107 
108 # TrackingRegion
109 from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpotFixedZ_cfi import globalTrackingRegionFromBeamSpotFixedZ as _globalTrackingRegionFromBeamSpotFixedZ
110 pixelLessStepTrackingRegions = _globalTrackingRegionFromBeamSpotFixedZ.clone(RegionPSet = dict(
111  ptMin = 0.4,
112  originHalfLength = 12.0,
113  originRadius = 1.0
114 ))
115 trackingLowPU.toModify(pixelLessStepTrackingRegions, RegionPSet = dict(
116  ptMin = 0.7,
117  originHalfLength = 10.0,
118  originRadius = 2.0,
119 ))
120 
121 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
122 from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018
123 from RecoTracker.IterativeTracking.MixedTripletStep_cff import _mixedTripletStepTrackingRegionsCommon_pp_on_HI
124 (pp_on_XeXe_2017 | pp_on_AA_2018).toReplaceWith(pixelLessStepTrackingRegions,
125  _mixedTripletStepTrackingRegionsCommon_pp_on_HI.clone(RegionPSet=dict(
126  ptMinScaling4BigEvts= False,
127  fixedError = 3.0,
128  ptMin = 2.0,
129  originRadius = 1.0
130  ) )
131 )
132 
133 
134 # seeding
135 from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import ClusterShapeHitFilterESProducer as _ClusterShapeHitFilterESProducer
136 pixelLessStepClusterShapeHitFilter = _ClusterShapeHitFilterESProducer.clone(
137  ComponentName = 'pixelLessStepClusterShapeHitFilter',
138  doStripShapeCut = cms.bool(False),
139  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTight')
140 )
141 
142 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
143 pixelLessStepHitDoublets = _hitPairEDProducer.clone(
144  seedingLayers = "pixelLessStepSeedLayers",
145  trackingRegions = "pixelLessStepTrackingRegions",
146  maxElement = 50000000,
147  produceIntermediateHitDoublets = True,
148 )
149 from RecoTracker.TkSeedGenerator.multiHitFromChi2EDProducer_cfi import multiHitFromChi2EDProducer as _multiHitFromChi2EDProducer
150 pixelLessStepHitTriplets = _multiHitFromChi2EDProducer.clone(
151  doublets = "pixelLessStepHitDoublets",
152 )
153 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer_cff import seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer as _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer
154 from RecoPixelVertexing.PixelLowPtUtilities.StripSubClusterShapeSeedFilter_cfi import StripSubClusterShapeSeedFilter as _StripSubClusterShapeSeedFilter
155 pixelLessStepSeeds = _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer.clone(
156  seedingHitSets = "pixelLessStepHitTriplets",
157  SeedComparitorPSet = dict(
158  ComponentName = 'CombinedSeedComparitor',
159  mode = cms.string("and"),
160  comparitors = cms.VPSet(
161  cms.PSet(# FIXME: is this defined in any cfi that could be imported instead of copy-paste?
162  ComponentName = cms.string('PixelClusterShapeSeedComparitor'),
163  FilterAtHelixStage = cms.bool(True),
164  FilterPixelHits = cms.bool(False),
165  FilterStripHits = cms.bool(True),
166  ClusterShapeHitFilterName = cms.string('pixelLessStepClusterShapeHitFilter'),
167  ClusterShapeCacheSrc = cms.InputTag("siPixelClusterShapeCache") # not really needed here since FilterPixelHits=False
168  ),
169  _StripSubClusterShapeSeedFilter.clone()
170  )
171  )
172 )
173 trackingLowPU.toModify(pixelLessStepHitDoublets, produceSeedingHitSets=True, produceIntermediateHitDoublets=False)
174 trackingLowPU.toModify(pixelLessStepSeeds,
175  seedingHitSets = "pixelLessStepHitDoublets",
176  SeedComparitorPSet = dict(# FIXME: is this defined in any cfi that could be imported instead of copy-paste?
177  ComponentName = 'PixelClusterShapeSeedComparitor',
178  FilterAtHelixStage = cms.bool(True),
179  FilterPixelHits = cms.bool(False),
180  FilterStripHits = cms.bool(True),
181  ClusterShapeHitFilterName = cms.string('ClusterShapeHitFilter'),
182  ClusterShapeCacheSrc = cms.InputTag("siPixelClusterShapeCache") # not really needed here since FilterPixelHits=False
183  )
184 )
185 #fastsim
186 import FastSimulation.Tracking.TrajectorySeedProducer_cfi
187 _fastSim_pixelLessStepSeeds = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
188  trackingRegions = "pixelLessStepTrackingRegions",
189  hitMasks = cms.InputTag("pixelLessStepMasks"),
190 )
191 from FastSimulation.Tracking.SeedingMigration import _hitSetProducerToFactoryPSet
192 _fastSim_pixelLessStepSeeds.seedFinderSelector.MultiHitGeneratorFactory = _hitSetProducerToFactoryPSet(pixelLessStepHitTriplets)
193 _fastSim_pixelLessStepSeeds.seedFinderSelector.MultiHitGeneratorFactory.refitHits = False
194 _fastSim_pixelLessStepSeeds.seedFinderSelector.layerList = pixelLessStepSeedLayers.layerList.value()
195 fastSim.toReplaceWith(pixelLessStepSeeds,_fastSim_pixelLessStepSeeds)
196 
197 # QUALITY CUTS DURING TRACK BUILDING
199 _pixelLessStepTrajectoryFilterBase = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
200  maxLostHits = 0,
201  minimumNumberOfHits = 4,
202  minPt = 0.1
203  )
204 pixelLessStepTrajectoryFilter = _pixelLessStepTrajectoryFilterBase.clone(
205  seedPairPenalty = 1,
206 )
207 trackingLowPU.toReplaceWith(pixelLessStepTrajectoryFilter, _pixelLessStepTrajectoryFilterBase)
208 for e in [pp_on_XeXe_2017, pp_on_AA_2018]:
209  e.toModify(pixelLessStepTrajectoryFilter, minPt=2.0)
210 
211 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
212 pixelLessStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
213  ComponentName = cms.string('pixelLessStepChi2Est'),
214  nSigma = cms.double(3.0),
215  MaxChi2 = cms.double(16.0),
216  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight'))
217 )
218 trackingLowPU.toModify(pixelLessStepChi2Est,
219  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTiny')
220 )
221 
222 # TRACK BUILDING
224 pixelLessStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
225  MeasurementTrackerName = '',
226  trajectoryFilter = cms.PSet(refToPSet_ = cms.string('pixelLessStepTrajectoryFilter')),
227  minNrOfHitsForRebuild = 4,
228  maxCand = 2,
229  alwaysUseInvalidHits = False,
230  estimator = cms.string('pixelLessStepChi2Est'),
231  maxDPhiForLooperReconstruction = cms.double(2.0),
232  maxPtForLooperReconstruction = cms.double(0.7)
233  )
234 
235 # MAKING OF TRACK CANDIDATES
237 pixelLessStepTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
238  src = cms.InputTag('pixelLessStepSeeds'),
239  clustersToSkip = cms.InputTag('pixelLessStepClusters'),
240  ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
241  numHitsForSeedCleaner = cms.int32(50),
242  #onlyPixelHitsForSeedCleaner = cms.bool(True),
243  TrajectoryBuilderPSet = cms.PSet(refToPSet_ = cms.string('pixelLessStepTrajectoryBuilder')),
244  TrajectoryCleaner = 'pixelLessStepTrajectoryCleanerBySharedHits'
245 )
246 import FastSimulation.Tracking.TrackCandidateProducer_cfi
247 fastSim.toReplaceWith(pixelLessStepTrackCandidates,
248  FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
249  src = cms.InputTag("pixelLessStepSeeds"),
250  MinNumberOfCrossedLayers = 6, # ?
251  hitMasks = cms.InputTag("pixelLessStepMasks")
252  )
253 )
254 
255 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits
256 pixelLessStepTrajectoryCleanerBySharedHits = trajectoryCleanerBySharedHits.clone(
257  ComponentName = cms.string('pixelLessStepTrajectoryCleanerBySharedHits'),
258  fractionShared = cms.double(0.11),
259  allowSharedFirstHit = cms.bool(True)
260  )
261 trackingLowPU.toModify(pixelLessStepTrajectoryCleanerBySharedHits, fractionShared = 0.19)
262 
263 
264 # TRACK FITTING
266 pixelLessStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
267  src = 'pixelLessStepTrackCandidates',
268  AlgorithmName = cms.string('pixelLessStep'),
269  Fitter = cms.string('FlexibleKFFittingSmoother')
270  )
271 fastSim.toModify(pixelLessStepTracks, TTRHBuilder = 'WithoutRefit')
272 
273 
274 # TRACK SELECTION AND QUALITY FLAG SETTING.
277 pixelLessStepClassifier1 = TrackMVAClassifierPrompt.clone()
278 pixelLessStepClassifier1.src = 'pixelLessStepTracks'
279 pixelLessStepClassifier1.mva.GBRForestLabel = 'MVASelectorIter5_13TeV'
280 pixelLessStepClassifier1.qualityCuts = [-0.4,0.0,0.4]
281 fastSim.toModify(pixelLessStepClassifier1, vertices = "firstStepPrimaryVerticesBeforeMixing" )
282 
283 pixelLessStepClassifier2 = TrackMVAClassifierPrompt.clone()
284 pixelLessStepClassifier2.src = 'pixelLessStepTracks'
285 pixelLessStepClassifier2.mva.GBRForestLabel = 'MVASelectorIter0_13TeV'
286 pixelLessStepClassifier2.qualityCuts = [-0.0,0.0,0.0]
287 fastSim.toModify(pixelLessStepClassifier2, vertices = "firstStepPrimaryVerticesBeforeMixing" )
288 
290 pixelLessStep = ClassifierMerger.clone()
291 pixelLessStep.inputClassifiers=['pixelLessStepClassifier1','pixelLessStepClassifier2']
292 
293 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
294 
295 trackingPhase1.toReplaceWith(pixelLessStep, pixelLessStepClassifier1.clone(
296  mva = dict(GBRForestLabel = 'MVASelectorPixelLessStep_Phase1'),
297  qualityCuts = [-0.4,0.0,0.4]
298 ))
299 
302 trackdnn.toReplaceWith(pixelLessStep, TrackLwtnnClassifier.clone(
303  src = 'pixelLessStepTracks',
304  qualityCuts = [-0.6, -0.05, 0.5]
305 ))
306 (trackdnn & fastSim).toModify(pixelLessStep,vertices = "firstStepPrimaryVerticesBeforeMixing")
307 
308 pp_on_AA_2018.toModify(pixelLessStep, qualityCuts = [-0.4,0.0,0.8])
309 
310 # For LowPU
311 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
312 pixelLessStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
313  src='pixelLessStepTracks',
314  useAnyMVA = cms.bool(False),
315  GBRForestLabel = cms.string('MVASelectorIter5'),
316  trackSelectors= cms.VPSet(
317  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
318  name = 'pixelLessStepLoose',
319  chi2n_par = 0.5,
320  res_par = ( 0.003, 0.001 ),
321  minNumberLayers = 4,
322  maxNumberLostLayers = 1,
323  minNumber3DLayers = 3,
324  d0_par1 = ( 1.3, 4.0 ),
325  dz_par1 = ( 1.3, 4.0 ),
326  d0_par2 = ( 1.3, 4.0 ),
327  dz_par2 = ( 1.3, 4.0 )
328  ),
329  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
330  name = 'pixelLessStepTight',
331  preFilterName = 'pixelLessStepLoose',
332  chi2n_par = 0.35,
333  res_par = ( 0.003, 0.001 ),
334  minNumberLayers = 4,
335  maxNumberLostLayers = 0,
336  minNumber3DLayers = 3,
337  d0_par1 = ( 1.1, 4.0 ),
338  dz_par1 = ( 1.1, 4.0 ),
339  d0_par2 = ( 1.1, 4.0 ),
340  dz_par2 = ( 1.1, 4.0 )
341  ),
342  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
343  name = 'QualityMasks',
344  preFilterName = 'pixelLessStepTight',
345  chi2n_par = 0.2,
346  res_par = ( 0.003, 0.001 ),
347  minNumberLayers = 4,
348  maxNumberLostLayers = 0,
349  minNumber3DLayers = 3,
350  d0_par1 = ( 0.9, 4.0 ),
351  dz_par1 = ( 0.9, 4.0 ),
352  d0_par2 = ( 0.9, 4.0 ),
353  dz_par2 = ( 0.9, 4.0 )
354  ),
355  ),
356  vertices = cms.InputTag("pixelVertices")#end of vpset
357 ) #end of clone
358 
359 PixelLessStepTask = cms.Task(pixelLessStepClusters,
360  pixelLessStepSeedLayers,
361  pixelLessStepTrackingRegions,
362  pixelLessStepHitDoublets,
363  pixelLessStepHitTriplets,
364  pixelLessStepSeeds,
365  pixelLessStepTrackCandidates,
366  pixelLessStepTracks,
367  pixelLessStepClassifier1,pixelLessStepClassifier2,
368  pixelLessStep)
369 PixelLessStep = cms.Sequence(PixelLessStepTask)
370 
371 _PixelLessStepTask_LowPU = PixelLessStepTask.copyAndExclude([pixelLessStepHitTriplets, pixelLessStepClassifier1, pixelLessStepClassifier2])
372 _PixelLessStepTask_LowPU.replace(pixelLessStep, pixelLessStepSelector)
373 trackingLowPU.toReplaceWith(PixelLessStepTask, _PixelLessStepTask_LowPU)
374 #fastsim
375 from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover
376 pixelLessStepMasks = maskProducerFromClusterRemover(pixelLessStepClusters)
377 fastSim.toReplaceWith(PixelLessStepTask,
378  cms.Task(pixelLessStepMasks
379  ,pixelLessStepTrackingRegions
380  ,pixelLessStepSeeds
381  ,pixelLessStepTrackCandidates
382  ,pixelLessStepTracks
383  ,pixelLessStepClassifier1,pixelLessStepClassifier2
384  ,pixelLessStep
385  )
386 )
def _hitSetProducerToFactoryPSet(producer)