ATLAS Offline Software
Loading...
Searching...
No Matches
TracccTritonClientConfig.py
Go to the documentation of this file.
2# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3#
4from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5from AthenaConfiguration.ComponentFactory import CompFactory
6
7def TracccTritonToolCfg(flags, name="TracccTritonTool", **kwargs):
8 """Set up a TracccTritonTool tool and return"""
9
10 from AthTritonComps.TritonToolConfig import TritonToolCfg
11
12 acc = ComponentAccumulator()
13
14 kwargs.setdefault("TritonTool", acc.popToolsAndMerge(
15 TritonToolCfg(flags, flags.Tracking.Traccc.Triton.model,
16 url=flags.Tracking.Traccc.Triton.url,
17 port=flags.Tracking.Traccc.Triton.port,
18 ssl=(flags.Tracking.Traccc.Triton.port == 443))))
19
20 acc.setPrivateTools(CompFactory.TracccTritonTool(name, **kwargs))
21 return acc
22
23
24def TritonTracccTrackMakerCfg(flags, name="TritonTracccTrackMaker", **kwargs):
25 """Set up traccc-as-a-service tracking: the cells of each event are sent
26 to the server, and the traccc collections it returns are converted with
27 the same algorithms as the local device chain.
28
29 Scheduled by ITkActsDeviceTrackRecoCfg for the primary pass with
30 flags.Acts.Device.tritonMode = DeviceTritonMode.Client, which also adds
31 the PRD association and truth"""
32 acc = ComponentAccumulator()
33
34 # Keys of the traccc collections returned by the server
35 cells_key = "TracccCells"
36 measurements_key = "TracccTritonMeasurements"
37 clusters_key = "TracccTritonClusters"
38 traccc_tracks_key = "TracccTritonTracks"
39
40 # Create RoI for secondary passes (e.g. LargeD0) to reuse
41 from ActsConfig.ActsRegionsOfInterestConfig import ActsRegionsOfInterestCreatorAlgCfg
42 acc.merge(ActsRegionsOfInterestCreatorAlgCfg(flags,
43 name=f"{flags.Tracking.ActiveConfig.extension}RegionsOfInterestCreatorAlg"))
44
45 # All traccc collections on the client live in host memory
46 from AthDeviceComps.AthDeviceCompsConfig import HostCopyToolCfg, HostMemoryResourceToolCfg
47
48 # Convert the Pixel/Strip RDOs into traccc cells
49 from ActsGPUEventCnv.ActsGPUEventCnvConfig import RDOtoTracccCellConverterAlgCfg
50 copies_tool = CompFactory.AthDevice.CopiesAdaptorTool(
51 "TracccCellsHostCopiesTool",
52 HostCopyTool=acc.popToolsAndMerge(HostCopyToolCfg(flags)),
53 DeviceCopyTool=acc.popToolsAndMerge(HostCopyToolCfg(flags)))
54 acc.merge(RDOtoTracccCellConverterAlgCfg(flags,
55 HostMR=acc.popToolsAndMerge(HostMemoryResourceToolCfg(flags)),
56 DeviceMR=acc.popToolsAndMerge(HostMemoryResourceToolCfg(flags)),
57 CopiesTool=copies_tool,
58 TracccCells=cells_key))
59
60 # Send the cells to the server, record what it returns
61 kwargs.setdefault("TracccTritonTool", acc.popToolsAndMerge(TracccTritonToolCfg(flags)))
62 kwargs.setdefault("HostMR", acc.popToolsAndMerge(HostMemoryResourceToolCfg(flags)))
63 kwargs.setdefault("TracccCells", cells_key)
64 kwargs.setdefault("OutputTracccMeasurements", measurements_key)
65 kwargs.setdefault("OutputTracccClusters", clusters_key)
66 kwargs.setdefault("OutputTracccTracks", traccc_tracks_key)
67 acc.addEventAlgo(CompFactory.TritonTracccTrackMaker(name, **kwargs))
68
69 # From here on, exactly as in the local device chain
70 from ActsGPUEventCnv.ActsGPUEventCnvConfig import (
71 TracccMeasurementConverterAlgCfg,
72 TracccTrackConverterAlgCfg,
73 )
74 acc.merge(TracccMeasurementConverterAlgCfg(flags,
75 HostMR=acc.popToolsAndMerge(HostMemoryResourceToolCfg(flags)),
76 CopyProviderTool=acc.popToolsAndMerge(HostCopyToolCfg(flags)),
77 InputMeasurements=measurements_key,
78 InputClusters=clusters_key,
79 InputCells=cells_key,
80 ConvertClustersWithCells=flags.Tracking.doTruth,
81 OutputPixelClusters="ITkPixelClusters",
82 OutputPixelSpacePoints="ITkPixelSpacePoints",
83 OutputMeasToPixelSP="ITkTracccMeasToPixelSP",
84 OutputMeasToStripCl="ITkTracccMeasToStripCl",
85 OutputStripClusters="ITkStripClusters",
86 ))
87
88 if flags.Tracking.ActiveConfig.useITkStripSeeding or (flags.Acts.SpacePoints.doStrip and not flags.Tracking.ActiveConfig.isSecondaryPass):
89 from ActsConfig.ActsSpacePointFormationConfig import ActsStripSpacePointFormationAlgCfg
90 acc.merge(ActsStripSpacePointFormationAlgCfg(flags,
91 name=f"{flags.Tracking.ActiveConfig.extension}StripSpacePointFormationAlg",
92 StripClusters="ITkStripClusters",
93 StripSpacePoints="ITkStripSpacePoints",
94 StripOverlapSpacePoints="ITkStripOverlapSpacePoints"))
95
96 acc.merge(TracccTrackConverterAlgCfg(flags,
97 HostMR=acc.popToolsAndMerge(HostMemoryResourceToolCfg(flags)),
98 CopyProviderTool=acc.popToolsAndMerge(HostCopyToolCfg(flags)),
99 InputPixelClusters="ITkPixelClusters",
100 InputStripClusters="ITkStripClusters",
101 InputMeasToPixelSP="ITkTracccMeasToPixelSP",
102 InputMeasToStripCl="ITkTracccMeasToStripCl",
103 InputTracks=traccc_tracks_key,
104 OutputTracks=f"{flags.Tracking.ActiveConfig.extension}Tracks",
105 ))
106
107 return acc
TritonTracccTrackMakerCfg(flags, name="TritonTracccTrackMaker", **kwargs)
TracccTritonToolCfg(flags, name="TracccTritonTool", **kwargs)