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