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