CMS 3D CMS Logo

HighPtTripletStep_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 
9 
10 # NEW CLUSTERS (remove previously used clusters)
11 highPtTripletStepClusters = _cfg.clusterRemoverForIter('HighPtTripletStep')
12 for _eraName, _postfix, _era in _cfg.nonDefaultEras():
13  _era.toReplaceWith(highPtTripletStepClusters, _cfg.clusterRemoverForIter('HighPtTripletStep', _eraName, _postfix))
14 
15 
16 # SEEDING LAYERS
17 import RecoTracker.TkSeedingLayers.PixelLayerTriplets_cfi as _PixelLayerTriplets_cfi
18 highPtTripletStepSeedLayers = _PixelLayerTriplets_cfi.PixelLayerTriplets.clone(
19  layerList = [
20  'BPix1+BPix2+BPix3',
21  'BPix2+BPix3+BPix4',
22  'BPix1+BPix3+BPix4',
23  'BPix1+BPix2+BPix4',
24  'BPix2+BPix3+FPix1_pos', 'BPix2+BPix3+FPix1_neg',
25  'BPix1+BPix2+FPix1_pos', 'BPix1+BPix2+FPix1_neg',
26  'BPix1+BPix3+FPix1_pos', 'BPix1+BPix3+FPix1_neg',
27  'BPix2+FPix1_pos+FPix2_pos', 'BPix2+FPix1_neg+FPix2_neg',
28  'BPix1+FPix1_pos+FPix2_pos', 'BPix1+FPix1_neg+FPix2_neg',
29  'BPix1+BPix2+FPix2_pos', 'BPix1+BPix2+FPix2_neg',
30  'FPix1_pos+FPix2_pos+FPix3_pos', 'FPix1_neg+FPix2_neg+FPix3_neg',
31  'BPix1+FPix2_pos+FPix3_pos', 'BPix1+FPix2_neg+FPix3_neg',
32  'BPix1+FPix1_pos+FPix3_pos', 'BPix1+FPix1_neg+FPix3_neg'
33  ],
34  BPix = dict(skipClusters = cms.InputTag('highPtTripletStepClusters')),
35  FPix = dict(skipClusters = cms.InputTag('highPtTripletStepClusters'))
36 )
37 
38 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
39 trackingPhase2PU140.toModify(highPtTripletStepSeedLayers,
40 # combination with gap removed as only source of fakes in current geometry (kept for doc)
41  layerList = ['BPix1+BPix2+BPix3', 'BPix2+BPix3+BPix4',
42  'BPix1+BPix3+BPix4', 'BPix1+BPix2+BPix4',
43  'BPix2+BPix3+FPix1_pos', 'BPix2+BPix3+FPix1_neg',
44  'BPix1+BPix2+FPix1_pos', 'BPix1+BPix2+FPix1_neg',
45  'BPix2+FPix1_pos+FPix2_pos', 'BPix2+FPix1_neg+FPix2_neg',
46  'BPix1+FPix1_pos+FPix2_pos', 'BPix1+FPix1_neg+FPix2_neg',
47 # 'BPix1+BPix2+FPix2_pos', 'BPix1+BPix2+FPix2_neg',
48  'FPix1_pos+FPix2_pos+FPix3_pos', 'FPix1_neg+FPix2_neg+FPix3_neg',
49  'BPix1+FPix2_pos+FPix3_pos', 'BPix1+FPix2_neg+FPix3_neg',
50 # 'BPix1+FPix1_pos+FPix3_pos', 'BPix1+FPix1_neg+FPix3_neg',
51  'FPix2_pos+FPix3_pos+FPix4_pos', 'FPix2_neg+FPix3_neg+FPix4_neg',
52  'FPix3_pos+FPix4_pos+FPix5_pos', 'FPix3_neg+FPix4_neg+FPix5_neg',
53  'FPix4_pos+FPix5_pos+FPix6_pos', 'FPix4_neg+FPix5_neg+FPix6_neg',
54  'FPix5_pos+FPix6_pos+FPix7_pos', 'FPix5_neg+FPix6_neg+FPix7_neg',
55  'FPix6_pos+FPix7_pos+FPix8_pos', 'FPix6_neg+FPix7_neg+FPix8_neg',
56 # removed as redunant and covering effectively only eta>4 (here for documentation, to be optimized after TDR)
57 # 'FPix6_pos+FPix7_pos+FPix9_pos', 'FPix6_neg+FPix7_neg+FPix9_neg']
58  ]
59 )
60 # TrackingRegion
61 from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot
62 highPtTripletStepTrackingRegions = _globalTrackingRegionFromBeamSpot.clone(RegionPSet = dict(
63  ptMin = 0.55,
64  originRadius = 0.02,
65  nSigmaZ = 4.0
66 ))
67 trackingPhase2PU140.toModify(highPtTripletStepTrackingRegions, RegionPSet = dict(ptMin = 0.7, originRadius = 0.02))
68 
69 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
70 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
71 from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cff import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices
72 (pp_on_XeXe_2017 | pp_on_AA).toReplaceWith(highPtTripletStepTrackingRegions,
73  _globalTrackingRegionWithVertices.clone(RegionPSet=dict(
74  fixedError = 0.2,
75  ptMin = 0.7,
76  originRadius = 0.02
77  )
78  )
79 )
80 from Configuration.Eras.Modifier_highBetaStar_2018_cff import highBetaStar_2018
81 highBetaStar_2018.toModify(highPtTripletStepTrackingRegions,RegionPSet = dict(
82  ptMin = 0.05,
83  originRadius = 0.2
84 ))
85 
86 
87 # seeding
88 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
89 highPtTripletStepHitDoublets = _hitPairEDProducer.clone(
90  seedingLayers = 'highPtTripletStepSeedLayers',
91  trackingRegions = 'highPtTripletStepTrackingRegions',
92  layerPairs = [0,1], # layer pairs (0,1), (1,2)
93  maxElement = 50000000,
94  produceIntermediateHitDoublets = True,
95 )
96 from RecoPixelVertexing.PixelTriplets.caHitTripletEDProducer_cfi import caHitTripletEDProducer as _caHitTripletEDProducer
97 from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer
99 import RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi
100 highPtTripletStepHitTriplets = _caHitTripletEDProducer.clone(
101  doublets = 'highPtTripletStepHitDoublets',
102  extraHitRPhitolerance = _pixelTripletHLTEDProducer.extraHitRPhitolerance,
103  SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone(),
104  maxChi2 = dict(
105  pt1 = 0.8, pt2 = 8,
106  value1 = 100, value2 = 6,
107  ),
108  useBendingCorrection = True,
109  CAThetaCut = 0.004,
110  CAPhiCut = 0.07,
111  CAHardPtCut = 0.3,
112 )
113 
114 trackingPhase2PU140.toModify(highPtTripletStepHitTriplets,CAThetaCut = 0.003,CAPhiCut = 0.06,CAHardPtCut = 0.5)
115 highBetaStar_2018.toModify(highPtTripletStepHitTriplets,CAThetaCut = 0.008,CAPhiCut = 0.14,CAHardPtCut = 0)
116 
117 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsEDProducer_cff import seedCreatorFromRegionConsecutiveHitsEDProducer as _seedCreatorFromRegionConsecutiveHitsEDProducer
118 highPtTripletStepSeeds = _seedCreatorFromRegionConsecutiveHitsEDProducer.clone(
119  seedingHitSets = 'highPtTripletStepHitTriplets',
120 )
121 
122 #For FastSim phase1 tracking
123 import FastSimulation.Tracking.TrajectorySeedProducer_cfi
124 from FastSimulation.Tracking.SeedingMigration import _hitSetProducerToFactoryPSet
125 _fastSim_highPtTripletStepSeeds = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
126  trackingRegions = 'highPtTripletStepTrackingRegions',
127  hitMasks = cms.InputTag('highPtTripletStepMasks'),
128  seedFinderSelector = dict( CAHitTripletGeneratorFactory = _hitSetProducerToFactoryPSet(highPtTripletStepHitTriplets),
129  layerList = highPtTripletStepSeedLayers.layerList.value(),
130  #new parameters required for phase1 seeding
131  BPix = dict(TTRHBuilder = 'WithoutRefit', HitProducer = 'TrackingRecHitProducer',),
132  FPix = dict(TTRHBuilder = 'WithoutRefit', HitProducer = 'TrackingRecHitProducer',),
133  layerPairs = highPtTripletStepHitDoublets.layerPairs.value()
134  ))
135 
136 _fastSim_highPtTripletStepSeeds.seedFinderSelector.CAHitTripletGeneratorFactory.SeedComparitorPSet.ComponentName = 'none'
137 fastSim.toReplaceWith(highPtTripletStepSeeds,_fastSim_highPtTripletStepSeeds)
138 
139 # QUALITY CUTS DURING TRACK BUILDING
140 import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff as _TrajectoryFilter_cff
141 _highPtTripletStepTrajectoryFilterBase = _TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
142  minimumNumberOfHits = 3,
143  minPt = 0.2,
144 )
145 highPtTripletStepTrajectoryFilterBase = _highPtTripletStepTrajectoryFilterBase.clone(
146  maxCCCLostHits = 0,
147  minGoodStripCharge = dict(refToPSet_ = 'SiStripClusterChargeCutLoose')
148 )
149 trackingPhase2PU140.toReplaceWith(highPtTripletStepTrajectoryFilterBase, _highPtTripletStepTrajectoryFilterBase)
150 
151 (pp_on_XeXe_2017 | pp_on_AA).toModify(highPtTripletStepTrajectoryFilterBase, minPt=0.7)
152 highBetaStar_2018.toModify(highPtTripletStepTrajectoryFilterBase, minPt=0.05)
153 
154 highPtTripletStepTrajectoryFilter = _TrajectoryFilter_cff.CompositeTrajectoryFilter_block.clone(
155  filters = [cms.PSet(refToPSet_ = cms.string('highPtTripletStepTrajectoryFilterBase'))]
156 )
157 
158 trackingPhase2PU140.toModify(highPtTripletStepTrajectoryFilter,
159  filters = highPtTripletStepTrajectoryFilter.filters + [cms.PSet(refToPSet_ = cms.string('ClusterShapeTrajectoryFilter'))]
160 )
161 
162 
163 highPtTripletStepTrajectoryFilterInOut = highPtTripletStepTrajectoryFilterBase.clone(
164  minPt = 0.4,
165  minimumNumberOfHits = 4,
166  seedExtension = 1,
167  strictSeedExtension = False, # allow inactive
168  pixelSeedExtension = False,
169 )
170 highBetaStar_2018.toModify(highPtTripletStepTrajectoryFilterInOut, minPt=0.05)
171 
172 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
173 highPtTripletStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
174  ComponentName = 'highPtTripletStepChi2Est',
175  nSigma = 3.0,
176  MaxChi2 = 30.0,
177  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutLoose'),
178  pTChargeCutThreshold = 15.
179 )
180 trackingPhase2PU140.toModify(highPtTripletStepChi2Est,
181  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutNone'),
182  MaxChi2 = 20.0
183 )
184 
185 
186 # TRACK BUILDING
187 import RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi as _GroupedCkfTrajectoryBuilder_cfi
188 highPtTripletStepTrajectoryBuilder = _GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
189  trajectoryFilter = dict(refToPSet_ = 'highPtTripletStepTrajectoryFilter'),
190  alwaysUseInvalidHits = True,
191  maxCand = 3,
192  estimator = 'highPtTripletStepChi2Est',
193  maxDPhiForLooperReconstruction = cms.double(2.0),
194  # 0.63 GeV is the maximum pT for a charged particle to loop within the 1.1m radius
195  # of the outermost Tracker barrel layer (with B=3.8T)
196  maxPtForLooperReconstruction = cms.double(0.7)
197 )
198 trackingPhase2PU140.toModify(highPtTripletStepTrajectoryBuilder,
199  inOutTrajectoryFilter = dict(refToPSet_ = 'highPtTripletStepTrajectoryFilterInOut'),
200  useSameTrajFilter = False,
201  maxCand = 3,
202 )
203 
204 # MAKING OF TRACK CANDIDATES
205 import RecoTracker.CkfPattern.CkfTrackCandidates_cfi as _CkfTrackCandidates_cfi
206 highPtTripletStepTrackCandidates = _CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
207  src = 'highPtTripletStepSeeds',
208  clustersToSkip = cms.InputTag('highPtTripletStepClusters'),
209 
210  numHitsForSeedCleaner = cms.int32(50),
211  onlyPixelHitsForSeedCleaner = cms.bool(True),
212  TrajectoryBuilderPSet = dict(refToPSet_ = 'highPtTripletStepTrajectoryBuilder'),
213  doSeedingRegionRebuilding = True,
214  useHitsSplitting = True
215 )
216 
217 # For Phase2PU140
218 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits as _trajectoryCleanerBySharedHits
219 highPtTripletStepTrajectoryCleanerBySharedHits = _trajectoryCleanerBySharedHits.clone(
220  ComponentName = 'highPtTripletStepTrajectoryCleanerBySharedHits',
221  fractionShared = 0.16,
222  allowSharedFirstHit = True
223 )
224 trackingPhase2PU140.toModify(highPtTripletStepTrackCandidates,
225  TrajectoryCleaner = 'highPtTripletStepTrajectoryCleanerBySharedHits',
226  clustersToSkip = None,
227  phase2clustersToSkip = cms.InputTag('highPtTripletStepClusters')
228 )
229 
230 #For FastSim phase1 tracking
231 import FastSimulation.Tracking.TrackCandidateProducer_cfi
232 _fastSim_highPtTripletStepTrackCandidates = FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
233  src = 'highPtTripletStepSeeds',
234  MinNumberOfCrossedLayers = 3,
235  hitMasks = cms.InputTag('highPtTripletStepMasks')
236 )
237 fastSim.toReplaceWith(highPtTripletStepTrackCandidates,_fastSim_highPtTripletStepTrackCandidates)
238 
239 # TRACK FITTING
241 highPtTripletStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
242  src = 'highPtTripletStepTrackCandidates',
243  AlgorithmName = 'highPtTripletStep',
244  Fitter = 'FlexibleKFFittingSmoother',
245 )
246 fastSim.toModify(highPtTripletStepTracks,TTRHBuilder = 'WithoutRefit')
247 
248 # Final selection
250 highPtTripletStep = TrackMVAClassifierPrompt.clone(
251  mva = dict(GBRForestLabel = 'MVASelectorHighPtTripletStep_Phase1'),
252  src = 'highPtTripletStepTracks',
253  qualityCuts = [0.2,0.3,0.4]
254 )
255 
258 trackdnn.toReplaceWith(highPtTripletStep, TrackLwtnnClassifier.clone(
259  src = 'highPtTripletStepTracks',
260  qualityCuts = [0.75, 0.775, 0.8],
261 ))
262 
263 highBetaStar_2018.toModify(highPtTripletStep,qualityCuts = [-0.2,0.3,0.4])
264 pp_on_AA.toModify(highPtTripletStep,
265  mva = dict(GBRForestLabel = 'HIMVASelectorHighPtTripletStep_Phase1'),
266  qualityCuts = [-0.9, -0.3, 0.85],
267 )
268 
269 fastSim.toModify(highPtTripletStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')
270 
271 # For Phase2PU140
272 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
273 highPtTripletStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
274  src = 'highPtTripletStepTracks',
275  trackSelectors = [
276  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
277  name = 'highPtTripletStepLoose',
278  chi2n_par = 2.0,
279  res_par = ( 0.003, 0.002 ),
280  minNumberLayers = 3,
281  maxNumberLostLayers = 3,
282  minNumber3DLayers = 3,
283  d0_par1 = ( 0.7, 4.0 ),
284  dz_par1 = ( 0.8, 4.0 ),
285  d0_par2 = ( 0.6, 4.0 ),
286  dz_par2 = ( 0.6, 4.0 )
287  ), #end of pset
288  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
289  name = 'highPtTripletStepTight',
290  preFilterName = 'highPtTripletStepLoose',
291  chi2n_par = 1.0,
292  res_par = ( 0.003, 0.002 ),
293  minNumberLayers = 3,
294  maxNumberLostLayers = 2,
295  minNumber3DLayers = 3,
296  d0_par1 = ( 0.6, 4.0 ),
297  dz_par1 = ( 0.7, 4.0 ),
298  d0_par2 = ( 0.5, 4.0 ),
299  dz_par2 = ( 0.6, 4.0 )
300  ),
301  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
302  name = 'highPtTripletStep',
303  preFilterName = 'highPtTripletStepTight',
304  min_eta = -4.1,
305  max_eta = 4.1,
306  chi2n_par = 0.8,
307  res_par = ( 0.003, 0.001 ),
308  min_nhits = 4,
309  minNumberLayers = 4,
310  maxNumberLostLayers = 2,
311  minNumber3DLayers = 4,
312  d0_par1 = ( 0.6, 4.0 ),
313  dz_par1 = ( 0.7, 4.0 ),
314  d0_par2 = ( 0.45, 4.0 ),
315  dz_par2 = ( 0.55, 4.0 )
316  ),
317  ] #end of vpset
318 ) #end of clone
319 
320 from Configuration.ProcessModifiers.vectorHits_cff import vectorHits
321 vectorHits.toModify(highPtTripletStepSelector.trackSelectors[2], minNumberLayers = 3, minNumber3DLayers = 3, d0_par1 = ( 0.5, 4.0 ), dz_par1 = ( 0.6, 4.0 ))
322 
323 # Final sequence
324 HighPtTripletStepTask = cms.Task(highPtTripletStepClusters,
325  highPtTripletStepSeedLayers,
326  highPtTripletStepTrackingRegions,
327  highPtTripletStepHitDoublets,
328  highPtTripletStepHitTriplets,
329  highPtTripletStepSeeds,
330  highPtTripletStepTrackCandidates,
331  highPtTripletStepTracks,
332  highPtTripletStep)
333 HighPtTripletStep = cms.Sequence(HighPtTripletStepTask)
334 _HighPtTripletStepTask_Phase2PU140 = HighPtTripletStepTask.copy()
335 _HighPtTripletStepTask_Phase2PU140.replace(highPtTripletStep, highPtTripletStepSelector)
336 _HighPtTripletStep_Phase2PU140 = cms.Sequence(_HighPtTripletStepTask_Phase2PU140)
337 trackingPhase2PU140.toReplaceWith(HighPtTripletStepTask, _HighPtTripletStepTask_Phase2PU140)
338 
339 # fast tracking mask producer
340 from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover
341 highPtTripletStepMasks = maskProducerFromClusterRemover(highPtTripletStepClusters)
342 fastSim.toReplaceWith(HighPtTripletStepTask,
343  cms.Task(highPtTripletStepMasks
344  ,highPtTripletStepTrackingRegions
345  ,highPtTripletStepSeeds
346  ,highPtTripletStepTrackCandidates
347  ,highPtTripletStepTracks
348  ,highPtTripletStep
349  ) )
TrajectoryFilter_cff
TrackLwtnnClassifier_cfi
GroupedCkfTrajectoryBuilder_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
trackSelectionLwtnn_cfi
PixelLayerTriplets_cfi
TRIGGER SELECTION #####.
TrackProducer_cfi
TrackMVAClassifierPrompt_cfi
TrajectoryCleanerBySharedHits_cfi
CkfTrackCandidates_cfi