CMS 3D CMS Logo

DetachedQuadStep_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg
3 from Configuration.Eras.Modifier_fastSim_cff import fastSim
4 
5 # for dnn classifier
6 from Configuration.ProcessModifiers.trackdnn_cff import trackdnn
7 from RecoTracker.IterativeTracking.dnnQualityCuts import qualityCutDictionary
8 
9 # for no-loopers
10 from Configuration.ProcessModifiers.trackingNoLoopers_cff import trackingNoLoopers
11 
12 
15 
16 # REMOVE HITS ASSIGNED TO GOOD TRACKS FROM PREVIOUS ITERATIONS
17 detachedQuadStepClusters = _cfg.clusterRemoverForIter('DetachedQuadStep')
18 for _eraName, _postfix, _era in _cfg.nonDefaultEras():
19  _era.toReplaceWith(detachedQuadStepClusters, _cfg.clusterRemoverForIter('DetachedQuadStep', _eraName, _postfix))
20 
21 # SEEDING LAYERS
22 import RecoTracker.TkSeedingLayers.PixelLayerQuadruplets_cfi
23 detachedQuadStepSeedLayers = RecoTracker.TkSeedingLayers.PixelLayerQuadruplets_cfi.PixelLayerQuadruplets.clone(
24  BPix = dict(skipClusters = cms.InputTag('detachedQuadStepClusters')),
25  FPix = dict(skipClusters = cms.InputTag('detachedQuadStepClusters'))
26 )
27 
28 # TrackingRegion
29 from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpotFixedZ_cfi import globalTrackingRegionFromBeamSpotFixedZ as _globalTrackingRegionFromBeamSpotFixedZ
30 detachedQuadStepTrackingRegions = _globalTrackingRegionFromBeamSpotFixedZ.clone(RegionPSet = dict(
31  ptMin = 0.3,
32  originHalfLength = 15.0,
33  originRadius = 1.5
34 ))
35 from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot
36 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
37 trackingPhase2PU140.toReplaceWith(detachedQuadStepTrackingRegions, _globalTrackingRegionFromBeamSpot.clone(RegionPSet = dict(
38  ptMin = 0.45,
39  originRadius = 0.9,
40  nSigmaZ = 5.0
41 )))
42 
43 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
44 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
45 from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cff import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices
46 (pp_on_XeXe_2017 | pp_on_AA).toReplaceWith(detachedQuadStepTrackingRegions,
47  _globalTrackingRegionWithVertices.clone(RegionPSet=dict(
48  fixedError = 3.75,
49  ptMin = 0.9,
50  originRadius = 1.5
51  )
52  )
53 )
54 from Configuration.Eras.Modifier_highBetaStar_2018_cff import highBetaStar_2018
55 highBetaStar_2018.toModify(detachedQuadStepTrackingRegions,RegionPSet = dict(ptMin = 0.05))
56 
57 
58 # seeding
59 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
60 detachedQuadStepHitDoublets = _hitPairEDProducer.clone(
61  seedingLayers = 'detachedQuadStepSeedLayers',
62  trackingRegions = 'detachedQuadStepTrackingRegions',
63  layerPairs = [0,1,2], # layer pairs (0,1), (1,2), (2,3),
64  maxElement = 50000000,
65  produceIntermediateHitDoublets = True,
66 )
67 from RecoTracker.PixelSeeding.caHitQuadrupletEDProducer_cfi import caHitQuadrupletEDProducer as _caHitQuadrupletEDProducer
68 from RecoTracker.PixelSeeding.pixelTripletLargeTipEDProducer_cfi import pixelTripletLargeTipEDProducer as _pixelTripletLargeTipEDProducer
70 detachedQuadStepHitQuadruplets = _caHitQuadrupletEDProducer.clone(
71  doublets = 'detachedQuadStepHitDoublets',
72  extraHitRPhitolerance = _pixelTripletLargeTipEDProducer.extraHitRPhitolerance,
73  maxChi2 = dict(
74  pt1 = 0.8, pt2 = 2,
75  value1 = 500, value2 = 100,
76  ),
77  useBendingCorrection = True,
78  fitFastCircle = True,
79  fitFastCircleChi2Cut = True,
80  CAThetaCut = 0.0011,
81  CAPhiCut = 0,
82 )
83 highBetaStar_2018.toModify(detachedQuadStepHitQuadruplets,CAThetaCut = 0.0022,CAPhiCut = 0.1)
84 
85 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer_cff import seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer as _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer
86 detachedQuadStepSeeds = _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer.clone(
87  seedingHitSets = 'detachedQuadStepHitQuadruplets',
88  SeedComparitorPSet = dict(# FIXME: is this defined in any cfi that could be imported instead of copy-paste?
89  ComponentName = 'PixelClusterShapeSeedComparitor',
90  FilterAtHelixStage = cms.bool(False),
91  FilterPixelHits = cms.bool(True),
92  FilterStripHits = cms.bool(False),
93  ClusterShapeHitFilterName = cms.string('ClusterShapeHitFilter'),
94  ClusterShapeCacheSrc = cms.InputTag('siPixelClusterShapeCache')
95  ),
96 )
97 
98 #For FastSim phase1 tracking
99 import FastSimulation.Tracking.TrajectorySeedProducer_cfi
100 from FastSimulation.Tracking.SeedingMigration import _hitSetProducerToFactoryPSet
101 _fastSim_detachedQuadStepSeeds = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
102  trackingRegions = 'detachedQuadStepTrackingRegions',
103  hitMasks = cms.InputTag('detachedQuadStepMasks'),
104  seedFinderSelector = dict( CAHitQuadrupletGeneratorFactory = _hitSetProducerToFactoryPSet(detachedQuadStepHitQuadruplets).clone(
105  SeedComparitorPSet = dict(ComponentName = 'none')),
106  layerList = detachedQuadStepSeedLayers.layerList.value(),
107  #new parameters required for phase1 seeding
108  BPix = dict(TTRHBuilder = 'WithoutRefit', HitProducer = 'TrackingRecHitProducer',),
109  FPix = dict(TTRHBuilder = 'WithoutRefit', HitProducer = 'TrackingRecHitProducer',),
110  layerPairs = detachedQuadStepHitDoublets.layerPairs.value()
111  ))
112 fastSim.toReplaceWith(detachedQuadStepSeeds,_fastSim_detachedQuadStepSeeds)
113 
114 # QUALITY CUTS DURING TRACK BUILDING
115 import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff as _TrajectoryFilter_cff
116 _detachedQuadStepTrajectoryFilterBase = _TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
117  minimumNumberOfHits = 3,
118  minPt = 0.075,
119 )
120 detachedQuadStepTrajectoryFilterBase = _detachedQuadStepTrajectoryFilterBase.clone(
121  maxCCCLostHits = 0,
122  minGoodStripCharge = dict(refToPSet_ = 'SiStripClusterChargeCutLoose')
123 )
124 trackingPhase2PU140.toReplaceWith(detachedQuadStepTrajectoryFilterBase,
125  _detachedQuadStepTrajectoryFilterBase.clone(
126  maxLostHitsFraction = 1./10.,
127  constantValueForLostHitsFractionFilter = 0.301,
128  )
129 )
130 detachedQuadStepTrajectoryFilter = _TrajectoryFilter_cff.CompositeTrajectoryFilter_block.clone(
131  filters = [cms.PSet(refToPSet_ = cms.string('detachedQuadStepTrajectoryFilterBase'))]
132 )
133 trackingPhase2PU140.toModify(detachedQuadStepTrajectoryFilter,
134  filters = detachedQuadStepTrajectoryFilter.filters.value()+[cms.PSet(refToPSet_ = cms.string('ClusterShapeTrajectoryFilter'))]
135 )
136 
137 (pp_on_XeXe_2017 | pp_on_AA).toModify(detachedQuadStepTrajectoryFilterBase, minPt=0.9)
138 
139 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
140 detachedQuadStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
141  ComponentName = 'detachedQuadStepChi2Est',
142  nSigma = 3.0,
143  MaxChi2 = 9.0,
144  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTight'),
145 )
146 trackingPhase2PU140.toModify(detachedQuadStepChi2Est,
147  MaxChi2 = 12.0,
148  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutNone')
149 )
150 
151 # TRACK BUILDING
153 detachedQuadStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilderIterativeDefault.clone(
154  trajectoryFilter = dict(refToPSet_ = 'detachedQuadStepTrajectoryFilter'),
155  maxCand = 3,
156  alwaysUseInvalidHits = True,
157  estimator = 'detachedQuadStepChi2Est',
158  maxDPhiForLooperReconstruction = 2.0,
159  maxPtForLooperReconstruction = 0.7,
160 )
161 trackingNoLoopers.toModify(detachedQuadStepTrajectoryBuilder,
162  maxPtForLooperReconstruction = 0.0)
163 trackingPhase2PU140.toModify(detachedQuadStepTrajectoryBuilder,
164  maxCand = 2,
165  alwaysUseInvalidHits = False,
166 )
167 
168 # MAKING OF TRACK CANDIDATES
169 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits
170 detachedQuadStepTrajectoryCleanerBySharedHits = trajectoryCleanerBySharedHits.clone(
171  ComponentName = 'detachedQuadStepTrajectoryCleanerBySharedHits',
172  fractionShared = 0.13,
173  allowSharedFirstHit = True
174 )
175 
177 detachedQuadStepTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidatesIterativeDefault.clone(
178  src = 'detachedQuadStepSeeds',
179  clustersToSkip = 'detachedQuadStepClusters',
180 
181  numHitsForSeedCleaner = 50,
182  onlyPixelHitsForSeedCleaner = True,
183  TrajectoryBuilderPSet = dict(refToPSet_ = 'detachedQuadStepTrajectoryBuilder'),
184  TrajectoryCleaner = 'detachedQuadStepTrajectoryCleanerBySharedHits',
185  doSeedingRegionRebuilding = True,
186  useHitsSplitting = True,
187 )
188 trackingPhase2PU140.toModify(detachedQuadStepTrackCandidates,
189  clustersToSkip = '',
190  phase2clustersToSkip = 'detachedQuadStepClusters'
191 )
192 
193 from Configuration.ProcessModifiers.trackingMkFitDetachedQuadStep_cff import trackingMkFitDetachedQuadStep
194 import RecoTracker.MkFit.mkFitSeedConverter_cfi as mkFitSeedConverter_cfi
195 import RecoTracker.MkFit.mkFitIterationConfigESProducer_cfi as mkFitIterationConfigESProducer_cfi
196 import RecoTracker.MkFit.mkFitProducer_cfi as mkFitProducer_cfi
197 import RecoTracker.MkFit.mkFitOutputConverter_cfi as mkFitOutputConverter_cfi
198 detachedQuadStepTrackCandidatesMkFitSeeds = mkFitSeedConverter_cfi.mkFitSeedConverter.clone(
199  seeds = 'detachedQuadStepSeeds',
200 )
201 detachedQuadStepTrackCandidatesMkFitConfig = mkFitIterationConfigESProducer_cfi.mkFitIterationConfigESProducer.clone(
202  config = 'RecoTracker/MkFit/data/mkfit-phase1-detachedQuadStep.json',
203  ComponentName = 'detachedQuadStepTrackCandidatesMkFitConfig',
204 )
205 detachedQuadStepTrackCandidatesMkFit = mkFitProducer_cfi.mkFitProducer.clone(
206  seeds = 'detachedQuadStepTrackCandidatesMkFitSeeds',
207  config = ('', 'detachedQuadStepTrackCandidatesMkFitConfig'),
208  clustersToSkip = 'detachedQuadStepClusters',
209 )
210 trackingMkFitDetachedQuadStep.toReplaceWith(detachedQuadStepTrackCandidates, mkFitOutputConverter_cfi.mkFitOutputConverter.clone(
211  seeds = 'detachedQuadStepSeeds',
212  mkFitSeeds = 'detachedQuadStepTrackCandidatesMkFitSeeds',
213  tracks = 'detachedQuadStepTrackCandidatesMkFit',
214 ))
215 (pp_on_XeXe_2017 | pp_on_AA).toModify(detachedQuadStepTrackCandidatesMkFitConfig, minPt=0.9)
216 
217 #For FastSim phase1 tracking
218 import FastSimulation.Tracking.TrackCandidateProducer_cfi
219 _fastSim_detachedQuadStepTrackCandidates = FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
220  src = 'detachedQuadStepSeeds',
221  MinNumberOfCrossedLayers = 4,
222  hitMasks = cms.InputTag('detachedQuadStepMasks')
223 )
224 fastSim.toReplaceWith(detachedQuadStepTrackCandidates,_fastSim_detachedQuadStepTrackCandidates)
225 
226 # TRACK FITTING
227 import RecoTracker.TrackProducer.TrackProducerIterativeDefault_cfi
228 detachedQuadStepTracks = RecoTracker.TrackProducer.TrackProducerIterativeDefault_cfi.TrackProducerIterativeDefault.clone(
229  AlgorithmName = 'detachedQuadStep',
230  src = 'detachedQuadStepTrackCandidates',
231  Fitter = 'FlexibleKFFittingSmoother',
232 )
233 fastSim.toModify(detachedQuadStepTracks,TTRHBuilder = 'WithoutRefit')
234 
235 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
236 phase2_timing_layer.toModify(detachedQuadStepTracks, TrajectoryInEvent = True)
237 
238 # TRACK SELECTION AND QUALITY FLAG SETTING.
240 detachedQuadStep = TrackMVAClassifierDetached.clone(
241  mva = dict(GBRForestLabel = 'MVASelectorDetachedQuadStep_Phase1'),
242  src = 'detachedQuadStepTracks',
243  qualityCuts = [-0.5,0.0,0.5]
244 )
245 pp_on_AA.toModify(detachedQuadStep,
246  mva = dict(GBRForestLabel = 'HIMVASelectorDetachedQuadStep_Phase1'),
247  qualityCuts = [-0.2, 0.2, 0.5],
248 )
249 
253 trackdnn.toReplaceWith(detachedQuadStep, trackTfClassifier.clone(
254  src = 'detachedQuadStepTracks',
255  qualityCuts = qualityCutDictionary.DetachedQuadStep.value()
256 ))
257 
258 
259 highBetaStar_2018.toModify(detachedQuadStep,qualityCuts = [-0.7,0.0,0.5])
260 
261 (pp_on_AA & trackdnn).toModify(detachedQuadStep, qualityCuts = [-0.63, 0.5, 0.94] )
262 
263 fastSim.toModify(detachedQuadStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')
264 
265 # For Phase2PU140
266 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
267 detachedQuadStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
268  src = 'detachedQuadStepTracks',
269  trackSelectors = [
270  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
271  name = 'detachedQuadStepVtxLoose',
272  chi2n_par = 1.0,
273  res_par = ( 0.003, 0.001 ),
274  minNumberLayers = 3,
275  d0_par1 = ( 0.9, 3.0 ),
276  dz_par1 = ( 0.9, 3.0 ),
277  d0_par2 = ( 1.0, 3.0 ),
278  dz_par2 = ( 1.0, 3.0 )
279  ),
280  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
281  name = 'detachedQuadStepTrkLoose',
282  chi2n_par = 0.6,
283  res_par = ( 0.003, 0.001 ),
284  minNumberLayers = 3,
285  d0_par1 = ( 1.3, 4.0 ),
286  dz_par1 = ( 1.3, 4.0 ),
287  d0_par2 = ( 1.3, 4.0 ),
288  dz_par2 = ( 1.3, 4.0 )
289  ),
290  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
291  name = 'detachedQuadStepVtxTight',
292  preFilterName = 'detachedQuadStepVtxLoose',
293  chi2n_par = 0.9,
294  res_par = ( 0.003, 0.001 ),
295  minNumberLayers = 3,
296  maxNumberLostLayers = 1,
297  minNumber3DLayers = 3,
298  d0_par1 = ( 0.9, 3.0 ),
299  dz_par1 = ( 0.9, 3.0 ),
300  d0_par2 = ( 0.9, 3.0 ),
301  dz_par2 = ( 0.9, 3.0 )
302  ),
303  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
304  name = 'detachedQuadStepTrkTight',
305  preFilterName = 'detachedQuadStepTrkLoose',
306  chi2n_par = 0.5,
307  res_par = ( 0.003, 0.001 ),
308  minNumberLayers = 4,
309  maxNumberLostLayers = 1,
310  minNumber3DLayers = 3,
311  d0_par1 = ( 1.1, 4.0 ),
312  dz_par1 = ( 1.1, 4.0 ),
313  d0_par2 = ( 1.1, 4.0 ),
314  dz_par2 = ( 1.1, 4.0 )
315  ),
316  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
317  name = 'detachedQuadStepVtx',
318  preFilterName = 'detachedQuadStepVtxTight',
319  min_eta = -4.0, # it is particularly effective against fake tracks
320  max_eta = 4.0,
321  chi2n_par = 0.9,
322  res_par = ( 0.003, 0.001 ),
323  minNumberLayers = 3,
324  maxNumberLostLayers = 1,
325  minNumber3DLayers = 3,
326  d0_par1 = ( 0.8, 3.0 ),
327  dz_par1 = ( 0.8, 3.0 ),
328  d0_par2 = ( 0.8, 3.0 ),
329  dz_par2 = ( 0.8, 3.0 )
330  ),
331  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
332  name = 'detachedQuadStepTrk',
333  preFilterName = 'detachedQuadStepTrkTight',
334  min_eta = -4.0, # it is particularly effective against fake tracks
335  max_eta = 4.0,
336  chi2n_par = 0.5,
337  res_par = ( 0.003, 0.001 ),
338  minNumberLayers = 4,
339  maxNumberLostLayers = 1,
340  minNumber3DLayers = 3,
341  d0_par1 = ( 0.9, 4.0 ),
342  dz_par1 = ( 0.9, 4.0 ),
343  d0_par2 = ( 0.9, 4.0 ),
344  dz_par2 = ( 0.9, 4.0 )
345  )
346  ] #end of vpset
347 ) #end of clone
348 
349 
350 from RecoTracker.FinalTrackSelectors.trackAlgoPriorityOrder_cfi import trackAlgoPriorityOrder
352 trackingPhase2PU140.toReplaceWith(detachedQuadStep, RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
353  TrackProducers =['detachedQuadStepTracks',
354  'detachedQuadStepTracks'],
355  hasSelector =[1,1],
356  ShareFrac = 0.09,
357  indivShareFrac =[0.09,0.09],
358  selectedTrackQuals =['detachedQuadStepSelector:detachedQuadStepVtx',
359  'detachedQuadStepSelector:detachedQuadStepTrk'],
360  setsToMerge = cms.VPSet(cms.PSet( tLists=cms.vint32(0,1), pQual=cms.bool(True) )),
361  writeOnlyTrkQuals =True
362  )
363 )
364 
365 DetachedQuadStepTask = cms.Task(detachedQuadStepClusters,
366  detachedQuadStepSeedLayers,
367  detachedQuadStepTrackingRegions,
368  detachedQuadStepHitDoublets,
369  detachedQuadStepHitQuadruplets,
370  detachedQuadStepSeeds,
371  detachedQuadStepTrackCandidates,
372  detachedQuadStepTracks,
373  detachedQuadStep)
374 DetachedQuadStep = cms.Sequence(DetachedQuadStepTask)
375 
376 _DetachedQuadStepTask_trackingMkFit = DetachedQuadStepTask.copy()
377 _DetachedQuadStepTask_trackingMkFit.add(detachedQuadStepTrackCandidatesMkFitSeeds, detachedQuadStepTrackCandidatesMkFit, detachedQuadStepTrackCandidatesMkFitConfig)
378 trackingMkFitDetachedQuadStep.toReplaceWith(DetachedQuadStepTask, _DetachedQuadStepTask_trackingMkFit)
379 
380 _DetachedQuadStepTask_Phase2PU140 = DetachedQuadStepTask.copy()
381 _DetachedQuadStepTask_Phase2PU140.replace(detachedQuadStep, cms.Task(detachedQuadStepSelector,detachedQuadStep))
382 trackingPhase2PU140.toReplaceWith(DetachedQuadStepTask, _DetachedQuadStepTask_Phase2PU140)
383 
384 #fastsim
385 from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover
386 detachedQuadStepMasks = maskProducerFromClusterRemover(detachedQuadStepClusters)
387 fastSim.toReplaceWith(DetachedQuadStepTask,
388  cms.Task(detachedQuadStepMasks
389  ,detachedQuadStepTrackingRegions
390  ,detachedQuadStepSeeds
391  ,detachedQuadStepTrackCandidates
392  ,detachedQuadStepTracks
393  ,detachedQuadStep
394  ) )
def _hitSetProducerToFactoryPSet(producer)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135