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.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018
41 from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cff import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices
42 (pp_on_XeXe_2017 | pp_on_AA_2018).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 for e in [pp_on_XeXe_2017, pp_on_AA_2018]:
134  e.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 
149 # TRACK BUILDING
151 detachedQuadStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
152  MeasurementTrackerName = '',
153  trajectoryFilter = dict(refToPSet_ = 'detachedQuadStepTrajectoryFilter'),
154  maxCand = 3,
155  alwaysUseInvalidHits = True,
156  estimator = 'detachedQuadStepChi2Est',
157  maxDPhiForLooperReconstruction = cms.double(2.0),
158  maxPtForLooperReconstruction = cms.double(0.7)
159 )
160 trackingPhase2PU140.toModify(detachedQuadStepTrajectoryBuilder,
161  maxCand = 2,
162  alwaysUseInvalidHits = False,
163 )
164 
165 # MAKING OF TRACK CANDIDATES
166 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits
167 detachedQuadStepTrajectoryCleanerBySharedHits = trajectoryCleanerBySharedHits.clone(
168  ComponentName = cms.string('detachedQuadStepTrajectoryCleanerBySharedHits'),
169  fractionShared = cms.double(0.13),
170  allowSharedFirstHit = cms.bool(True)
171 )
172 
174 detachedQuadStepTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
175  src = 'detachedQuadStepSeeds',
176  clustersToSkip = cms.InputTag('detachedQuadStepClusters'),
177 
178  numHitsForSeedCleaner = cms.int32(50),
179  onlyPixelHitsForSeedCleaner = cms.bool(True),
180  TrajectoryBuilderPSet = dict(refToPSet_ = 'detachedQuadStepTrajectoryBuilder'),
181  TrajectoryCleaner = 'detachedQuadStepTrajectoryCleanerBySharedHits',
182  doSeedingRegionRebuilding = True,
183  useHitsSplitting = True
184 )
185 trackingPhase2PU140.toModify(detachedQuadStepTrackCandidates,
186  clustersToSkip = None,
187  phase2clustersToSkip = cms.InputTag("detachedQuadStepClusters")
188 )
189 
190 #For FastSim phase1 tracking
191 import FastSimulation.Tracking.TrackCandidateProducer_cfi
192 _fastSim_detachedQuadStepTrackCandidates = FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
193  src = cms.InputTag("detachedQuadStepSeeds"),
194  MinNumberOfCrossedLayers = 4,
195  hitMasks = cms.InputTag("detachedQuadStepMasks")
196  )
197 fastSim.toReplaceWith(detachedQuadStepTrackCandidates,_fastSim_detachedQuadStepTrackCandidates)
198 
199 # TRACK FITTING
201 detachedQuadStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
202  AlgorithmName = 'detachedQuadStep',
203  src = 'detachedQuadStepTrackCandidates',
204  Fitter = 'FlexibleKFFittingSmoother',
205 )
206 fastSim.toModify(detachedQuadStepTracks,TTRHBuilder = 'WithoutRefit')
207 
208 # TRACK SELECTION AND QUALITY FLAG SETTING.
210 detachedQuadStep = TrackMVAClassifierDetached.clone(
211  mva = dict(GBRForestLabel = 'MVASelectorDetachedQuadStep_Phase1'),
212  src = 'detachedQuadStepTracks',
213  qualityCuts = [-0.5,0.0,0.5]
214 )
215 
218 trackdnn.toReplaceWith(detachedQuadStep, TrackLwtnnClassifier.clone(
219  src = 'detachedQuadStepTracks',
220  qualityCuts = [-0.6, 0.05, 0.7]
221 ))
222 
223 highBetaStar_2018.toModify(detachedQuadStep,qualityCuts = [-0.7,0.0,0.5])
224 pp_on_AA_2018.toModify(detachedQuadStep,
225  mva = dict(GBRForestLabel = 'HIMVASelectorDetachedQuadStep_Phase1'),
226  qualityCuts = [-0.2, 0.2, 0.5],
227 )
228 
229 fastSim.toModify(detachedQuadStep,vertices = "firstStepPrimaryVerticesBeforeMixing")
230 
231 # For Phase2PU140
232 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
233 detachedQuadStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
234  src = 'detachedQuadStepTracks',
235  trackSelectors = [
236  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
237  name = 'detachedQuadStepVtxLoose',
238  chi2n_par = 1.0,
239  res_par = ( 0.003, 0.001 ),
240  minNumberLayers = 3,
241  d0_par1 = ( 0.9, 3.0 ),
242  dz_par1 = ( 0.9, 3.0 ),
243  d0_par2 = ( 1.0, 3.0 ),
244  dz_par2 = ( 1.0, 3.0 )
245  ),
246  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
247  name = 'detachedQuadStepTrkLoose',
248  chi2n_par = 0.6,
249  res_par = ( 0.003, 0.001 ),
250  minNumberLayers = 3,
251  d0_par1 = ( 1.3, 4.0 ),
252  dz_par1 = ( 1.3, 4.0 ),
253  d0_par2 = ( 1.3, 4.0 ),
254  dz_par2 = ( 1.3, 4.0 )
255  ),
256  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
257  name = 'detachedQuadStepVtxTight',
258  preFilterName = 'detachedQuadStepVtxLoose',
259  chi2n_par = 0.9,
260  res_par = ( 0.003, 0.001 ),
261  minNumberLayers = 3,
262  maxNumberLostLayers = 1,
263  minNumber3DLayers = 3,
264  d0_par1 = ( 0.9, 3.0 ),
265  dz_par1 = ( 0.9, 3.0 ),
266  d0_par2 = ( 0.9, 3.0 ),
267  dz_par2 = ( 0.9, 3.0 )
268  ),
269  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
270  name = 'detachedQuadStepTrkTight',
271  preFilterName = 'detachedQuadStepTrkLoose',
272  chi2n_par = 0.5,
273  res_par = ( 0.003, 0.001 ),
274  minNumberLayers = 4,
275  maxNumberLostLayers = 1,
276  minNumber3DLayers = 3,
277  d0_par1 = ( 1.1, 4.0 ),
278  dz_par1 = ( 1.1, 4.0 ),
279  d0_par2 = ( 1.1, 4.0 ),
280  dz_par2 = ( 1.1, 4.0 )
281  ),
282  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
283  name = 'detachedQuadStepVtx',
284  preFilterName = 'detachedQuadStepVtxTight',
285  min_eta = -4.0, # it is particularly effective against fake tracks
286  max_eta = 4.0,
287  chi2n_par = 0.9,
288  res_par = ( 0.003, 0.001 ),
289  minNumberLayers = 3,
290  maxNumberLostLayers = 1,
291  minNumber3DLayers = 3,
292  d0_par1 = ( 0.8, 3.0 ),
293  dz_par1 = ( 0.8, 3.0 ),
294  d0_par2 = ( 0.8, 3.0 ),
295  dz_par2 = ( 0.8, 3.0 )
296  ),
297  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
298  name = 'detachedQuadStepTrk',
299  preFilterName = 'detachedQuadStepTrkTight',
300  min_eta = -4.0, # it is particularly effective against fake tracks
301  max_eta = 4.0,
302  chi2n_par = 0.5,
303  res_par = ( 0.003, 0.001 ),
304  minNumberLayers = 4,
305  maxNumberLostLayers = 1,
306  minNumber3DLayers = 3,
307  d0_par1 = ( 0.9, 4.0 ),
308  dz_par1 = ( 0.9, 4.0 ),
309  d0_par2 = ( 0.9, 4.0 ),
310  dz_par2 = ( 0.9, 4.0 )
311  )
312  ] #end of vpset
313 ) #end of clone
314 
315 
316 from RecoTracker.FinalTrackSelectors.trackAlgoPriorityOrder_cfi import trackAlgoPriorityOrder
318 trackingPhase2PU140.toReplaceWith(detachedQuadStep, RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
319  TrackProducers = cms.VInputTag(cms.InputTag('detachedQuadStepTracks'),
320  cms.InputTag('detachedQuadStepTracks')),
321  hasSelector=cms.vint32(1,1),
322  shareFrac = cms.double(0.09),
323  indivShareFrac=cms.vdouble(0.09,0.09),
324  selectedTrackQuals = cms.VInputTag(cms.InputTag("detachedQuadStepSelector","detachedQuadStepVtx"),
325  cms.InputTag("detachedQuadStepSelector","detachedQuadStepTrk")),
326  setsToMerge = cms.VPSet(cms.PSet( tLists=cms.vint32(0,1), pQual=cms.bool(True) )),
327  writeOnlyTrkQuals=cms.bool(True)
328  )
329 )
330 
331 DetachedQuadStepTask = cms.Task(detachedQuadStepClusters,
332  detachedQuadStepSeedLayers,
333  detachedQuadStepTrackingRegions,
334  detachedQuadStepHitDoublets,
335  detachedQuadStepHitQuadruplets,
336  detachedQuadStepSeeds,
337  detachedQuadStepTrackCandidates,
338  detachedQuadStepTracks,
339  detachedQuadStep)
340 DetachedQuadStep = cms.Sequence(DetachedQuadStepTask)
341 _DetachedQuadStepTask_Phase2PU140 = DetachedQuadStepTask.copy()
342 _DetachedQuadStepTask_Phase2PU140.replace(detachedQuadStep, cms.Task(detachedQuadStepSelector,detachedQuadStep))
343 trackingPhase2PU140.toReplaceWith(DetachedQuadStepTask, _DetachedQuadStepTask_Phase2PU140)
344 
345 #fastsim
346 from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover
347 detachedQuadStepMasks = maskProducerFromClusterRemover(detachedQuadStepClusters)
348 fastSim.toReplaceWith(DetachedQuadStepTask,
349  cms.Task(detachedQuadStepMasks
350  ,detachedQuadStepTrackingRegions
351  ,detachedQuadStepSeeds
352  ,detachedQuadStepTrackCandidates
353  ,detachedQuadStepTracks
354  ,detachedQuadStep
355  ) )
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