ATLAS Offline Software
Loading...
Searching...
No Matches
TracccTritonBackendConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2"""
3Configuration for the device (GPU) reconstruction chain used by the Traccc
4Triton backend.
5"""
6
7from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8from AthenaConfiguration.ComponentFactory import CompFactory
9
10# Name of the AthSequencer that holds the per-request device chain
11DEFAULT_SEQUENCE_NAME = "TracccDeviceRecoSeq"
12
13# The store keys the C++ side has to name for itself
14STOREGATE_KEYS = {
15 "cells": "TracccTritonCells",
16 "measurements": "TracccTritonMeasurements",
17 "clusters": "TracccTritonClusters",
18 "tracks": "TracccTritonTracks",
19}
20
21
23 sequenceName: str = DEFAULT_SEQUENCE_NAME
24 ) -> ComponentAccumulator:
25 """Set up the GPU chain that the Triton backend drives per request.
26
27 @param sequenceName name of the AthSequencer the device algorithms are
28 scheduled in; the Runner looks this up and executes it.
29 """
30
31 acc = ComponentAccumulator()
32
33 cellsKey = STOREGATE_KEYS["cells"]
34 measKey = STOREGATE_KEYS["measurements"]
35 clustersKey = STOREGATE_KEYS["clusters"]
36 tracksKey = STOREGATE_KEYS["tracks"]
37
38 # Intermediate products, passed algorithm to algorithm inside the
39 # sequence. Nothing outside this function ever names them.
40 spKey = "TracccTritonSpacepoints"
41 seedsKey = "TracccTritonSeeds"
42 trkParamsKey = "TracccTritonTrackParameters"
43
44 # ---- DetectorStore object names (device geometry + magnetic field) ----
45 deviceGeometry = "TracccDeviceDetectorGeometry"
46 deviceMagField = "TracccDeviceMagField"
47
48 # Device detector description (geometry + digitization + athena<->detray
49 # id map) built from the ACTS Gen3 tracking geometry by a service, plus
50 # the conditions part built per IOV by a conditions algorithm
51 from ActsGPUGeometry.ActsGPUGeometryConfig import (
52 DeviceDetectorDescriptionCondAlgCfg,
53 )
54 acc.merge(DeviceDetectorDescriptionCondAlgCfg(
55 flags,
56 HostConditionsObjectName="TracccHostCondConfig",
57 HostDigitizationObjectName="TracccHostDigitizationConfig",
58 DeviceConditionsObjectName="TracccDeviceCondConfig",
59 DeviceDigitizationObjectName="TracccDeviceDigitizationConfig",
60 DeviceDetectorName=deviceGeometry,
61 ))
62
63 # Device magnetic field, needed by track parameter estimation and by the
64 # track finder's propagator.
65 from ActsGPUMagField.ActsGPUMagFieldConfig import (
66 JSONDeviceMagFieldProviderSvcCfg,
67 )
68 acc.merge(JSONDeviceMagFieldProviderSvcCfg(
69 flags,
70 DeviceMagFieldObjectName=deviceMagField,
71 HostMagFieldObjectName="TracccHostMagField",
72 ))
73
74 # Everything merged into this sequence below is what the Runner executes
75 acc.addSequence(CompFactory.AthSequencer(
76 sequenceName,
77 Sequential=True,
78 IgnoreFilterPassed=True,
79 StopOverride=True,
80 ))
81
82 # ---- Clusterization: cells -> measurements ----
83 from ActsGPUDataPreparation.ActsGPUDataPreparationConfig import (
84 DeviceClusterizationAlgCfg,
85 )
86 acc.merge(DeviceClusterizationAlgCfg(
87 flags,
88 InputTracccCells=cellsKey,
89 OutputTracccMeasurements=measKey,
90 OutputTracccClusters=clustersKey,
91 RetrieveClusterCells=True,
92 ), sequenceName=sequenceName)
93
94 # ---- Spacepoint formation: measurements -> spacepoints ----
95 from ActsGPUDataPreparation.ActsGPUDataPreparationConfig import (
96 DeviceSPFormationAlgCfg,
97 )
98 acc.merge(DeviceSPFormationAlgCfg(
99 flags,
100 name="DeviceSPFormationAlg",
101 InputTracccMeasurements=measKey,
102 OutputTracccPixelSpacepoints=spKey,
103 ), sequenceName=sequenceName)
104
105 # ---- Seeding: spacepoints -> seeds ----
106 from ActsConfig.ActsConfigFlags import SeedingStrategy
107 from ActsGPUPatternRecognition.ActsGPUPatternRecognitionConfig import (
108 DeviceGBTSSeedingAlgCfg,
109 DeviceTripletSeedingAlgCfg,
110 DeviceTrkParamEstimationAlgCfg,
111 DeviceTrackFindingAlgCfg,
112 )
113 if flags.Acts.Device.seedingStrategy in (SeedingStrategy.Gbts,
114 SeedingStrategy.GbtsFtf):
115 acc.merge(DeviceGBTSSeedingAlgCfg(
116 flags,
117 name="DeviceGBTSSeedingAlg",
118 InputTracccPixelSpacepoints=spKey,
119 InputTracccMeasurements=measKey,
120 OutputTracccPixelSeeds=seedsKey,
121 ), sequenceName=sequenceName)
122 else:
123 acc.merge(DeviceTripletSeedingAlgCfg(
124 flags,
125 name="DeviceTripletSeedingAlg",
126 InputTracccPixelSpacepoints=spKey,
127 OutputTracccPixelSeeds=seedsKey,
128 ), sequenceName=sequenceName)
129
130 # ---- Track parameter estimation: seeds -> initial track parameters ----
131 acc.merge(DeviceTrkParamEstimationAlgCfg(
132 flags,
133 name="DeviceTrkParamEstimationAlg",
134 InputTracccSpacepoints=spKey,
135 InputTracccMeasurements=measKey,
136 InputTracccSeeds=seedsKey,
137 InputTracccMagField=deviceMagField,
138 OutputTracccTrackParameters=trkParamsKey,
139 ), sequenceName=sequenceName)
140
141 # ---- Track finding (fitting through finding): parameters -> tracks ----
142 acc.merge(DeviceTrackFindingAlgCfg(
143 flags,
144 name="DeviceTrackFindingAlg",
145 InputTracccMeasurements=measKey,
146 InputTracccTrackParameters=trkParamsKey,
147 InputTracccMagField=deviceMagField,
148 InputTracccDetectorGeometry=deviceGeometry,
149 OutputTracccTracks=tracksKey,
150 ), sequenceName=sequenceName)
151
152 return acc
ComponentAccumulator TracccTritonDeviceRecoCfg(flags, str sequenceName=DEFAULT_SEQUENCE_NAME)