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