CMS 3D CMS Logo

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