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 = 0,
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 
215 # For Phase2PU140
216 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
217 detachedQuadStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
218  src = 'detachedQuadStepTracks',
219  trackSelectors = [
220  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
221  name = 'detachedQuadStepVtxLoose',
222  chi2n_par = 1.0,
223  res_par = ( 0.003, 0.001 ),
224  minNumberLayers = 3,
225  d0_par1 = ( 0.9, 3.0 ),
226  dz_par1 = ( 0.9, 3.0 ),
227  d0_par2 = ( 1.0, 3.0 ),
228  dz_par2 = ( 1.0, 3.0 )
229  ),
230  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
231  name = 'detachedQuadStepTrkLoose',
232  chi2n_par = 0.6,
233  res_par = ( 0.003, 0.001 ),
234  minNumberLayers = 3,
235  d0_par1 = ( 1.3, 4.0 ),
236  dz_par1 = ( 1.3, 4.0 ),
237  d0_par2 = ( 1.3, 4.0 ),
238  dz_par2 = ( 1.3, 4.0 )
239  ),
240  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
241  name = 'detachedQuadStepVtxTight',
242  preFilterName = 'detachedQuadStepVtxLoose',
243  chi2n_par = 0.9,
244  res_par = ( 0.003, 0.001 ),
245  minNumberLayers = 3,
246  maxNumberLostLayers = 1,
247  minNumber3DLayers = 3,
248  d0_par1 = ( 0.9, 3.0 ),
249  dz_par1 = ( 0.9, 3.0 ),
250  d0_par2 = ( 0.9, 3.0 ),
251  dz_par2 = ( 0.9, 3.0 )
252  ),
253  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
254  name = 'detachedQuadStepTrkTight',
255  preFilterName = 'detachedQuadStepTrkLoose',
256  chi2n_par = 0.5,
257  res_par = ( 0.003, 0.001 ),
258  minNumberLayers = 4,
259  maxNumberLostLayers = 1,
260  minNumber3DLayers = 3,
261  d0_par1 = ( 1.1, 4.0 ),
262  dz_par1 = ( 1.1, 4.0 ),
263  d0_par2 = ( 1.1, 4.0 ),
264  dz_par2 = ( 1.1, 4.0 )
265  ),
266  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
267  name = 'detachedQuadStepVtx',
268  preFilterName = 'detachedQuadStepVtxTight',
269  chi2n_par = 0.9,
270  res_par = ( 0.003, 0.001 ),
271  minNumberLayers = 3,
272  maxNumberLostLayers = 1,
273  minNumber3DLayers = 3,
274  d0_par1 = ( 0.8, 3.0 ),
275  dz_par1 = ( 0.8, 3.0 ),
276  d0_par2 = ( 0.8, 3.0 ),
277  dz_par2 = ( 0.8, 3.0 )
278  ),
279  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
280  name = 'detachedQuadStepTrk',
281  preFilterName = 'detachedQuadStepTrkTight',
282  chi2n_par = 0.5,
283  res_par = ( 0.003, 0.001 ),
284  minNumberLayers = 4,
285  maxNumberLostLayers = 1,
286  minNumber3DLayers = 3,
287  d0_par1 = ( 0.9, 4.0 ),
288  dz_par1 = ( 0.9, 4.0 ),
289  d0_par2 = ( 0.9, 4.0 ),
290  dz_par2 = ( 0.9, 4.0 )
291  )
292  ] #end of vpset
293 ) #end of clone
294 
295 
296 from RecoTracker.FinalTrackSelectors.trackAlgoPriorityOrder_cfi import trackAlgoPriorityOrder
298 trackingPhase2PU140.toReplaceWith(detachedQuadStep, RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
299  TrackProducers = cms.VInputTag(cms.InputTag('detachedQuadStepTracks'),
300  cms.InputTag('detachedQuadStepTracks')),
301  hasSelector=cms.vint32(1,1),
302  shareFrac = cms.double(0.09),
303  indivShareFrac=cms.vdouble(0.09,0.09),
304  selectedTrackQuals = cms.VInputTag(cms.InputTag("detachedQuadStepSelector","detachedQuadStepVtx"),
305  cms.InputTag("detachedQuadStepSelector","detachedQuadStepTrk")),
306  setsToMerge = cms.VPSet(cms.PSet( tLists=cms.vint32(0,1), pQual=cms.bool(True) )),
307  writeOnlyTrkQuals=cms.bool(True)
308  )
309 )
310 
311 DetachedQuadStepTask = cms.Task(detachedQuadStepClusters,
312  detachedQuadStepSeedLayers,
313  detachedQuadStepTrackingRegions,
314  detachedQuadStepHitDoublets,
315  detachedQuadStepHitQuadruplets,
316  detachedQuadStepSeeds,
317  detachedQuadStepTrackCandidates,
318  detachedQuadStepTracks,
319  detachedQuadStep)
320 DetachedQuadStep = cms.Sequence(DetachedQuadStepTask)
321 _DetachedQuadStepTask_Phase2PU140 = DetachedQuadStepTask.copy()
322 _DetachedQuadStepTask_Phase2PU140.replace(detachedQuadStep, cms.Task(detachedQuadStepSelector,detachedQuadStep))
323 trackingPhase2PU140.toReplaceWith(DetachedQuadStepTask, _DetachedQuadStepTask_Phase2PU140)
324 
325 #fastsim
326 from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover
327 detachedQuadStepMasks = maskProducerFromClusterRemover(detachedQuadStepClusters)
328 fastSim.toReplaceWith(DetachedQuadStepTask,
329  cms.Task(detachedQuadStepMasks
330  ,detachedQuadStepTrackingRegions
331  ,detachedQuadStepSeeds
332  ,detachedQuadStepTrackCandidates
333  ,detachedQuadStepTracks
334  ,detachedQuadStep
335  ) )
def _hitSetProducerToFactoryPSet(producer)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135