ATLAS Offline Software
Loading...
Searching...
No Matches
ActsGPUGeometryConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5from AthDeviceComps.AthDeviceCompsConfig import MemoryResourcesToolCfg, CopyToolCfg
6
7# ============================================================
8# Service configurations
9# ============================================================
10
11def DeviceDetectorDescriptionSvcCfg(flags, name="ActsDeviceDetectorDescriptionSvc", **kwargs) -> ComponentAccumulator:
12
13 acc = ComponentAccumulator()
14
15 if not flags.Acts.TrackingGeometry.UseBlueprint:
16 raise ValueError("In-memory conversion to Detray detector is not possible without ACTS Gen3 Geometry (set by 'Acts.TrackingGeometry.UseBlueprint' flag).")
17 if not flags.Acts.TrackingGeometry.BuildDetrayGeometry:
18 raise ValueError("Detray detector description can not be built without a Detray detector (set by 'Acts.TrackingGeometry.BuildDetrayGeometry' flag).")
19 if flags.Detector.GeometryCalo or flags.Detector.GeometryMuon:
20 raise ValueError("Detray detector description can not be built with calo/muon volumes in the tracking geometry yet.")
21
22 if 'TrackingGeometrySvc' not in kwargs:
23 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometrySvcCfg
24 kwargs.setdefault(
25 "TrackingGeometrySvc",
26 acc.getPrimaryAndMerge(ActsTrackingGeometrySvcCfg(flags)),
27 )
28
29 kwargs.setdefault("MemoryResourcesTool", acc.popToolsAndMerge(MemoryResourcesToolCfg(flags)))
30 kwargs.setdefault("CopyProviderTool", acc.popToolsAndMerge(CopyToolCfg(flags)))
31 kwargs.setdefault("DeviceDigitizationObjectName", "TracccDeviceDigitizationConfig")
32 kwargs.setdefault("HostDigitizationObjectName", "TracccHostDigitizationConfig")
33 kwargs.setdefault("GeoIdMappingObjectName", "TracccGeometryIdMapping")
34 kwargs.setdefault("HostDetectorName", "TracccHostDetectorGeometry")
35 kwargs.setdefault("DeviceDetectorName", "TracccDeviceDetectorGeometry")
36
37 # The objects recorded by the service are retrieved from the detector store
38 # by the device algorithms during their initialization, so the service has
39 # to be created before any of the algorithms is initialized.
40 svc = CompFactory.ActsTrk.DeviceDetectorDescriptionSvc(name, **kwargs)
41 acc.addService(svc, primary=True, create=True)
42 return acc
43
44# ============================================================
45# Conditions algorithm configurations
46# ============================================================
47
48# Properties which belong to the service building the static detector description
49_detDescSvcProperties = (
50 "TrackingGeometrySvc",
51 "DeviceDigitizationObjectName",
52 "HostDigitizationObjectName",
53 "GeoIdMappingObjectName",
54 "HostDetectorName",
55 "DeviceDetectorName",
56)
57
58def DeviceDetectorDescriptionCondAlgCfg(flags, name="ActsDeviceDetectorDescriptionCondAlg", **kwargs) -> ComponentAccumulator:
59
60 acc = ComponentAccumulator()
61
62 if 'DeviceDetectorDescriptionSvc' not in kwargs:
63 svcKwargs = {k: kwargs.pop(k) for k in _detDescSvcProperties if k in kwargs}
64 if 'OutputLevel' in kwargs:
65 svcKwargs['OutputLevel'] = kwargs['OutputLevel']
66 kwargs.setdefault(
67 "DeviceDetectorDescriptionSvc",
68 acc.getPrimaryAndMerge(DeviceDetectorDescriptionSvcCfg(flags, **svcKwargs)),
69 )
70
71 from SiLorentzAngleTool.ITkPixelLorentzAngleConfig import ITkPixelLorentzAngleToolCfg
72 from SiLorentzAngleTool.ITkStripLorentzAngleConfig import ITkStripLorentzAngleToolCfg
73
74 kwargs.setdefault("PixelLorentzAngleTool", acc.popToolsAndMerge(ITkPixelLorentzAngleToolCfg(flags)))
75 kwargs.setdefault("StripLorentzAngleTool", acc.popToolsAndMerge(ITkStripLorentzAngleToolCfg(flags)))
76
77 kwargs.setdefault("MemoryResourcesTool", acc.popToolsAndMerge(MemoryResourcesToolCfg(flags)))
78 kwargs.setdefault("CopyProviderTool", acc.popToolsAndMerge(CopyToolCfg(flags)))
79 kwargs.setdefault("DeviceConditionsObjectName", "TracccDeviceCondConfig")
80 kwargs.setdefault("HostConditionsObjectName", "TracccHostCondConfig")
81
82 the_alg = CompFactory.ActsTrk.DeviceDetectorDescriptionCondAlg(name, **kwargs)
83 acc.addCondAlgo(the_alg, primary = True)
84
85 return acc
ComponentAccumulator DeviceDetectorDescriptionSvcCfg(flags, name="ActsDeviceDetectorDescriptionSvc", **kwargs)
ComponentAccumulator DeviceDetectorDescriptionCondAlgCfg(flags, name="ActsDeviceDetectorDescriptionCondAlg", **kwargs)