ATLAS Offline Software
Loading...
Searching...
No Matches
python.ITkActsDeviceTrackRecoConfig Namespace Reference

Classes

class  DataLocation

Functions

 ITkActsDeviceTrackRecoCfg (flags, *, previousExtension=None)
 ITkActsDeviceTrackRecoPostProcessingCfg (flags, *, previousExtension=None)
 ITkActsDeviceSecondaryPassTrackRecoCfg (flags, *, previousExtension=None)

Function Documentation

◆ ITkActsDeviceSecondaryPassTrackRecoCfg()

ITkActsDeviceSecondaryPassTrackRecoCfg ( flags,
* ,
previousExtension = None )
Secondary tracking pass with data preparation on the host and
seeding and track finding on the device.

The clusters and space points of the pass are prepared on the host from
the objects of the previous pass (PRD association), converted to traccc
measurements and spacepoints, and the seeds and tracks are reconstructed
on the device. The tracks are converted back to an ACTS track container
named as for the host reconstruction of the pass.

Definition at line 418 of file ITkActsDeviceTrackRecoConfig.py.

418def ITkActsDeviceSecondaryPassTrackRecoCfg(flags, *, previousExtension=None):
419 """Secondary tracking pass with data preparation on the host and
420 seeding and track finding on the device.
421
422 The clusters and space points of the pass are prepared on the host from
423 the objects of the previous pass (PRD association), converted to traccc
424 measurements and spacepoints, and the seeds and tracks are reconstructed
425 on the device. The tracks are converted back to an ACTS track container
426 named as for the host reconstruction of the pass.
427 """
428 acc = ComponentAccumulator()
429
430 if previousExtension is None:
431 raise ValueError("A secondary pass on the device requires a previous pass")
432
433 extension = flags.Tracking.ActiveConfig.extension
434 prefix = f"ITk{extension.replace('Acts', '')}"
435 pixelClusters = f"{prefix}PixelClusters"
436 stripClusters = f"{prefix}StripClusters"
437
438 if flags.Tracking.ActiveConfig.useITkPixelSeeding:
439 raise ValueError("Pixel seeding on the device is not supported for secondary passes")
440 if not flags.Tracking.ActiveConfig.useITkStripSeeding:
441 raise ValueError("Secondary pass on the device requires strip seeding")
442
443 print(f"Setting up GPU algorithms for the {extension} pass with {flags.Device.Backend.value} backend")
444
445 # Setup traccc detector description objects — loads all device detector description data into detStore
446 acc.merge(DeviceDetectorDescriptionCondAlgCfg(flags))
447
448 from ActsGPUMagField.ActsGPUMagFieldConfig import JSONDeviceMagFieldProviderSvcCfg
449 acc.merge(JSONDeviceMagFieldProviderSvcCfg(flags,
450 DeviceMagFieldObjectName="TracccMagneticField",
451 HostMagFieldObjectName="TracccHostMagField",
452 ))
453
454 # --- Data preparation on the host ---
455 from InDetConfig.ITkActsDataPreparationConfig import ITkActsDataPreparationCfg
456 acc.merge(ITkActsDataPreparationCfg(flags, previousExtension=previousExtension))
457
458 # --- Conversion to traccc ---
459 measurements = f"Traccc{extension}MeasurementCollection"
460 measToPixelCluster = f"Traccc{extension}MeasToPixelCluster"
461 measToStripCluster = f"Traccc{extension}MeasToStripCluster"
462 stripSpacepoints = f"Traccc{extension}StripSpacepointCollection"
463
464 from ActsGPUEventCnv.ActsGPUEventCnvConfig import (
465 xAODToTracccMeasurementConverterAlgCfg,
466 xAODToTracccSpacePointConverterAlgCfg,
467 )
468 acc.merge(xAODToTracccMeasurementConverterAlgCfg(flags,
469 name=f"{extension}MeasurementConverterAlg",
470 InputPixelClusters=pixelClusters,
471 InputStripClusters=stripClusters,
472 OutputTracccMeasurements=measurements,
473 OutputMeasToPixelCluster=measToPixelCluster,
474 OutputMeasToStripCluster=measToStripCluster,
475 ))
476
477 stripSpacePoints = [f"{prefix}StripSpacePoints"]
478 if extension != "ActsConversion":
479 stripSpacePoints += [f"{prefix}StripOverlapSpacePoints"]
480 acc.merge(xAODToTracccSpacePointConverterAlgCfg(flags,
481 name=f"{extension}StripSpacePointConverterAlg",
482 InputSpacePoints=stripSpacePoints,
483 InputMeasToCluster=measToStripCluster,
484 OutputTracccSpacepoints=stripSpacepoints,
485 ))
486
487 # --- Seeding ---
488 seeds = f"Traccc{extension}StripSeedCollection"
489 from ActsGPUPatternRecognition.ActsGPUPatternRecognitionConfig import (
490 DeviceLargeRadiusStripTripletSeedingAlgCfg,
491 DeviceTrkParamEstimationAlgCfg,
492 DeviceLargeRadiusTrackFindingAlgCfg,
493 )
494 acc.merge(DeviceLargeRadiusStripTripletSeedingAlgCfg(flags,
495 name=f"{extension}DeviceStripTripletSeedingAlg",
496 InputTracccPixelSpacepoints=stripSpacepoints,
497 OutputTracccPixelSeeds=seeds,
498 ))
499
500 # --- Track Reconstruction ---
501 trackParameters = f"Traccc{extension}TrackParameterCollection"
502 tracccTracks = f"Traccc{extension}TrackCollection"
503 acc.merge(DeviceTrkParamEstimationAlgCfg(flags,
504 name=f"{extension}DeviceTrkParamEstimationAlg",
505 InputTracccSpacepoints=stripSpacepoints,
506 InputTracccMeasurements=measurements,
507 InputTracccSeeds=seeds,
508 InputTracccMagField="TracccMagneticField",
509 OutputTracccTrackParameters=trackParameters,
510 ))
511
512 acc.merge(DeviceLargeRadiusTrackFindingAlgCfg(flags,
513 name=f"{extension}DeviceTrackFindingAlg",
514 InputTracccMeasurements=measurements,
515 InputTracccMagField="TracccMagneticField",
516 InputTracccTrackParameters=trackParameters,
517 InputTracccDetectorGeometry="TracccDeviceDetectorGeometry",
518 OutputTracccTracks=tracccTracks,
519 ))
520
521 # The measurement to cluster maps hold the index of the cluster in its
522 # owning container, so the tracks are resolved against the primary pass
523 # cluster containers rather than the views of this pass
524 from ActsGPUEventCnv.ActsGPUEventCnvConfig import TracccTrackConverterAlgCfg
525 acc.merge(TracccTrackConverterAlgCfg(flags,
526 name=f"{extension}TracccTrackConverterAlg",
527 InputPixelClusters="ITkPixelClusters",
528 InputStripClusters="ITkStripClusters",
529 InputMeasToPixelSP=measToPixelCluster,
530 InputMeasToStripCl=measToStripCluster,
531 InputTracks=tracccTracks,
532 OutputTracks=f"{extension}Tracks",
533 GeoIdMapping="TracccGeometryIdMapping",
534 HostDetectorName="TracccHostDetectorGeometry",
535 ))
536
537 # Ambiguity Resolution
538 if flags.Acts.doAmbiguityResolution:
539 from ActsConfig.ActsTrackFindingConfig import ActsAmbiguityResolutionCfg
540 acc.merge(ActsAmbiguityResolutionCfg(flags))
541
542 # PRD association
543 from ActsConfig.ActsPrdAssociationConfig import ActsPrdAssociationAlgCfg
544 acc.merge(ActsPrdAssociationAlgCfg(flags,
545 name = f'{extension}PrdAssociationAlg',
546 previousActsExtension = previousExtension))
547
548 # Truth
549 if flags.Tracking.doTruth:
550 from ActsConfig.ActsTruthConfig import ActsTrackToTruthAssociationAlgCfg, ActsTrackFindingValidationAlgCfg
551 if flags.Tracking.ActiveConfig.storeSiSPSeededTracks or not flags.Acts.doAmbiguityResolution:
552 acts_tracks = f"{extension}Tracks"
553 acc.merge(ActsTrackToTruthAssociationAlgCfg(flags,
554 name = f"{acts_tracks}TrackToTruthAssociationAlg",
555 ACTSTracksLocation = acts_tracks,
556 AssociationMapOut = f"{acts_tracks}ToTruthParticleAssociation"))
557 acc.merge(ActsTrackFindingValidationAlgCfg(flags,
558 name = f"{acts_tracks}TrackFindingValidationAlg",
559 TrackToTruthAssociationMap = f"{acts_tracks}ToTruthParticleAssociation"))
560
561 if flags.Acts.doAmbiguityResolution:
562 acts_tracks = f"{extension}ResolvedTracks"
563 acc.merge(ActsTrackToTruthAssociationAlgCfg(flags,
564 name = f"{acts_tracks}TrackToTruthAssociationAlg",
565 ACTSTracksLocation = acts_tracks,
566 AssociationMapOut = f"{acts_tracks}ToTruthParticleAssociation"))
567 acc.merge(ActsTrackFindingValidationAlgCfg(flags,
568 name = f"{acts_tracks}TrackFindingValidationAlg",
569 TrackToTruthAssociationMap = f"{acts_tracks}ToTruthParticleAssociation"))
570
571 return acc
void print(char *figname, TCanvas *c1)

◆ ITkActsDeviceTrackRecoCfg()

ITkActsDeviceTrackRecoCfg ( flags,
* ,
previousExtension = None )

Definition at line 13 of file ITkActsDeviceTrackRecoConfig.py.

13def ITkActsDeviceTrackRecoCfg(flags, *, previousExtension=None):
14 acc = ComponentAccumulator()
15
16 tritonMode = flags.Acts.Device.tritonMode
17 doDeviceSteps = (flags.Acts.Device.doClusterization,
18 flags.Acts.Device.doSeeding,
19 flags.Acts.Device.doTrackReconstruction)
20 if tritonMode is DeviceTritonMode.Server and not all(doDeviceSteps):
21 raise ValueError("Acts.Device.tritonMode=Server runs the full chain on "
22 "the device: Acts.Device.doClusterization, doSeeding and "
23 "doTrackReconstruction must all be True.")
24 if tritonMode is DeviceTritonMode.Client and any(doDeviceSteps):
25 raise ValueError("Acts.Device.tritonMode=Client sends the event to the "
26 "Triton server instead of running on the device: "
27 "Acts.Device.doClusterization, doSeeding and doTrackReconstruction "
28 "must all be False.")
29
30 # Bring up shared device infrastructure once, upfront
31 print(f"Setting up GPU algorithms with {flags.Device.Backend.value} backend")
32
33 acc.merge(DeviceDetectorDescriptionCondAlgCfg(flags))
34
35 if tritonMode is DeviceTritonMode.Client:
36 from TracccTritonClient.TracccTritonClientConfig import TritonTracccTrackMakerCfg
37 acc.merge(TritonTracccTrackMakerCfg(flags))
38 acc.merge(ITkActsDeviceTrackRecoPostProcessingCfg(flags, previousExtension=previousExtension))
39 return acc
40
41 # --- Clusterization ---
42 if flags.Acts.Device.doClusterization and tritonMode is DeviceTritonMode.Server:
43 # The cells are recorded by the Triton backend from the client request
44 acc.merge(DeviceClusterizationAlgCfg(flags,
45 InputTracccCells="TracccCellCollection",
46 OutputTracccMeasurements="TracccMeasurementCollection",
47 OutputTracccClusters="TracccClusterCollection",
48 RetrieveClusterCells=True))
49 clustersLocation = DataLocation.DEVICE
50
51 elif flags.Acts.Device.doClusterization:
52
53 #TODO: remove this once MC is fixed
54 if not flags.Tracking.doPixelDigitalClustering:
55 raise ValueError("clusterization on device is not compatible "
56 "with analog clustering at the moment due to incorrent "
57 "ToT values for Pixel hits in the simulation data.")
58
59 # Create RoI for secondary passes (e.g. LargeD0) to reuse
60 from ActsConfig.ActsRegionsOfInterestConfig import ActsRegionsOfInterestCreatorAlgCfg
61 acc.merge(ActsRegionsOfInterestCreatorAlgCfg(flags,
62 name=f"{flags.Tracking.ActiveConfig.extension}RegionsOfInterestCreatorAlg"))
63
64 # PLR has no device clustering; run it on the host as a sidecar
65 if flags.Detector.EnablePLR:
66 from ActsConfig.ActsClusterizationConfig import ActsPLRClusterizationAlgCfg
67 acc.merge(ActsPLRClusterizationAlgCfg(
68 flags,
69 name=f"{flags.Tracking.ActiveConfig.extension}PLRClusterizationAlg",
70 RoIs=f"{flags.Tracking.ActiveConfig.extension}RegionOfInterest"))
71
72 print("Performing clusterization on device")
73
74 # setup RDO converter
75 if flags.Acts.EDM.PhaseII :
76 from ActsConfig.ActsPhaseIIRawDataEdmConfig import (
77 PhaseIIPixelRawDataContainerCfg,
78 PhaseIIStripRawDataContainerCfg,
79 )
80 acc.merge(PhaseIIPixelRawDataContainerCfg(flags))
81 acc.merge(PhaseIIStripRawDataContainerCfg(flags))
82 from ActsGPUEventCnv.ActsGPUEventCnvConfig import PhaseIIRDOtoTracccCellConverterAlgCfg
83 acc.merge(PhaseIIRDOtoTracccCellConverterAlgCfg(flags,
84 TracccCells = "TracccCellCollection",
85 ))
86 else:
87 from ActsGPUEventCnv.ActsGPUEventCnvConfig import RDOtoTracccCellConverterAlgCfg
88 acc.merge(RDOtoTracccCellConverterAlgCfg(flags,
89 TracccCells = "TracccCellCollection",
90 ))
91
92 # setup traccc clusterization
93 acc.merge(DeviceClusterizationAlgCfg(flags,
94 InputTracccCells="TracccCellCollection",
95 OutputTracccMeasurements="TracccMeasurementCollection",
96 OutputTracccClusters="TracccClusterCollection",
97 RetrieveClusterCells=flags.Tracking.doTruth,
98 previousExtension=previousExtension))
99 clustersLocation = DataLocation.DEVICE
100
101 else:
102 from InDetConfig.ITkActsDataPreparationConfig import ITkActsDataPreparationCfg
103 acc.merge(ITkActsDataPreparationCfg(flags, previousExtension=previousExtension))
104 clustersLocation = DataLocation.HOST
105
106 # --- Seeding ---
107 if flags.Acts.Device.doSeeding:
108
109 if clustersLocation is not DataLocation.DEVICE:
110 raise ValueError("Device seeding requires device clusterization "
111 "(flags.Acts.Device.doClusterization=True): it reads the "
112 "traccc measurement collection straight out of device memory "
113 "and there is currently no host->device measurement converter.")
114
115 # Pixel space point formation on device
116 from ActsGPUDataPreparation.ActsGPUDataPreparationConfig import DeviceSPFormationAlgCfg
117 acc.merge(DeviceSPFormationAlgCfg(flags,
118 name="DeviceSPFormationAlg",
119 InputTracccMeasurements="TracccMeasurementCollection",
120 OutputTracccPixelSpacepoints="TracccPixelSpacepointCollection"))
121
122 from ActsConfig.ActsConfigFlags import SeedingStrategy
123
124 print(f"Performing seeding on device with seeding strategy set to {flags.Acts.Device.seedingStrategy}")
125 if flags.Acts.Device.seedingStrategy is SeedingStrategy.Gbts:
126 from ActsGPUPatternRecognition.ActsGPUPatternRecognitionConfig import DeviceGBTSSeedingAlgCfg
127 acc.merge(DeviceGBTSSeedingAlgCfg(flags,
128 name="DeviceGBTSSeedingAlg",
129 InputTracccPixelSpacepoints="TracccPixelSpacepointCollection",
130 InputTracccMeasurements="TracccMeasurementCollection",
131 OutputTracccPixelSeeds="TracccPixelSeedCollection"))
132 else:
133 from ActsGPUPatternRecognition.ActsGPUPatternRecognitionConfig import DeviceTripletSeedingAlgCfg
134 acc.merge(DeviceTripletSeedingAlgCfg(flags,
135 name="DeviceTripletSeedingAlg",
136 InputTracccPixelSpacepoints="TracccPixelSpacepointCollection",
137 OutputTracccPixelSeeds="TracccPixelSeedCollection"))
138
139 seedsLocation = DataLocation.DEVICE
140
141 else:
142
143 # If clusterization was on device, need to copy them to host first
144 # and schedule space point formation
145 if clustersLocation is DataLocation.DEVICE:
146 from ActsGPUEventCnv.ActsGPUEventCnvConfig import TracccMeasurementConverterAlgCfg
147 acc.merge(TracccMeasurementConverterAlgCfg(flags,
148 InputMeasurements="TracccMeasurementCollection",
149 InputClusters="TracccClusterCollection",
150 InputCells="TracccCellCollection",
151 ConvertClustersWithCells = flags.Tracking.doTruth,
152 OutputPixelSpacePoints="ITkPixelSpacePoints",
153 OutputPixelClusters="ITkPixelClusters",
154 OutputStripClusters="ITkStripClusters"
155 ))
156
157 from ActsConfig.ActsSpacePointFormationConfig import ActsStripSpacePointFormationAlgCfg
158 acc.merge(ActsStripSpacePointFormationAlgCfg(flags,
159 name=f"{flags.Tracking.ActiveConfig.extension}StripSpacePointFormationAlg",
160 StripClusters="ITkStripClusters",
161 StripSpacePoints="ITkStripSpacePoints",
162 StripOverlapSpacePoints="ITkStripOverlapSpacePoints"))
163
164 clustersLocation = DataLocation.HOST
165
166 # Truth (as configured in ITkActsDataPreparationCfg)
167 # this truth must only be done if you do PRD and SpacePointformation
168 # If you only do the latter (== running on ESD) then the needed input (simdata)
169 # is not in ESD but the resulting truth (clustertruth) is already there ...
170 if flags.Tracking.doTruth:
171 from ActsConfig.ActsTruthConfig import ActsTruthAssociationAlgCfg, ActsTruthParticleHitCountAlgCfg
172 acc.merge(ActsTruthAssociationAlgCfg(flags))
173 acc.merge(ActsTruthParticleHitCountAlgCfg(flags))
174
175 from ActsConfig.ActsSeedingConfig import ActsSeedingCfg
176 acc.merge(ActsSeedingCfg(flags))
177 seedsLocation = DataLocation.HOST
178
179
180 # --- Track Reconstruction ---
181 if flags.Acts.Device.doTrackReconstruction:
182
183 if clustersLocation is not DataLocation.DEVICE or seedsLocation is not DataLocation.DEVICE:
184 raise ValueError("Device track reconstruction requires device clusterization "
185 "(flags.Acts.Device.doClusterization=True) and device seeding "
186 "(flags.Acts.Device.doSeeding=True): it reads the traccc measurement "
187 "and seed collections straight out of device memory and there is "
188 "currently no host->device converter for these yet.")
189
190
191 from ActsGPUMagField.ActsGPUMagFieldConfig import JSONDeviceMagFieldProviderSvcCfg
192 acc.merge(JSONDeviceMagFieldProviderSvcCfg(flags,
193 DeviceMagFieldObjectName="TracccMagneticField",
194 HostMagFieldObjectName="TracccHostMagField",
195 ))
196
197 from ActsGPUPatternRecognition.ActsGPUPatternRecognitionConfig import DeviceTrkParamEstimationAlgCfg, DeviceTrackFindingAlgCfg
198 acc.merge(DeviceTrkParamEstimationAlgCfg(flags,
199 InputTracccSpacepoints="TracccPixelSpacepointCollection",
200 InputTracccMeasurements="TracccMeasurementCollection",
201 InputTracccSeeds="TracccPixelSeedCollection",
202 InputTracccMagField="TracccMagneticField",
203 OutputTracccTrackParameters="TracccTrackParameterCollection",
204 ))
205
206 acc.merge(DeviceTrackFindingAlgCfg(flags,
207 InputTracccMeasurements="TracccMeasurementCollection",
208 InputTracccMagField="TracccMagneticField",
209 InputTracccTrackParameters="TracccTrackParameterCollection",
210 InputTracccDetectorGeometry="TracccDeviceDetectorGeometry",
211 OutputTracccTracks="TracccTrackCollection",
212 ))
213
214 # The Triton backend returns the raw tracks to be converted by the client
215 if tritonMode is DeviceTritonMode.Server:
216 return acc
217
218 if clustersLocation is not DataLocation.DEVICE:
219 acc.merge(TracccMeasurementConverterAlgCfg(flags,
220 InputMeasurements="TracccMeasurementCollection",
221 InputClusters="TracccClusterCollection",
222 InputCells="TracccCellCollection",
223 ConvertClustersWithCells = flags.Tracking.doTruth,
224 OutputPixelClusters="ITkPixelClusters",
225 OutputPixelSpacePoints="ITkPixelSpacePoints",
226 OutputMeasToPixelSP="ITkTracccMeasToPixelSP",
227 OutputMeasToStripCl="ITkTracccMeasToStripCl",
228 OutputStripClusters="ITkStripClusters",
229 GeoIdMapping="TracccGeoIdMapping",
230 ))
231
232 from ActsGPUEventCnv.ActsGPUEventCnvConfig import TracccTrackConverterAlgCfg, TracccMeasurementConverterAlgCfg
233 if clustersLocation is DataLocation.DEVICE:
234 acc.merge(TracccMeasurementConverterAlgCfg(flags,
235 InputMeasurements="TracccMeasurementCollection",
236 InputClusters="TracccClusterCollection",
237 InputCells="TracccCellCollection",
238 ConvertClustersWithCells = flags.Tracking.doTruth,
239 OutputPixelClusters="ITkPixelClusters",
240 OutputPixelSpacePoints="ITkPixelSpacePoints",
241 OutputMeasToPixelSP="ITkTracccMeasToPixelSP",
242 OutputMeasToStripCl="ITkTracccMeasToStripCl",
243 OutputStripClusters="ITkStripClusters"
244 ))
245
246 # Strip clusters were just produced above, but nothing forms strip
247 # space points on the device path — mirror the host-side flow
248 if flags.Tracking.ActiveConfig.useITkStripSeeding or (flags.Acts.SpacePoints.doStrip and not flags.Tracking.ActiveConfig.isSecondaryPass):
249 from ActsConfig.ActsSpacePointFormationConfig import ActsStripSpacePointFormationAlgCfg
250 acc.merge(ActsStripSpacePointFormationAlgCfg(flags,
251 name=f"{flags.Tracking.ActiveConfig.extension}StripSpacePointFormationAlg",
252 StripClusters="ITkStripClusters",
253 StripSpacePoints="ITkStripSpacePoints",
254 StripOverlapSpacePoints="ITkStripOverlapSpacePoints"))
255
256 acc.merge(TracccTrackConverterAlgCfg(flags,
257 InputPixelClusters="ITkPixelClusters",
258 InputStripClusters="ITkStripClusters",
259 InputMeasToPixelSP="ITkTracccMeasToPixelSP",
260 InputMeasToStripCl="ITkTracccMeasToStripCl",
261 InputTracks="TracccTrackCollection",
262 OutputTracks=f"{flags.Tracking.ActiveConfig.extension}Tracks",
263 ))
264
265
266
267 else:
268
269 # If clusterization was on device, need to copy the measurements to host first
270 if clustersLocation is DataLocation.DEVICE:
271 from ActsGPUEventCnv.ActsGPUEventCnvConfig import TracccMeasurementConverterAlgCfg
272 acc.merge(TracccMeasurementConverterAlgCfg(flags,
273 InputMeasurements="TracccMeasurementCollection",
274 InputClusters="TracccClusterCollection",
275 InputCells="TracccCellCollection",
276 ConvertClustersWithCells = flags.Tracking.doTruth,
277 OutputPixelClusters="ITkPixelClusters",
278 OutputPixelSpacePoints="ITkPixelSpacePoints",
279 OutputMeasToPixelSP="ITkTracccMeasToPixelSP",
280 OutputMeasToStripCl="ITkTracccMeasToStripCl",
281 OutputStripClusters="ITkStripClusters"
282 ))
283 from ActsConfig.ActsSpacePointFormationConfig import ActsStripSpacePointFormationAlgCfg
284 acc.merge(ActsStripSpacePointFormationAlgCfg(flags,
285 name=f"{flags.Tracking.ActiveConfig.extension}StripSpacePointFormationAlg",
286 StripClusters="ITkStripClusters",
287 StripSpacePoints="ITkStripSpacePoints",
288 StripOverlapSpacePoints="ITkStripOverlapSpacePoints"))
289 clustersLocation = DataLocation.HOST
290
291 if seedsLocation is DataLocation.DEVICE:
292 from ActsGPUEventCnv.ActsGPUEventCnvConfig import TracccSeedConverterAlgCfg
293
294 acc.merge(TracccSeedConverterAlgCfg(flags,
295 name="TracccSeedConverterAlg",
296 InputSpacepointsDevice="TracccPixelSpacepointCollection",
297 InputSpacepoints="ITkPixelSpacePoints",
298 InputMeasToPixelSP="ITkTracccMeasToPixelSP",
299 InputSeeds="TracccPixelSeedCollection",
300 OutputSeeds=f'{flags.Tracking.ActiveConfig.extension}PixelSeeds'))
301 seedsLocation = DataLocation.HOST
302
303 # CKF
304 # default ACTS offline chain has strip seeding enabled,
305 # but the device path does not support strip seeding yet,
306 # throw exception if the user has enabled strip seeding
307
308 if flags.Tracking.ActiveConfig.useITkStripSeeding:
309 raise ValueError("Strip seeding is enabled in the configuration, but it is not supported on the device path. Turn it off using Tracking.ITkActsPass.useITkStripSeeding flag.")
310
311 from ActsConfig.ActsTrackFindingConfig import ActsTrackFindingCfg
312 acc.merge(ActsTrackFindingCfg(flags))
313
314 # Ambiguity Resolution
315 if flags.Acts.doAmbiguityResolution:
316 from ActsConfig.ActsTrackFindingConfig import ActsAmbiguityResolutionCfg
317 acc.merge(ActsAmbiguityResolutionCfg(flags))
318
319 acc.merge(ITkActsDeviceTrackRecoPostProcessingCfg(flags, previousExtension=previousExtension))
320 return acc
321
322

◆ ITkActsDeviceTrackRecoPostProcessingCfg()

ITkActsDeviceTrackRecoPostProcessingCfg ( flags,
* ,
previousExtension = None )
PRD association and truth for the tracks of the primary pass, once
they are converted back to the host.

Definition at line 323 of file ITkActsDeviceTrackRecoConfig.py.

323def ITkActsDeviceTrackRecoPostProcessingCfg(flags, *, previousExtension=None):
324 """PRD association and truth for the tracks of the primary pass, once
325 they are converted back to the host."""
326 acc = ComponentAccumulator()
327
328 # PRD association
329 from ActsConfig.ActsPrdAssociationConfig import ActsPrdAssociationAlgCfg
330 acc.merge(ActsPrdAssociationAlgCfg(flags,
331 name = f'{flags.Tracking.ActiveConfig.extension}PrdAssociationAlg',
332 previousActsExtension = previousExtension))
333
334 # Truth
335 if flags.Tracking.doTruth:
336
337 # schedule association of measurements to truth particles
338 from ActsConfig.ActsTruthConfig import ActsTruthAssociationAlgCfg, ActsTruthParticleHitCountAlgCfg
339 acc.merge(ActsTruthAssociationAlgCfg(flags))
340 acc.merge(ActsTruthParticleHitCountAlgCfg(flags))
341 if flags.Acts.doTruthInspection:
342 from ActsConfig.ActsInspectTruthContentConfig import ActsInspectTruthContentAlgCfg
343 acc.merge(ActsInspectTruthContentAlgCfg(flags))
344
345 # Run truth on CKF tracks
346 # This is only necessary if we are asking for these tracks to be persistified with the
347 # - flag: Tracking.ActiveConfig.storeSiSPSeededTracks set to True OR
348 # - flag: flags.Acts.doAmbiguityResolution set to False
349 if flags.Tracking.ActiveConfig.storeSiSPSeededTracks or not flags.Acts.doAmbiguityResolution:
350 from ActsConfig.ActsTruthConfig import ActsTrackToTruthAssociationAlgCfg, ActsTrackFindingValidationAlgCfg
351 acts_tracks = f"{flags.Tracking.ActiveConfig.extension}Tracks"
352 acc.merge(ActsTrackToTruthAssociationAlgCfg(flags,
353 name = f"{acts_tracks}TrackToTruthAssociationAlg",
354 ACTSTracksLocation = acts_tracks,
355 AssociationMapOut = f"{acts_tracks}ToTruthParticleAssociation"))
356
357 acc.merge(ActsTrackFindingValidationAlgCfg(flags,
358 name = f"{acts_tracks}TrackFindingValidationAlg",
359 TrackToTruthAssociationMap = f"{acts_tracks}ToTruthParticleAssociation"))
360
361 # Run truth on the tracks from ambiguity resolution. This is only necessary if
362 # - flag: flags.Acts.doAmbiguityResolution set to True
363 if flags.Acts.doAmbiguityResolution:
364 acts_tracks = f"{flags.Tracking.ActiveConfig.extension}ResolvedTracks"
365 from ActsConfig.ActsTruthConfig import ActsTrackToTruthAssociationAlgCfg, ActsTrackFindingValidationAlgCfg
366 acc.merge(ActsTrackToTruthAssociationAlgCfg(flags,
367 name = f"{acts_tracks}TrackToTruthAssociationAlg",
368 ACTSTracksLocation = acts_tracks,
369 AssociationMapOut = f"{acts_tracks}ToTruthParticleAssociation"))
370
371 acc.merge(ActsTrackFindingValidationAlgCfg(flags,
372 name = f"{acts_tracks}TrackFindingValidationAlg",
373 TrackToTruthAssociationMap = f"{acts_tracks}ToTruthParticleAssociation"))
374
375 # Extract track parameters from device seeds if requested
376 if flags.Tracking.ActiveConfig.storeTrackSeeds and flags.Acts.Device.doSeeding: # for clustering only pipelines this is controlled via the ActsSeedingConfig file
377 from ActsConfig.ActsSeedingConfig import ActsStoreTrackSeedsCfg
378 from ActsConfig.ActsAnalysisConfig import ActsPixelSeedsToTrackParamsAlgCfg, ActsStripSeedsToTrackParamsAlgCfg
379 processPixels = flags.Tracking.ActiveConfig.useITkPixelSeeding
380 processStrips = flags.Tracking.ActiveConfig.useITkStripSeeding
381
382 prefix = flags.Tracking.ActiveConfig.extension
383
384 if flags.Acts.Device.doTrackReconstruction:
385 from ActsGPUEventCnv.ActsGPUEventCnvConfig import TracccSeedConverterAlgCfg
386 acc.merge(TracccSeedConverterAlgCfg(flags,
387 name="TracccSeedConverterAlg",
388 InputSpacepointsDevice="TracccPixelSpacepointCollection",
389 InputSpacepoints="ITkPixelSpacePoints",
390 InputMeasToPixelSP="ITkTracccMeasToPixelSP",
391 InputSeeds="TracccPixelSeedCollection",
392 OutputSeeds=f'{flags.Tracking.ActiveConfig.extension}PixelSeeds'))
393
394 # Create track parameters before ActsStoreTrackSeedsCfg (following ActsSeedingCfg pattern)
395 if processPixels:
396 acc.merge(ActsPixelSeedsToTrackParamsAlgCfg(
397 flags,
398 name = prefix + 'PixelSeedsToTrackParamsAlg',
399 InputSeedContainerKey = prefix + 'PixelSeeds',
400 OutputTrackParamsCollectionKey = prefix + 'PixelEstimatedTrackParams'))
401 if processStrips:
402 acc.merge(ActsStripSeedsToTrackParamsAlgCfg(
403 flags,
404 name = prefix + 'StripSeedsToTrackParamsAlg',
405 InputSeedContainerKey = prefix + 'StripSeeds',
406 OutputTrackParamsCollectionKey = prefix + 'StripEstimatedTrackParams'))
407
408 if processPixels:
409 acc.merge(ActsStoreTrackSeedsCfg(flags,processPixels=True, processStrips=False))
410 if processStrips:
411 acc.merge(ActsStoreTrackSeedsCfg(flags,processPixels=False, processStrips=True))
412 if processPixels and processStrips:
413 acc.merge(ActsStoreTrackSeedsCfg(flags,processPixels=True, processStrips=True))
414
415 return acc
416
417