CMS 3D CMS Logo

LowPtQuadStep_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 # NEW CLUSTERS (remove previously used clusters)
10 lowPtQuadStepClusters = _cfg.clusterRemoverForIter('LowPtQuadStep')
11 for _eraName, _postfix, _era in _cfg.nonDefaultEras():
12  _era.toReplaceWith(lowPtQuadStepClusters, _cfg.clusterRemoverForIter('LowPtQuadStep', _eraName, _postfix))
13 
14 
15 # SEEDING LAYERS
16 import RecoTracker.TkSeedingLayers.PixelLayerQuadruplets_cfi
17 lowPtQuadStepSeedLayers = RecoTracker.TkSeedingLayers.PixelLayerQuadruplets_cfi.PixelLayerQuadruplets.clone(
18  BPix = dict(skipClusters = cms.InputTag('lowPtQuadStepClusters')),
19  FPix = dict(skipClusters = cms.InputTag('lowPtQuadStepClusters'))
20 )
21 
22 # TrackingRegion
23 from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot
24 lowPtQuadStepTrackingRegions = _globalTrackingRegionFromBeamSpot.clone(RegionPSet = dict(
25  ptMin = 0.15,
26  originRadius = 0.02,
27  nSigmaZ = 4.0 )
28 )
29 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
30 trackingPhase2PU140.toModify(lowPtQuadStepTrackingRegions, RegionPSet = dict(ptMin = 0.35,originRadius = 0.025))
31 
32 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
33 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
34 from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cff import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices
35 (pp_on_XeXe_2017 | pp_on_AA).toReplaceWith(lowPtQuadStepTrackingRegions,
36  _globalTrackingRegionWithVertices.clone(RegionPSet=dict(
37  fixedError = 0.5,
38  ptMin = 0.49,
39  originRadius = 0.02 )
40  )
41 )
42 from Configuration.Eras.Modifier_highBetaStar_2018_cff import highBetaStar_2018
43 highBetaStar_2018.toModify(lowPtQuadStepTrackingRegions,RegionPSet = dict(
44  ptMin = 0.05,
45  originRadius = 0.2, )
46 )
47 
48 # seeding
49 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
50 lowPtQuadStepHitDoublets = _hitPairEDProducer.clone(
51  seedingLayers = 'lowPtQuadStepSeedLayers',
52  trackingRegions = 'lowPtQuadStepTrackingRegions',
53  layerPairs = [0,1,2], # layer pairs (0,1), (1,2), (2,3)
54  maxElement = 50000000,
55  produceIntermediateHitDoublets = True,
56 )
57 from RecoPixelVertexing.PixelTriplets.caHitQuadrupletEDProducer_cfi import caHitQuadrupletEDProducer as _caHitQuadrupletEDProducer
58 from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer
60 import RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi
61 lowPtQuadStepHitQuadruplets = _caHitQuadrupletEDProducer.clone(
62  doublets = 'lowPtQuadStepHitDoublets',
63  extraHitRPhitolerance = _pixelTripletHLTEDProducer.extraHitRPhitolerance,
64  SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone(),
65  maxChi2 = dict(
66  pt1 = 0.7, pt2 = 2,
67  value1 = 1000, value2 = 150,
68  ),
69  useBendingCorrection = True,
70  fitFastCircle = True,
71  fitFastCircleChi2Cut = True,
72  CAThetaCut = 0.0017,
73  CAPhiCut = 0.3,
74 )
75 trackingPhase2PU140.toModify(lowPtQuadStepHitQuadruplets,CAThetaCut = 0.0015,CAPhiCut = 0.25)
76 highBetaStar_2018.toModify(lowPtQuadStepHitQuadruplets,CAThetaCut = 0.0034,CAPhiCut = 0.6)
77 
78 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsEDProducer_cff import seedCreatorFromRegionConsecutiveHitsEDProducer as _seedCreatorFromRegionConsecutiveHitsEDProducer
79 lowPtQuadStepSeeds = _seedCreatorFromRegionConsecutiveHitsEDProducer.clone(
80  seedingHitSets = 'lowPtQuadStepHitQuadruplets',
81 )
82 
83 #For FastSim phase1 tracking
84 import FastSimulation.Tracking.TrajectorySeedProducer_cfi
85 from FastSimulation.Tracking.SeedingMigration import _hitSetProducerToFactoryPSet
86 _fastSim_lowPtQuadStepSeeds = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
87  trackingRegions = 'lowPtQuadStepTrackingRegions',
88  hitMasks = cms.InputTag('lowPtQuadStepMasks'),
89  seedFinderSelector = dict( CAHitQuadrupletGeneratorFactory = _hitSetProducerToFactoryPSet(lowPtQuadStepHitQuadruplets).clone(
90  SeedComparitorPSet = dict(ComponentName = 'none')),
91  layerList = lowPtQuadStepSeedLayers.layerList.value(),
92  #new parameters required for phase1 seeding
93  BPix = dict(TTRHBuilder = 'WithoutRefit', HitProducer = 'TrackingRecHitProducer',),
94  FPix = dict(TTRHBuilder = 'WithoutRefit', HitProducer = 'TrackingRecHitProducer',),
95  layerPairs = lowPtQuadStepHitDoublets.layerPairs.value()
96  )
97 )
98 fastSim.toReplaceWith(lowPtQuadStepSeeds,_fastSim_lowPtQuadStepSeeds)
99 
100 # QUALITY CUTS DURING TRACK BUILDING
101 import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff as _TrajectoryFilter_cff
102 _lowPtQuadStepTrajectoryFilterBase = _TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
103  minimumNumberOfHits = 3,
104  minPt = 0.075,
105 )
106 lowPtQuadStepTrajectoryFilterBase = _lowPtQuadStepTrajectoryFilterBase.clone(
107  maxCCCLostHits = 0,
108  minGoodStripCharge = dict(refToPSet_ = 'SiStripClusterChargeCutLoose')
109 )
110 trackingPhase2PU140.toReplaceWith(lowPtQuadStepTrajectoryFilterBase, _lowPtQuadStepTrajectoryFilterBase)
111 
112 (pp_on_XeXe_2017 | pp_on_AA).toModify(lowPtQuadStepTrajectoryFilterBase, minPt=0.49)
113 
115 # Composite filter
116 lowPtQuadStepTrajectoryFilter = _TrajectoryFilter_cff.CompositeTrajectoryFilter_block.clone(
117  filters = [cms.PSet(refToPSet_ = cms.string('lowPtQuadStepTrajectoryFilterBase'))]
118 )
119 trackingPhase2PU140.toModify(lowPtQuadStepTrajectoryFilter,
120  filters = lowPtQuadStepTrajectoryFilter.filters.value() + [cms.PSet(refToPSet_ = cms.string('ClusterShapeTrajectoryFilter'))]
121 )
122 
123 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
124 lowPtQuadStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
125  ComponentName = 'lowPtQuadStepChi2Est',
126  nSigma = 3.0,
127  MaxChi2 = 9.0,
128  clusterChargeCut = dict(refToPSet_ = ('SiStripClusterChargeCutTight')),
129 )
130 trackingPhase2PU140.toModify(lowPtQuadStepChi2Est,
131  MaxChi2 = 16.0,
132  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutNone')
133 )
134 
135 # TRACK BUILDING
137 lowPtQuadStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
138  MeasurementTrackerName = '',
139  trajectoryFilter = dict(refToPSet_ = 'lowPtQuadStepTrajectoryFilter'),
140  maxCand = 4,
141  estimator = 'lowPtQuadStepChi2Est',
142  maxDPhiForLooperReconstruction = cms.double(2.0),
143  # 0.63 GeV is the maximum pT for a charged particle to loop within the 1.1m radius
144  # of the outermost Tracker barrel layer (with B=3.8T)
145  maxPtForLooperReconstruction = cms.double(0.7)
146 )
147 trackingPhase2PU140.toModify(lowPtQuadStepTrajectoryBuilder,
148  minNrOfHitsForRebuild = 1,
149  keepOriginalIfRebuildFails = True,
150 )
151 
152 
153 # MAKING OF TRACK CANDIDATES
154 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits as _trajectoryCleanerBySharedHits
155 lowPtQuadStepTrajectoryCleanerBySharedHits = _trajectoryCleanerBySharedHits.clone(
156  ComponentName = 'lowPtQuadStepTrajectoryCleanerBySharedHits',
157  fractionShared = 0.16,
158  allowSharedFirstHit = True
159 )
160 trackingPhase2PU140.toModify(lowPtQuadStepTrajectoryCleanerBySharedHits, fractionShared = 0.09)
161 
163 lowPtQuadStepTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
164  src = 'lowPtQuadStepSeeds',
165 
166  numHitsForSeedCleaner = cms.int32(50),
167  onlyPixelHitsForSeedCleaner = cms.bool(True),
168  TrajectoryBuilderPSet = dict(refToPSet_ = 'lowPtQuadStepTrajectoryBuilder'),
169  TrajectoryCleaner = 'lowPtQuadStepTrajectoryCleanerBySharedHits',
170  clustersToSkip = cms.InputTag('lowPtQuadStepClusters'),
171  doSeedingRegionRebuilding = True,
172  useHitsSplitting = True
173 )
174 trackingPhase2PU140.toModify(lowPtQuadStepTrackCandidates,
175  clustersToSkip = None,
176  phase2clustersToSkip = cms.InputTag('lowPtQuadStepClusters')
177 )
178 
179 from Configuration.ProcessModifiers.trackingMkFitLowPtQuadStep_cff import trackingMkFitLowPtQuadStep
180 import RecoTracker.MkFit.mkFitSeedConverter_cfi as mkFitSeedConverter_cfi
181 import RecoTracker.MkFit.mkFitIterationConfigESProducer_cfi as mkFitIterationConfigESProducer_cfi
182 import RecoTracker.MkFit.mkFitProducer_cfi as mkFitProducer_cfi
183 import RecoTracker.MkFit.mkFitOutputConverter_cfi as mkFitOutputConverter_cfi
184 lowPtQuadStepTrackCandidatesMkFitSeeds = mkFitSeedConverter_cfi.mkFitSeedConverter.clone(
185  seeds = 'lowPtQuadStepSeeds',
186 )
187 lowPtQuadStepTrackCandidatesMkFitConfig = mkFitIterationConfigESProducer_cfi.mkFitIterationConfigESProducer.clone(
188  ComponentName = 'lowPtQuadStepTrackCandidatesMkFitConfig',
189  config = 'RecoTracker/MkFit/data/mkfit-phase1-lowPtQuadStep.json',
190 )
191 lowPtQuadStepTrackCandidatesMkFit = mkFitProducer_cfi.mkFitProducer.clone(
192  seeds = 'lowPtQuadStepTrackCandidatesMkFitSeeds',
193  config = ('', 'lowPtQuadStepTrackCandidatesMkFitConfig'),
194  clustersToSkip = 'lowPtQuadStepClusters',
195 )
196 trackingMkFitLowPtQuadStep.toReplaceWith(lowPtQuadStepTrackCandidates, mkFitOutputConverter_cfi.mkFitOutputConverter.clone(
197  seeds = 'lowPtQuadStepSeeds',
198  mkFitSeeds = 'lowPtQuadStepTrackCandidatesMkFitSeeds',
199  tracks = 'lowPtQuadStepTrackCandidatesMkFit',
200 ))
201 
202 #For FastSim phase1 tracking
203 import FastSimulation.Tracking.TrackCandidateProducer_cfi
204 _fastSim_lowPtQuadStepTrackCandidates = FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
205  src = 'lowPtQuadStepSeeds',
206  MinNumberOfCrossedLayers = 3,
207  hitMasks = cms.InputTag('lowPtQuadStepMasks')
208 )
209 fastSim.toReplaceWith(lowPtQuadStepTrackCandidates,_fastSim_lowPtQuadStepTrackCandidates)
210 
211 # TRACK FITTING
213 lowPtQuadStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
214  src = 'lowPtQuadStepTrackCandidates',
215  AlgorithmName = 'lowPtQuadStep',
216  Fitter = 'FlexibleKFFittingSmoother',
217 )
218 fastSim.toModify(lowPtQuadStepTracks,TTRHBuilder = 'WithoutRefit')
219 
220 
221 # Final selection
223 lowPtQuadStep = TrackMVAClassifierPrompt.clone(
224  mva = dict(GBRForestLabel = 'MVASelectorLowPtQuadStep_Phase1'),
225  src = 'lowPtQuadStepTracks',
226  qualityCuts = [-0.7,-0.35,-0.15]
227 )
228 
231 trackdnn.toReplaceWith(lowPtQuadStep, TrackTfClassifier.clone(
232  src = 'lowPtQuadStepTracks',
233  qualityCuts = qualityCutDictionary["LowPtQuadStep"]
234 ))
235 
236 highBetaStar_2018.toModify(lowPtQuadStep,qualityCuts = [-0.9,-0.35,-0.15])
237 pp_on_AA.toModify(lowPtQuadStep,
238  mva = dict(GBRForestLabel = 'HIMVASelectorLowPtQuadStep_Phase1'),
239  qualityCuts = [-0.9, -0.4, 0.3],
240 )
241 fastSim.toModify(lowPtQuadStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')
242 
243 # For Phase2PU140
244 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
245 lowPtQuadStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
246  src = 'lowPtQuadStepTracks',
247  trackSelectors = [
248  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
249  name = 'lowPtQuadStepLoose',
250  chi2n_par = 2.0,
251  res_par = ( 0.003, 0.002 ),
252  minNumberLayers = 3,
253  maxNumberLostLayers = 2,
254  minNumber3DLayers = 3,
255  d0_par1 = ( 0.8, 4.0 ),
256  dz_par1 = ( 0.7, 4.0 ),
257  d0_par2 = ( 0.6, 4.0 ),
258  dz_par2 = ( 0.6, 4.0 )
259  ), #end of pset
260  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
261  name = 'lowPtQuadStepTight',
262  preFilterName = 'lowPtQuadStepLoose',
263  chi2n_par = 1.4,
264  res_par = ( 0.003, 0.002 ),
265  minNumberLayers = 3,
266  maxNumberLostLayers = 2,
267  minNumber3DLayers = 3,
268  d0_par1 = ( 0.7, 4.0 ),
269  dz_par1 = ( 0.6, 4.0 ),
270  d0_par2 = ( 0.5, 4.0 ),
271  dz_par2 = ( 0.5, 4.0 )
272  ),
273  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
274  name = 'lowPtQuadStep',
275  preFilterName = 'lowPtQuadStepTight',
276  min_eta = -4.0,
277  max_eta = 4.0,
278  chi2n_par = 1.2,
279  res_par = ( 0.003, 0.001 ),
280  minNumberLayers = 3,
281  maxNumberLostLayers = 2,
282  minNumber3DLayers = 3,
283  d0_par1 = ( 0.5, 4.0 ),
284  dz_par1 = ( 0.5, 4.0 ),
285  d0_par2 = ( 0.45, 4.0 ),
286  dz_par2 = ( 0.45, 4.0 )
287  ),
288  ] #end of vpset
289 ) #end of clone
290 
291 
292 # Final sequence
293 LowPtQuadStepTask = cms.Task(lowPtQuadStepClusters,
294  lowPtQuadStepSeedLayers,
295  lowPtQuadStepTrackingRegions,
296  lowPtQuadStepHitDoublets,
297  lowPtQuadStepHitQuadruplets,
298  lowPtQuadStepSeeds,
299  lowPtQuadStepTrackCandidates,
300  lowPtQuadStepTracks,
301  lowPtQuadStep)
302 LowPtQuadStep = cms.Sequence(LowPtQuadStepTask)
303 
304 _LowPtQuadStepTask_trackingMkFit = LowPtQuadStepTask.copy()
305 _LowPtQuadStepTask_trackingMkFit.add(lowPtQuadStepTrackCandidatesMkFitSeeds, lowPtQuadStepTrackCandidatesMkFit, lowPtQuadStepTrackCandidatesMkFitConfig)
306 trackingMkFitLowPtQuadStep.toReplaceWith(LowPtQuadStepTask, _LowPtQuadStepTask_trackingMkFit)
307 
308 _LowPtQuadStepTask_Phase2PU140 = LowPtQuadStepTask.copy()
309 _LowPtQuadStepTask_Phase2PU140.replace(lowPtQuadStep, lowPtQuadStepSelector)
310 trackingPhase2PU140.toReplaceWith(LowPtQuadStepTask, _LowPtQuadStepTask_Phase2PU140)
311 
312 # fast tracking mask producer
313 from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover
314 lowPtQuadStepMasks = maskProducerFromClusterRemover(lowPtQuadStepClusters)
315 fastSim.toReplaceWith(LowPtQuadStepTask,
316  cms.Task(lowPtQuadStepMasks
317  ,lowPtQuadStepTrackingRegions
318  ,lowPtQuadStepSeeds
319  ,lowPtQuadStepTrackCandidates
320  ,lowPtQuadStepTracks
321  ,lowPtQuadStep
322  ) )
TrajectoryFilter_cff
GroupedCkfTrajectoryBuilder_cfi
ClusterShapeTrajectoryFilter_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
TrackTfClassifier_cfi
TrackProducer_cfi
TrackMVAClassifierPrompt_cfi
TrajectoryCleanerBySharedHits_cfi
trackingMkFitLowPtQuadStep_cff
CkfTrackCandidates_cfi
trackSelectionTf_cfi