CMS 3D CMS Logo

PixelTracks_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA
4 
9 myTTRHBuilderWithoutAngle = RecoTracker.TransientTrackingRecHit.TransientTrackingRecHitBuilder_cfi.ttrhbwr.clone(
10  StripCPE = 'Fake',
11  ComponentName = 'PixelTTRHBuilderWithoutAngle'
12 )
15 from RecoTracker.PixelTrackFitting.pixelFitterByHelixProjections_cfi import pixelFitterByHelixProjections
16 from RecoTracker.PixelTrackFitting.pixelNtupletsFitter_cfi import pixelNtupletsFitter
17 from RecoTracker.PixelTrackFitting.pixelTrackFilterByKinematics_cfi import pixelTrackFilterByKinematics
18 from RecoTracker.PixelTrackFitting.pixelTrackCleanerBySharedHits_cfi import pixelTrackCleanerBySharedHits
19 from RecoTracker.PixelTrackFitting.pixelTracks_cfi import pixelTracks as _pixelTracks
20 from RecoTracker.TkTrackingRegions.globalTrackingRegion_cfi import globalTrackingRegion as _globalTrackingRegion
21 from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot
22 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
23 from RecoTracker.PixelSeeding.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer
25 import RecoTracker.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi
26 from RecoTracker.FinalTrackSelectors.trackAlgoPriorityOrder_cfi import trackAlgoPriorityOrder
27 
28 # Eras
29 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
30 from Configuration.Eras.Modifier_run3_common_cff import run3_common
31 
32 # seeding layers
33 from RecoTracker.IterativeTracking.InitialStep_cff import initialStepSeedLayers, initialStepHitDoublets, _initialStepCAHitQuadruplets
34 
35 # TrackingRegion
36 pixelTracksTrackingRegions = _globalTrackingRegion.clone()
37 trackingLowPU.toReplaceWith(pixelTracksTrackingRegions, _globalTrackingRegionFromBeamSpot.clone())
38 
39 
40 # Pixel quadruplets tracking
41 pixelTracksSeedLayers = initialStepSeedLayers.clone(
42  BPix = dict(HitProducer = "siPixelRecHitsPreSplitting"),
43  FPix = dict(HitProducer = "siPixelRecHitsPreSplitting")
44 )
45 
46 pixelTracksHitDoublets = initialStepHitDoublets.clone(
47  clusterCheck = "",
48  seedingLayers = "pixelTracksSeedLayers",
49  trackingRegions = "pixelTracksTrackingRegions"
50 )
51 
52 pixelTracksHitQuadruplets = _initialStepCAHitQuadruplets.clone(
53  doublets = "pixelTracksHitDoublets",
54  SeedComparitorPSet = dict(clusterShapeCacheSrc = 'siPixelClusterShapeCachePreSplitting')
55 )
56 
57 pixelTracks = _pixelTracks.clone(
58  SeedingHitSets = "pixelTracksHitQuadruplets"
59 )
60 
61 pixelTracksTask = cms.Task(
62  pixelTracksTrackingRegions,
63  pixelFitterByHelixProjections,
64  pixelTrackFilterByKinematics,
65  pixelTracksSeedLayers,
66  pixelTracksHitDoublets,
67  pixelTracksHitQuadruplets,
68  pixelTracks
69 )
70 
71 pixelTracksSequence = cms.Sequence(pixelTracksTask)
72 
73 
74 # Pixel triplets for trackingLowPU
75 pixelTracksHitTriplets = _pixelTripletHLTEDProducer.clone(
76  doublets = "pixelTracksHitDoublets",
77  produceSeedingHitSets = True,
78  SeedComparitorPSet = RecoTracker.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone(
79  clusterShapeCacheSrc = "siPixelClusterShapeCachePreSplitting"
80  )
81 )
82 
83 trackingLowPU.toModify(pixelTracks,
84  SeedingHitSets = "pixelTracksHitTriplets"
85 )
86 
87 _pixelTracksTask_lowPU = pixelTracksTask.copy()
88 _pixelTracksTask_lowPU.replace(pixelTracksHitQuadruplets, pixelTracksHitTriplets)
89 trackingLowPU.toReplaceWith(pixelTracksTask, _pixelTracksTask_lowPU)
90 
91 
92 # "Patatrack" pixel ntuplets, fishbone cleaning, Broken Line fit, and density-based vertex reconstruction
93 from Configuration.ProcessModifiers.pixelNtupletFit_cff import pixelNtupletFit
94 
95 from RecoTracker.PixelSeeding.caHitNtupletCUDAPhase1_cfi import caHitNtupletCUDAPhase1 as _pixelTracksCUDA
96 from RecoTracker.PixelSeeding.caHitNtupletCUDAPhase2_cfi import caHitNtupletCUDAPhase2 as _pixelTracksCUDAPhase2
97 from RecoTracker.PixelSeeding.caHitNtupletCUDAHIonPhase1_cfi import caHitNtupletCUDAHIonPhase1 as _pixelTracksCUDAHIonPhase1
98 
99 # Phase 2 modifier
100 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
101 # HIon modifiers
102 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
103 
104 # SwitchProducer providing the pixel tracks in SoA format on the CPU
105 pixelTracksSoA = SwitchProducerCUDA(
106  # build pixel ntuplets and pixel tracks in SoA format on the CPU
107  cpu = _pixelTracksCUDA.clone(
108  pixelRecHitSrc = "siPixelRecHitsPreSplittingSoA",
109  idealConditions = False,
110  onGPU = False
111  )
112 )
113 
114 # use quality cuts tuned for Run 2 ideal conditions for all Run 3 workflows
115 run3_common.toModify(pixelTracksSoA.cpu,
116  idealConditions = True
117 )
118 
119 # convert the pixel tracks from SoA to legacy format
120 from RecoTracker.PixelTrackFitting.pixelTrackProducerFromSoAPhase1_cfi import pixelTrackProducerFromSoAPhase1 as _pixelTrackProducerFromSoA
121 from RecoTracker.PixelTrackFitting.pixelTrackProducerFromSoAPhase2_cfi import pixelTrackProducerFromSoAPhase2 as _pixelTrackProducerFromSoAPhase2
122 from RecoTracker.PixelTrackFitting.pixelTrackProducerFromSoAHIonPhase1_cfi import pixelTrackProducerFromSoAHIonPhase1 as _pixelTrackProducerFromSoAHIonPhase1
123 
124 pixelNtupletFit.toReplaceWith(pixelTracks, _pixelTrackProducerFromSoA.clone(
125  pixelRecHitLegacySrc = "siPixelRecHitsPreSplitting",
126 ))
127 
128 (pixelNtupletFit & phase2_tracker).toReplaceWith(pixelTracks, _pixelTrackProducerFromSoAPhase2.clone(
129  pixelRecHitLegacySrc = "siPixelRecHitsPreSplitting",
130 ))
131 
132 (pixelNtupletFit & pp_on_AA).toReplaceWith(pixelTracks, _pixelTrackProducerFromSoAHIonPhase1.clone(
133  pixelRecHitLegacySrc = "siPixelRecHitsPreSplitting",
134 ))
135 
136 pixelNtupletFit.toReplaceWith(pixelTracksTask, cms.Task(
137  # build the pixel ntuplets and the pixel tracks in SoA format on the GPU
138  pixelTracksSoA,
139  # convert the pixel tracks from SoA to legacy format
140  pixelTracks
141 ))
142 
143 # "Patatrack" sequence running on GPU (or CPU if not available)
145 
146 # build the pixel ntuplets and pixel tracks in SoA format on the GPU
147 pixelTracksCUDA = _pixelTracksCUDA.clone(
148  pixelRecHitSrc = "siPixelRecHitsPreSplittingCUDA",
149  idealConditions = False,
150  onGPU = True,
151 )
152 
153 # use quality cuts tuned for Run 2 ideal conditions for all Run 3 workflows
154 run3_common.toModify(pixelTracksCUDA,
155  idealConditions = True
156 )
157 
158 # SwitchProducer providing the pixel tracks in SoA format on the CPU
159 from RecoTracker.PixelTrackFitting.pixelTrackSoAFromCUDAPhase1_cfi import pixelTrackSoAFromCUDAPhase1 as _pixelTracksSoA
160 from RecoTracker.PixelTrackFitting.pixelTrackSoAFromCUDAPhase2_cfi import pixelTrackSoAFromCUDAPhase2 as _pixelTracksSoAPhase2
161 from RecoTracker.PixelTrackFitting.pixelTrackSoAFromCUDAHIonPhase1_cfi import pixelTrackSoAFromCUDAHIonPhase1 as _pixelTracksSoAHIonPhase1
162 
163 gpu.toModify(pixelTracksSoA,
164  # transfer the pixel tracks in SoA format to the host
165  cuda = _pixelTracksSoA.clone()
166 )
167 
168 (gpu & phase2_tracker).toModify(pixelTracksSoA,cuda = _pixelTracksSoAPhase2.clone(
169 ))
170 
171 (gpu & pp_on_AA).toModify(pixelTracksSoA,cuda = _pixelTracksSoAHIonPhase1.clone(
172 ))
173 
174 phase2_tracker.toModify(pixelTracksSoA,cpu = _pixelTracksCUDAPhase2.clone(
175  pixelRecHitSrc = "siPixelRecHitsPreSplittingSoA",
176  onGPU = False
177 ))
178 
179 (pp_on_AA & ~phase2_tracker).toModify(pixelTracksSoA,cpu = _pixelTracksCUDAHIonPhase1.clone(
180  pixelRecHitSrc = "siPixelRecHitsPreSplittingSoA",
181  onGPU = False
182 ))
183 
184 phase2_tracker.toReplaceWith(pixelTracksCUDA,_pixelTracksCUDAPhase2.clone(
185  pixelRecHitSrc = "siPixelRecHitsPreSplittingCUDA",
186  onGPU = True,
187 ))
188 
189 (pp_on_AA & ~phase2_tracker).toReplaceWith(pixelTracksCUDA,_pixelTracksCUDAHIonPhase1.clone(
190  pixelRecHitSrc = "siPixelRecHitsPreSplittingCUDA",
191  onGPU = True,
192 ))
193 
194 (pixelNtupletFit & gpu).toReplaceWith(pixelTracksTask, cms.Task(
195  # build the pixel ntuplets and pixel tracks in SoA format on the GPU
196  pixelTracksCUDA,
197  # transfer the pixel tracks in SoA format to the CPU, and convert them to legacy format
198  pixelTracksTask.copy()
199 ))
200 
201 
203 from Configuration.ProcessModifiers.gpuValidationPixel_cff import gpuValidationPixel
204 (pixelNtupletFit & gpu & gpuValidationPixel).toModify(pixelTracksSoA.cpu,
205  pixelRecHitSrc = "siPixelRecHitsPreSplittingSoA@cpu"
206  )
207 
208 
209 
210 
211 
213 
214 # pixel tracks SoA producer on the device
215 from RecoTracker.PixelSeeding.caHitNtupletAlpakaPhase1_cfi import caHitNtupletAlpakaPhase1 as _pixelTracksAlpakaPhase1
216 from RecoTracker.PixelSeeding.caHitNtupletAlpakaPhase2_cfi import caHitNtupletAlpakaPhase2 as _pixelTracksAlpakaPhase2
217 
218 pixelTracksAlpaka = _pixelTracksAlpakaPhase1.clone()
219 phase2_tracker.toReplaceWith(pixelTracksAlpaka,_pixelTracksAlpakaPhase2.clone())
220 
221 # pixel tracks SoA producer on the cpu, for validation
222 pixelTracksAlpakaSerial = makeSerialClone(pixelTracksAlpaka,
223  pixelRecHitSrc = 'siPixelRecHitsPreSplittingAlpakaSerial'
224 )
225 
226 # legacy pixel tracks from SoA
227 from RecoTracker.PixelTrackFitting.pixelTrackProducerFromSoAAlpakaPhase1_cfi import pixelTrackProducerFromSoAAlpakaPhase1 as _pixelTrackProducerFromSoAAlpakaPhase1
228 from RecoTracker.PixelTrackFitting.pixelTrackProducerFromSoAAlpakaPhase2_cfi import pixelTrackProducerFromSoAAlpakaPhase2 as _pixelTrackProducerFromSoAAlpakaPhase2
229 
230 (alpaka & ~phase2_tracker).toReplaceWith(pixelTracks, _pixelTrackProducerFromSoAAlpakaPhase1.clone(
231  pixelRecHitLegacySrc = "siPixelRecHitsPreSplitting",
232 ))
233 
234 (alpaka & phase2_tracker).toReplaceWith(pixelTracks, _pixelTrackProducerFromSoAAlpakaPhase2.clone(
235  pixelRecHitLegacySrc = "siPixelRecHitsPreSplitting",
236 ))
237 
238 alpaka.toReplaceWith(pixelTracksTask, cms.Task(
239  # Build the pixel ntuplets and the pixel tracks in SoA format with alpaka on the device
240  pixelTracksAlpaka,
241  # Build the pixel ntuplets and the pixel tracks in SoA format with alpaka on the cpu (if requested by the validation)
242  pixelTracksAlpakaSerial,
243  # Convert the pixel tracks from SoA to legacy format
244  pixelTracks)
245 )
TRIGGER SELECTION #####.
def makeSerialClone(module, kwargs)
Definition: functions.py:1