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
38
39
40 svc = CompFactory.ActsTrk.DeviceDetectorDescriptionSvc(name, **kwargs)
41 acc.addService(svc, primary=True, create=True)
42 return acc
43
44
45
46
47
48