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

Classes

class  DataLocation

Functions

 ITkActsDeviceTrackRecoCfg (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 367 of file ITkActsDeviceTrackRecoConfig.py.

367def ITkActsDeviceSecondaryPassTrackRecoCfg(flags, *, previousExtension=None):
368 """Secondary tracking pass with data preparation on the host and
369 seeding and track finding on the device.
370
371 The clusters and space points of the pass are prepared on the host from
372 the objects of the previous pass (PRD association), converted to traccc
373 measurements and spacepoints, and the seeds and tracks are reconstructed
374 on the device. The tracks are converted back to an ACTS track container
375 named as for the host reconstruction of the pass.
376 """
377 acc = ComponentAccumulator()
378
379 if previousExtension is None:
380 raise ValueError("A secondary pass on the device requires a previous pass")
381
382 extension = flags.Tracking.ActiveConfig.extension
383 prefix = f"ITk{extension.replace('Acts', '')}"
384 pixelClusters = f"{prefix}PixelClusters"
385 stripClusters = f"{prefix}StripClusters"
386
387 if flags.Tracking.ActiveConfig.useITkPixelSeeding:
388 raise ValueError("Pixel seeding on the device is not supported for secondary passes")
389 if not flags.Tracking.ActiveConfig.useITkStripSeeding:
390 raise ValueError("Secondary pass on the device requires strip seeding")
391
392 print(f"Setting up GPU algorithms for the {extension} pass with {flags.Device.Backend.value} backend")
393
394 # Setup traccc detector description objects — loads all device detector description data into detStore
395 acc.merge(JSONDeviceDetectorDescriptionProviderSvcCfg(flags,
396 HostConditionsObjectName="TracccHostCondConfig",
397 HostDigitizationObjectName="TracccHostDigitizationConfig",
398 DeviceConditionsObjectName="TracccDeviceCondConfig",
399 DeviceDigitizationObjectName="TracccDeviceDigitizationConfig",
400 ))
401
402 from ActsGPUMagField.ActsGPUMagFieldConfig import JSONDeviceMagFieldProviderSvcCfg
403 acc.merge(JSONDeviceMagFieldProviderSvcCfg(flags,
404 DeviceMagFieldObjectName="TracccMagneticField",
405 HostMagFieldObjectName="TracccHostMagField",
406 ))
407
408 # --- Data preparation on the host ---
409 from InDetConfig.ITkActsDataPreparationConfig import ITkActsDataPreparationCfg
410 acc.merge(ITkActsDataPreparationCfg(flags, previousExtension=previousExtension))
411
412 # --- Conversion to traccc ---
413 measurements = f"Traccc{extension}MeasurementCollection"
414 measToPixelCluster = f"Traccc{extension}MeasToPixelCluster"
415 measToStripCluster = f"Traccc{extension}MeasToStripCluster"
416 stripSpacepoints = f"Traccc{extension}StripSpacepointCollection"
417
418 from ActsGPUEventCnv.ActsGPUEventCnvConfig import (
419 xAODToTracccMeasurementConverterAlgCfg,
420 xAODToTracccSpacePointConverterAlgCfg,
421 )
422 acc.merge(xAODToTracccMeasurementConverterAlgCfg(flags,
423 name=f"{extension}MeasurementConverterAlg",
424 InputPixelClusters=pixelClusters,
425 InputStripClusters=stripClusters,
426 OutputTracccMeasurements=measurements,
427 OutputMeasToPixelCluster=measToPixelCluster,
428 OutputMeasToStripCluster=measToStripCluster,
429 ))
430
431 stripSpacePoints = [f"{prefix}StripSpacePoints"]
432 if extension != "ActsConversion":
433 stripSpacePoints += [f"{prefix}StripOverlapSpacePoints"]
434 acc.merge(xAODToTracccSpacePointConverterAlgCfg(flags,
435 name=f"{extension}StripSpacePointConverterAlg",
436 InputSpacePoints=stripSpacePoints,
437 InputMeasToCluster=measToStripCluster,
438 OutputTracccSpacepoints=stripSpacepoints,
439 ))
440
441 # --- Seeding ---
442 seeds = f"Traccc{extension}StripSeedCollection"
443 from ActsGPUPatternRecognition.ActsGPUPatternRecognitionConfig import (
444 DeviceLargeRadiusStripTripletSeedingAlgCfg,
445 DeviceTrkParamEstimationAlgCfg,
446 DeviceLargeRadiusTrackFindingAlgCfg,
447 )
448 acc.merge(DeviceLargeRadiusStripTripletSeedingAlgCfg(flags,
449 name=f"{extension}DeviceStripTripletSeedingAlg",
450 InputTracccPixelSpacepoints=stripSpacepoints,
451 OutputTracccPixelSeeds=seeds,
452 ))
453
454 # --- Track Reconstruction ---
455 trackParameters = f"Traccc{extension}TrackParameterCollection"
456 tracccTracks = f"Traccc{extension}TrackCollection"
457 acc.merge(DeviceTrkParamEstimationAlgCfg(flags,
458 name=f"{extension}DeviceTrkParamEstimationAlg",
459 InputTracccSpacepoints=stripSpacepoints,
460 InputTracccMeasurements=measurements,
461 InputTracccSeeds=seeds,
462 InputTracccMagField="TracccMagneticField",
463 OutputTracccTrackParameters=trackParameters,
464 ))
465
466 acc.merge(DeviceLargeRadiusTrackFindingAlgCfg(flags,
467 name=f"{extension}DeviceTrackFindingAlg",
468 InputTracccMeasurements=measurements,
469 InputTracccMagField="TracccMagneticField",
470 InputTracccTrackParameters=trackParameters,
471 InputTracccDetectorGeometry="TracccDeviceDetectorGeometry",
472 OutputTracccTracks=tracccTracks,
473 ))
474
475 # The measurement to cluster maps hold the index of the cluster in its
476 # owning container, so the tracks are resolved against the primary pass
477 # cluster containers rather than the views of this pass
478 from ActsGPUEventCnv.ActsGPUEventCnvConfig import TracccTrackConverterAlgCfg
479 acc.merge(TracccTrackConverterAlgCfg(flags,
480 name=f"{extension}TracccTrackConverterAlg",
481 InputPixelClusters="ITkPixelClusters",
482 InputStripClusters="ITkStripClusters",
483 InputMeasToPixelSP=measToPixelCluster,
484 InputMeasToStripCl=measToStripCluster,
485 InputTracks=tracccTracks,
486 OutputTracks=f"{extension}Tracks",
487 GeoIdMapping="TracccGeometryIdMapping",
488 HostDetectorName="TracccHostDetectorGeometry",
489 ))
490
491 # Ambiguity Resolution
492 if flags.Acts.doAmbiguityResolution:
493 from ActsConfig.ActsTrackFindingConfig import ActsAmbiguityResolutionCfg
494 acc.merge(ActsAmbiguityResolutionCfg(flags))
495
496 # PRD association
497 from ActsConfig.ActsPrdAssociationConfig import ActsPrdAssociationAlgCfg
498 acc.merge(ActsPrdAssociationAlgCfg(flags,
499 name = f'{extension}PrdAssociationAlg',
500 previousActsExtension = previousExtension))
501
502 # Truth
503 if flags.Tracking.doTruth:
504 from ActsConfig.ActsTruthConfig import ActsTrackToTruthAssociationAlgCfg, ActsTrackFindingValidationAlgCfg
505 if flags.Tracking.ActiveConfig.storeSiSPSeededTracks or not flags.Acts.doAmbiguityResolution:
506 acts_tracks = f"{extension}Tracks"
507 acc.merge(ActsTrackToTruthAssociationAlgCfg(flags,
508 name = f"{acts_tracks}TrackToTruthAssociationAlg",
509 ACTSTracksLocation = acts_tracks,
510 AssociationMapOut = f"{acts_tracks}ToTruthParticleAssociation"))
511 acc.merge(ActsTrackFindingValidationAlgCfg(flags,
512 name = f"{acts_tracks}TrackFindingValidationAlg",
513 TrackToTruthAssociationMap = f"{acts_tracks}ToTruthParticleAssociation"))
514
515 if flags.Acts.doAmbiguityResolution:
516 acts_tracks = f"{extension}ResolvedTracks"
517 acc.merge(ActsTrackToTruthAssociationAlgCfg(flags,
518 name = f"{acts_tracks}TrackToTruthAssociationAlg",
519 ACTSTracksLocation = acts_tracks,
520 AssociationMapOut = f"{acts_tracks}ToTruthParticleAssociation"))
521 acc.merge(ActsTrackFindingValidationAlgCfg(flags,
522 name = f"{acts_tracks}TrackFindingValidationAlg",
523 TrackToTruthAssociationMap = f"{acts_tracks}ToTruthParticleAssociation"))
524
525 return acc
void print(char *figname, TCanvas *c1)

◆ ITkActsDeviceTrackRecoCfg()

ITkActsDeviceTrackRecoCfg ( flags,
* ,
previousExtension = None )

Definition at line 11 of file ITkActsDeviceTrackRecoConfig.py.

11def ITkActsDeviceTrackRecoCfg(flags, *, previousExtension=None):
12 acc = ComponentAccumulator()
13
14 # Bring up shared device infrastructure once, upfront
15 print(f"Setting up GPU algorithms with {flags.Device.Backend.value} backend")
16
17 # Setup traccc detector description objects — loads all device detector description data into detStore
18 acc.merge(JSONDeviceDetectorDescriptionProviderSvcCfg(flags,
19 HostConditionsObjectName="TracccHostCondConfig",
20 HostDigitizationObjectName="TracccHostDigitizationConfig",
21 DeviceConditionsObjectName="TracccDeviceCondConfig",
22 DeviceDigitizationObjectName="TracccDeviceDigitizationConfig",
23 ))
24
25 # --- Clusterization ---
26 if flags.Acts.Device.doClusterization:
27
28 #TODO: remove this once MC is fixed
29 if not flags.Tracking.doPixelDigitalClustering:
30 raise ValueError("clusterization on device is not compatible "
31 "with analog clustering at the moment due to incorrent "
32 "ToT values for Pixel hits in the simulation data.")
33
34 # Create RoI for secondary passes (e.g. LargeD0) to reuse
35 from ActsConfig.ActsRegionsOfInterestConfig import ActsRegionsOfInterestCreatorAlgCfg
36 acc.merge(ActsRegionsOfInterestCreatorAlgCfg(flags,
37 name=f"{flags.Tracking.ActiveConfig.extension}RegionsOfInterestCreatorAlg"))
38
39 print("Performing clusterization on device")
40
41 # setup RDO converter
42 if flags.Acts.EDM.PhaseII :
43 from ActsConfig.ActsPhaseIIRawDataEdmConfig import (
44 PhaseIIPixelRawDataContainerCfg,
45 PhaseIIStripRawDataContainerCfg,
46 )
47 acc.merge(PhaseIIPixelRawDataContainerCfg(flags))
48 acc.merge(PhaseIIStripRawDataContainerCfg(flags))
49 from ActsGPUEventCnv.ActsGPUEventCnvConfig import PhaseIIRDOtoTracccCellConverterAlgCfg
50 acc.merge(PhaseIIRDOtoTracccCellConverterAlgCfg(flags,
51 TracccCells = "TracccCellCollection",
52 ))
53 else:
54 from ActsGPUEventCnv.ActsGPUEventCnvConfig import RDOtoTracccCellConverterAlgCfg
55 acc.merge(RDOtoTracccCellConverterAlgCfg(flags,
56 TracccCells = "TracccCellCollection",
57 ))
58
59 # setup traccc clusterization
60 from ActsGPUDataPreparation.ActsGPUDataPreparationConfig import DeviceClusterizationAlgCfg
61 acc.merge(DeviceClusterizationAlgCfg(flags,
62 InputTracccCells="TracccCellCollection",
63 OutputTracccMeasurements="TracccMeasurementCollection",
64 OutputTracccClusters="TracccClusterCollection",
65 RetrieveClusterCells=flags.Tracking.doTruth,
66 previousExtension=previousExtension))
67 clustersLocation = DataLocation.DEVICE
68
69 else:
70 from InDetConfig.ITkActsDataPreparationConfig import ITkActsDataPreparationCfg
71 acc.merge(ITkActsDataPreparationCfg(flags, previousExtension=previousExtension))
72 clustersLocation = DataLocation.HOST
73
74 # --- Seeding ---
75 if flags.Acts.Device.doSeeding:
76
77 if clustersLocation is not DataLocation.DEVICE:
78 raise ValueError("Device seeding requires device clusterization "
79 "(flags.Acts.Device.doClusterization=True): it reads the "
80 "traccc measurement collection straight out of device memory "
81 "and there is currently no host->device measurement converter.")
82
83 # Pixel space point formation on device
84 from ActsGPUDataPreparation.ActsGPUDataPreparationConfig import DeviceSPFormationAlgCfg
85 acc.merge(DeviceSPFormationAlgCfg(flags,
86 name="DeviceSPFormationAlg",
87 InputTracccMeasurements="TracccMeasurementCollection",
88 OutputTracccPixelSpacepoints="TracccPixelSpacepointCollection"))
89
90 from ActsConfig.ActsConfigFlags import SeedingStrategy
91
92 print(f"Performing seeding on device with seeding strategy set to {flags.Acts.Device.seedingStrategy}")
93 if flags.Acts.Device.seedingStrategy in [SeedingStrategy.Gbts, SeedingStrategy.GbtsFtf]:
94 from ActsGPUPatternRecognition.ActsGPUPatternRecognitionConfig import DeviceGBTSSeedingAlgCfg
95 acc.merge(DeviceGBTSSeedingAlgCfg(flags,
96 name="DeviceGBTSSeedingAlg",
97 InputTracccPixelSpacepoints="TracccPixelSpacepointCollection",
98 InputTracccMeasurements="TracccMeasurementCollection",
99 OutputTracccPixelSeeds="TracccPixelSeedCollection"))
100 else:
101 from ActsGPUPatternRecognition.ActsGPUPatternRecognitionConfig import DeviceTripletSeedingAlgCfg
102 acc.merge(DeviceTripletSeedingAlgCfg(flags,
103 name="DeviceTripletSeedingAlg",
104 InputTracccPixelSpacepoints="TracccPixelSpacepointCollection",
105 OutputTracccPixelSeeds="TracccPixelSeedCollection"))
106
107 seedsLocation = DataLocation.DEVICE
108
109 else:
110
111 # If clusterization was on device, need to copy them to host first
112 # and schedule space point formation
113 if clustersLocation is DataLocation.DEVICE:
114 from ActsGPUEventCnv.ActsGPUEventCnvConfig import TracccMeasurementConverterAlgCfg
115 acc.merge(TracccMeasurementConverterAlgCfg(flags,
116 InputMeasurements="TracccMeasurementCollection",
117 InputClusters="TracccClusterCollection",
118 InputCells="TracccCellCollection",
119 ConvertClustersWithCells = flags.Tracking.doTruth,
120 OutputPixelSpacePoints="ITkPixelSpacePoints",
121 OutputPixelClusters="ITkPixelClusters",
122 OutputStripClusters="ITkStripClusters"
123 ))
124
125 from ActsConfig.ActsSpacePointFormationConfig import ActsStripSpacePointFormationAlgCfg
126 acc.merge(ActsStripSpacePointFormationAlgCfg(flags,
127 name=f"{flags.Tracking.ActiveConfig.extension}StripSpacePointFormationAlg",
128 StripClusters="ITkStripClusters",
129 StripSpacePoints="ITkStripSpacePoints",
130 StripOverlapSpacePoints="ITkStripOverlapSpacePoints"))
131
132 clustersLocation = DataLocation.HOST
133
134 # Truth (as configured in ITkActsDataPreparationCfg)
135 # this truth must only be done if you do PRD and SpacePointformation
136 # If you only do the latter (== running on ESD) then the needed input (simdata)
137 # is not in ESD but the resulting truth (clustertruth) is already there ...
138 if flags.Tracking.doTruth:
139 from ActsConfig.ActsTruthConfig import ActsTruthAssociationAlgCfg, ActsTruthParticleHitCountAlgCfg
140 acc.merge(ActsTruthAssociationAlgCfg(flags))
141 acc.merge(ActsTruthParticleHitCountAlgCfg(flags))
142
143 from ActsConfig.ActsSeedingConfig import ActsSeedingCfg
144 acc.merge(ActsSeedingCfg(flags))
145 seedsLocation = DataLocation.HOST
146
147
148 # --- Track Reconstruction ---
149 if flags.Acts.Device.doTrackReconstruction:
150
151 if clustersLocation is not DataLocation.DEVICE or seedsLocation is not DataLocation.DEVICE:
152 raise ValueError("Device track reconstruction requires device clusterization "
153 "(flags.Acts.Device.doClusterization=True) and device seeding "
154 "(flags.Acts.Device.doSeeding=True): it reads the traccc measurement "
155 "and seed collections straight out of device memory and there is "
156 "currently no host->device converter for these yet.")
157
158
159 from ActsGPUMagField.ActsGPUMagFieldConfig import JSONDeviceMagFieldProviderSvcCfg
160 acc.merge(JSONDeviceMagFieldProviderSvcCfg(flags,
161 DeviceMagFieldObjectName="TracccMagneticField",
162 HostMagFieldObjectName="TracccHostMagField",
163 ))
164
165 from ActsGPUPatternRecognition.ActsGPUPatternRecognitionConfig import DeviceTrkParamEstimationAlgCfg, DeviceTrackFindingAlgCfg
166 acc.merge(DeviceTrkParamEstimationAlgCfg(flags,
167 InputTracccSpacepoints="TracccPixelSpacepointCollection",
168 InputTracccMeasurements="TracccMeasurementCollection",
169 InputTracccSeeds="TracccPixelSeedCollection",
170 InputTracccMagField="TracccMagneticField",
171 OutputTracccTrackParameters="TracccTrackParameterCollection",
172 ))
173
174 acc.merge(DeviceTrackFindingAlgCfg(flags,
175 InputTracccMeasurements="TracccMeasurementCollection",
176 InputTracccMagField="TracccMagneticField",
177 InputTracccTrackParameters="TracccTrackParameterCollection",
178 InputTracccDetectorGeometry="TracccDeviceDetectorGeometry",
179 OutputTracccTracks="TracccTrackCollection",
180 ))
181
182 if clustersLocation is not DataLocation.DEVICE:
183 acc.merge(TracccMeasurementConverterAlgCfg(flags,
184 InputMeasurements="TracccMeasurementCollection",
185 InputClusters="TracccClusterCollection",
186 InputCells="TracccCellCollection",
187 ConvertClustersWithCells = flags.Tracking.doTruth,
188 OutputPixelClusters="ITkPixelClusters",
189 OutputPixelSpacePoints="ITkPixelSpacePoints",
190 OutputMeasToPixelSP="ITkTracccMeasToPixelSP",
191 OutputMeasToStripCl="ITkTracccMeasToStripCl",
192 OutputStripClusters="ITkStripClusters",
193 GeoIdMapping="TracccGeoIdMapping",
194 ))
195
196 from ActsGPUEventCnv.ActsGPUEventCnvConfig import TracccTrackConverterAlgCfg, TracccMeasurementConverterAlgCfg
197 if clustersLocation is DataLocation.DEVICE:
198 acc.merge(TracccMeasurementConverterAlgCfg(flags,
199 InputMeasurements="TracccMeasurementCollection",
200 InputClusters="TracccClusterCollection",
201 InputCells="TracccCellCollection",
202 ConvertClustersWithCells = flags.Tracking.doTruth,
203 OutputPixelClusters="ITkPixelClusters",
204 OutputPixelSpacePoints="ITkPixelSpacePoints",
205 OutputMeasToPixelSP="ITkTracccMeasToPixelSP",
206 OutputMeasToStripCl="ITkTracccMeasToStripCl",
207 OutputStripClusters="ITkStripClusters"
208 ))
209
210 # Strip clusters were just produced above, but nothing forms strip
211 # space points on the device path — mirror the host-side flow
212 if flags.Tracking.ActiveConfig.useITkStripSeeding or (flags.Acts.SpacePoints.doStrip and not flags.Tracking.ActiveConfig.isSecondaryPass):
213 from ActsConfig.ActsSpacePointFormationConfig import ActsStripSpacePointFormationAlgCfg
214 acc.merge(ActsStripSpacePointFormationAlgCfg(flags,
215 name=f"{flags.Tracking.ActiveConfig.extension}StripSpacePointFormationAlg",
216 StripClusters="ITkStripClusters",
217 StripSpacePoints="ITkStripSpacePoints",
218 StripOverlapSpacePoints="ITkStripOverlapSpacePoints"))
219
220 acc.merge(TracccTrackConverterAlgCfg(flags,
221 InputPixelClusters="ITkPixelClusters",
222 InputStripClusters="ITkStripClusters",
223 InputMeasToPixelSP="ITkTracccMeasToPixelSP",
224 InputMeasToStripCl="ITkTracccMeasToStripCl",
225 InputTracks="TracccTrackCollection",
226 OutputTracks=f"{flags.Tracking.ActiveConfig.extension}Tracks",
227 ))
228
229
230
231 else:
232
233 # If clusterization was on device, need to copy the measurements to host first
234 if clustersLocation is DataLocation.DEVICE:
235 from ActsGPUEventCnv.ActsGPUEventCnvConfig import TracccMeasurementConverterAlgCfg
236 acc.merge(TracccMeasurementConverterAlgCfg(flags,
237 InputMeasurements="TracccMeasurementCollection",
238 InputClusters="TracccClusterCollection",
239 InputCells="TracccCellCollection",
240 ConvertClustersWithCells = flags.Tracking.doTruth,
241 OutputPixelClusters="ITkPixelClusters",
242 OutputPixelSpacePoints="ITkPixelSpacePoints",
243 OutputMeasToPixelSP="ITkTracccMeasToPixelSP",
244 OutputMeasToStripCl="ITkTracccMeasToStripCl",
245 OutputStripClusters="ITkStripClusters"
246 ))
247 from ActsConfig.ActsSpacePointFormationConfig import ActsStripSpacePointFormationAlgCfg
248 acc.merge(ActsStripSpacePointFormationAlgCfg(flags,
249 name=f"{flags.Tracking.ActiveConfig.extension}StripSpacePointFormationAlg",
250 StripClusters="ITkStripClusters",
251 StripSpacePoints="ITkStripSpacePoints",
252 StripOverlapSpacePoints="ITkStripOverlapSpacePoints"))
253 clustersLocation = DataLocation.HOST
254
255 if seedsLocation is DataLocation.DEVICE:
256 from ActsGPUEventCnv.ActsGPUEventCnvConfig import TracccSeedConverterAlgCfg
257
258 acc.merge(TracccSeedConverterAlgCfg(flags,
259 name="TracccSeedConverterAlg",
260 InputSpacepointsDevice="TracccPixelSpacepointCollection",
261 InputSpacepoints="ITkPixelSpacePoints",
262 InputMeasToPixelSP="ITkTracccMeasToPixelSP",
263 InputSeeds="TracccPixelSeedCollection",
264 OutputSeeds=f'{flags.Tracking.ActiveConfig.extension}PixelSeeds'))
265 seedsLocation = DataLocation.HOST
266
267 # CKF
268 from ActsConfig.ActsTrackFindingConfig import ActsTrackFindingCfg
269 acc.merge(ActsTrackFindingCfg(flags))
270
271 # Ambiguity Resolution
272 if flags.Acts.doAmbiguityResolution:
273 from ActsConfig.ActsTrackFindingConfig import ActsAmbiguityResolutionCfg
274 acc.merge(ActsAmbiguityResolutionCfg(flags))
275
276
277 # PRD association
278 from ActsConfig.ActsPrdAssociationConfig import ActsPrdAssociationAlgCfg
279 acc.merge(ActsPrdAssociationAlgCfg(flags,
280 name = f'{flags.Tracking.ActiveConfig.extension}PrdAssociationAlg',
281 previousActsExtension = previousExtension))
282
283 # Truth
284 if flags.Tracking.doTruth:
285
286 # schedule association of measurements to truth particles
287 from ActsConfig.ActsTruthConfig import ActsTruthAssociationAlgCfg, ActsTruthParticleHitCountAlgCfg
288 acc.merge(ActsTruthAssociationAlgCfg(flags))
289 acc.merge(ActsTruthParticleHitCountAlgCfg(flags))
290 if flags.Acts.doTruthInspection:
291 from ActsConfig.ActsInspectTruthContentConfig import ActsInspectTruthContentAlgCfg
292 acc.merge(ActsInspectTruthContentAlgCfg(flags))
293
294 # Run truth on CKF tracks
295 # This is only necessary if we are asking for these tracks to be persistified with the
296 # - flag: Tracking.ActiveConfig.storeSiSPSeededTracks set to True OR
297 # - flag: flags.Acts.doAmbiguityResolution set to False
298 if flags.Tracking.ActiveConfig.storeSiSPSeededTracks or not flags.Acts.doAmbiguityResolution:
299 from ActsConfig.ActsTruthConfig import ActsTrackToTruthAssociationAlgCfg, ActsTrackFindingValidationAlgCfg
300 acts_tracks = f"{flags.Tracking.ActiveConfig.extension}Tracks"
301 acc.merge(ActsTrackToTruthAssociationAlgCfg(flags,
302 name = f"{acts_tracks}TrackToTruthAssociationAlg",
303 ACTSTracksLocation = acts_tracks,
304 AssociationMapOut = f"{acts_tracks}ToTruthParticleAssociation"))
305
306 acc.merge(ActsTrackFindingValidationAlgCfg(flags,
307 name = f"{acts_tracks}TrackFindingValidationAlg",
308 TrackToTruthAssociationMap = f"{acts_tracks}ToTruthParticleAssociation"))
309
310 # Run truth on the tracks from ambiguity resolution. This is only necessary if
311 # - flag: flags.Acts.doAmbiguityResolution set to True
312 if flags.Acts.doAmbiguityResolution:
313 acts_tracks = f"{flags.Tracking.ActiveConfig.extension}ResolvedTracks"
314 from ActsConfig.ActsTruthConfig import ActsTrackToTruthAssociationAlgCfg, ActsTrackFindingValidationAlgCfg
315 acc.merge(ActsTrackToTruthAssociationAlgCfg(flags,
316 name = f"{acts_tracks}TrackToTruthAssociationAlg",
317 ACTSTracksLocation = acts_tracks,
318 AssociationMapOut = f"{acts_tracks}ToTruthParticleAssociation"))
319
320 acc.merge(ActsTrackFindingValidationAlgCfg(flags,
321 name = f"{acts_tracks}TrackFindingValidationAlg",
322 TrackToTruthAssociationMap = f"{acts_tracks}ToTruthParticleAssociation"))
323
324 # Extract track parameters from device seeds if requested
325 if flags.Tracking.ActiveConfig.storeTrackSeeds and flags.Acts.Device.doSeeding: # for clustering only pipelines this is controlled via the ActsSeedingConfig file
326 from ActsConfig.ActsSeedingConfig import ActsStoreTrackSeedsCfg
327 from ActsConfig.ActsAnalysisConfig import ActsPixelSeedsToTrackParamsAlgCfg, ActsStripSeedsToTrackParamsAlgCfg
328 processPixels = flags.Tracking.ActiveConfig.useITkPixelSeeding
329 processStrips = flags.Tracking.ActiveConfig.useITkStripSeeding
330
331 prefix = flags.Tracking.ActiveConfig.extension
332
333 if flags.Acts.Device.doTrackReconstruction:
334 from ActsGPUEventCnv.ActsGPUEventCnvConfig import TracccSeedConverterAlgCfg
335 acc.merge(TracccSeedConverterAlgCfg(flags,
336 name="TracccSeedConverterAlg",
337 InputSpacepointsDevice="TracccPixelSpacepointCollection",
338 InputSpacepoints="ITkPixelSpacePoints",
339 InputMeasToPixelSP="ITkTracccMeasToPixelSP",
340 InputSeeds="TracccPixelSeedCollection",
341 OutputSeeds=f'{flags.Tracking.ActiveConfig.extension}PixelSeeds'))
342
343 # Create track parameters before ActsStoreTrackSeedsCfg (following ActsSeedingCfg pattern)
344 if processPixels:
345 acc.merge(ActsPixelSeedsToTrackParamsAlgCfg(
346 flags,
347 name = prefix + 'PixelSeedsToTrackParamsAlg',
348 InputSeedContainerKey = prefix + 'PixelSeeds',
349 OutputTrackParamsCollectionKey = prefix + 'PixelEstimatedTrackParams'))
350 if processStrips:
351 acc.merge(ActsStripSeedsToTrackParamsAlgCfg(
352 flags,
353 name = prefix + 'StripSeedsToTrackParamsAlg',
354 InputSeedContainerKey = prefix + 'StripSeeds',
355 OutputTrackParamsCollectionKey = prefix + 'StripEstimatedTrackParams'))
356
357 if processPixels:
358 acc.merge(ActsStoreTrackSeedsCfg(flags,processPixels=True, processStrips=False))
359 if processStrips:
360 acc.merge(ActsStoreTrackSeedsCfg(flags,processPixels=False, processStrips=True))
361 if processPixels and processStrips:
362 acc.merge(ActsStoreTrackSeedsCfg(flags,processPixels=True, processStrips=True))
363
364 return acc
365
366