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