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