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