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