ATLAS Offline Software
Loading...
Searching...
No Matches
Acts/ActsGeometry/src/TrackingGeometrySvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSGEOMETRY_ACTSTRACKINGGEOMETRYSVC_H
6#define ACTSGEOMETRY_ACTSTRACKINGGEOMETRYSVC_H
7
8// ATHENA
10
11// PACKAGE
19
20// ACTS
21#include "Acts/Geometry/CylinderVolumeBuilder.hpp"
22
24#include "GaudiKernel/ToolHandle.h"
25
26// STL
27#include <map>
28
29#include <tbb/concurrent_unordered_map.h>
30
31namespace InDetDD {
35}
36
37class TRT_ID;
38class ActsAlignmentStore;
40class HGTD_ID;
42
44
45namespace Acts {
46
47class TrackingGeometry;
48class CylinderVolumeHelper;
49class ILayerBuilder;
50
51class GeometryIdentifier;
52class BinnedSurfaceMaterial;
53class BlueprintNode;
54
55}
56
57
58namespace ActsTrk{
59class TrackingGeometrySvc : public extends<AthService, ActsTrk::ITrackingGeometrySvc> {
60public:
61
63 StatusCode initialize() override;
64 StatusCode finalize() override;
65
66 TrackingGeometrySvc( const std::string& name, ISvcLocator* pSvcLocator );
68 std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry() const override;
70 unsigned int populateAlignmentStore(ActsTrk::DetectorAlignStore& store) const override;
71
73 const ActsTrk::GeometryContext& getNominalContext() const override;
75 const Acts::TrackingVolume* getEnvelope(const ActsTrk::SystemEnvelope envType) const override;
77 virtual const ActsTrk::DetectorElementToActsGeometryIdMap* surfaceIdMap() const override;
78
84 const traccc::host_detector* detrayGeometry() const override {
85 return m_detrayGeometry.get();
86 }
87
88private:
90 std::unique_ptr<ActsTrk::DetectorElementToActsGeometryIdMap> createDetectorElementToGeoIdMap() const;
91
93 StatusCode buildDetrayGeometry();
94
97
98 std::shared_ptr<const Acts::ILayerBuilder>
100
101 std::shared_ptr<const Acts::ILayerBuilder>
103
104 std::shared_ptr<Acts::TrackingVolume>
105 makeSCTTRTAssembly(const Acts::GeometryContext& gctx, const Acts::ILayerBuilder& sct_lb,
106 const Acts::ILayerBuilder& trt_lb, const Acts::CylinderVolumeHelper& cvh,
107 const std::shared_ptr<const Acts::TrackingVolume>& pixel);
108
109 Acts::CylinderVolumeBuilder::Config makeBeamPipeConfig(
110 std::shared_ptr<const Acts::CylinderVolumeHelper> cvh) const;
111
112 bool runConsistencyChecks() const;
113
122
123 std::shared_ptr<ActsElementVector> m_elementStore{nullptr};
124 std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry{nullptr};
125
126 const TRT_ID *m_TRT_idHelper{nullptr};
127 const HGTD_ID *m_HGTD_idHelper{nullptr};
128
130
131 Gaudi::Property<bool> m_useMaterialMap{this, "UseMaterialMap", false, ""};
132 Gaudi::Property<bool> m_objDebugOutput{this, "ObjDebugOutput", false, ""};
133 Gaudi::Property<bool> m_keepGoingOnMaterialMergeFailure{this, "KeepGoingOnMaterialMergeFailure", false, ""};
134 Gaudi::Property<std::string> m_materialMapInputFileBase{this, "MaterialMapInputFile", "", ""};
135 Gaudi::Property<std::string> m_materialMapCalibFolder{this, "MaterialMapCalibFolder", ".", ""};
136 Gaudi::Property<bool> m_buildBeamPipe{this, "BuildBeamPipe", false, ""};
137
139 Gaudi::Property<bool> m_printGeo{this, "printGeometry", false};
140
141 Gaudi::Property<std::vector<size_t>> m_barrelMaterialBins{this, "BarrelMaterialBins", {10, 10}};
142 Gaudi::Property<std::vector<size_t>> m_endcapMaterialBins{this, "EndcapMaterialBins", {5, 20}};
143 Gaudi::Property<std::vector<std::string>> m_buildSubdetectors{this, "BuildSubDetectors", {"Pixel", "SCT", "TRT", "Calo", "HGTD", "Muon"}};
144
149 Gaudi::Property<std::vector<float>> m_passiveITkInnerPixelBarrelLayerRadii{this, "PassiveITkInnerPixelBarrelLayerRadii", {}};
150 Gaudi::Property<std::vector<float>> m_passiveITkInnerPixelBarrelLayerHalflengthZ{this, "PassiveITkInnerPixelBarrelLayerHalflengthZ", {}};
151 Gaudi::Property<std::vector<float>> m_passiveITkInnerPixelBarrelLayerThickness{this, "PassiveITkInnerPixelBarrelLayerThickness", {}};
152
153 Gaudi::Property<std::vector<float>> m_passiveITkOuterPixelBarrelLayerRadii{this, "PassiveITkOuterPixelBarrelLayerRadii", {}};
154 Gaudi::Property<std::vector<float>> m_passiveITkOuterPixelBarrelLayerHalflengthZ{this, "PassiveITkOuterPixelBarrelLayerHalflengthZ", {}};
155 Gaudi::Property<std::vector<float>> m_passiveITkOuterPixelBarrelLayerThickness{this, "PassiveITkOuterPixelBarrelLayerThickness", {}};
156
157 Gaudi::Property<std::vector<float>> m_passiveITkStripBarrelLayerRadii{this, "PassiveITkStripBarrelLayerRadii", {}};
158 Gaudi::Property<std::vector<float>> m_passiveITkStripBarrelLayerHalflengthZ{this, "PassiveITkStripBarrelLayerHalflengthZ", {}};
159 Gaudi::Property<std::vector<float>> m_passiveITkStripBarrelLayerThickness{this, "PassiveITkStripBarrelLayerThickness", {}};
160
161 BooleanProperty m_runConsistencyChecks{this, "RunConsistencyChecks",
162 false, "Run extra consistency checks w.r.t to Trk::. This is SLOW!"};
163
164 StringProperty m_consistencyCheckOutput{this, "ConsistencyCheckOutput",
165 "", "Output file for geometry debugging, will not write if empty",};
166
167 Gaudi::Property<size_t> m_consistencyCheckPoints{this, "ConsistencyCheckPoints",
168 1000, "number of random points for consistency check"};
169
170 ToolHandle<IActsTrackingVolumeBuilder> m_caloVolumeBuilder{this, "CaloVolumeBuilder", ""};
171
172 ToolHandleArray<ActsTrk::IBlueprintNodeBuilder> m_blueprintNodeBuilders{this, "BlueprintNodeBuilders", {}};
173
174 ToolHandleArray<ActsTrk::IRefineTrackingGeoTool> m_refineVisitors{this, "RefinementTools", {}};
176 Gaudi::Property<std::vector<unsigned int>> m_subDetNoAlignProp{this, "NotAlignDetectors", {}};
177 std::set<ActsTrk::DetectorType> m_subDetNoAlign{};
178
179 Gaudi::Property<bool> m_useBlueprint{this, "UseBlueprint", false, "Use the new Blueprint API for geometry construction"};
180
181 Gaudi::Property<bool> m_buildDetrayGeometry{this, "BuildDetrayGeometry", false,
182 "Convert the constructed Acts::TrackingGeometry into a Detray geometry."};
183
184 Gaudi::Property<bool> m_checkDetrayGeometry{this, "CheckDetrayGeometry", false,
185 "Run the Detray consistency check on the converted geometry. "
186 "Only used when BuildDetrayGeometry is enabled."};
187
188 Gaudi::Property<bool> m_buildDetraySurfaceGrids{this, "BuildDetraySurfaceGrids", true,
189 "Build the Detray surface grids from the volume navigation policies. "
190 "Only used when BuildDetrayGeometry is enabled."};
191
192 Gaudi::Property<bool> m_buildDetrayMaterial{this, "BuildDetrayMaterial", true,
193 "Build the Detray material from the volume navigation policies. "
194 "Only used when BuildDetrayGeometry is enabled."};
195
200 ToolHandle<AthDevice::IMemoryResourceTool> m_hostMR{this, "HostMR", "",
201 "Host memory resource tool used for the Detray geometry allocations. The "
202 "conversion runs entirely on the host, so the resource has to be host "
203 "accessible: a plain host or a managed/shared one, not a device one."};
204
205 Gaudi::Property<std::string> m_blueprintGraphviz{this, "BlueprintGraphviz",
206 "", "Write the blueprint graph to a file. No file will be written if empty"};
207 Gaudi::Property<bool> m_doEndcapLayerMerging{this, "DoEndcapLayerMerging", true, "Merge overlapping endcap layers in z"};
208
212 Gaudi::Property<double> m_numberOfBinsFactor{this, "NumberOfBinsFactor", 5.0};
213
219 Gaudi::Property<std::vector<unsigned int>> m_itkPixelInnerBarrelNeighborWindow{
220 this, "ITkPixelInnerBarrelNeighborWindow", {1, 8},
221 "Neighbor window bound {phi, z} of the ITk inner pixel barrel layers"};
222 Gaudi::Property<std::vector<unsigned int>> m_itkPixelInnerEndcapNeighborWindow{
223 this, "ITkPixelInnerEndcapNeighborWindow", {2, 1},
224 "Neighbor window bound {r, phi} of the ITk inner pixel endcap layers"};
225 Gaudi::Property<std::vector<unsigned int>> m_itkPixelOuterBarrelNeighborWindow{
226 this, "ITkPixelOuterBarrelNeighborWindow", {1, 3},
227 "Neighbor window bound {phi, z} of the ITk outer pixel barrel layers"};
228 Gaudi::Property<std::vector<unsigned int>> m_itkPixelOuterEndcapNeighborWindow{
229 this, "ITkPixelOuterEndcapNeighborWindow", {4, 1},
230 "Neighbor window bound {r, phi} of the ITk outer pixel endcap and inclined layers"};
231 Gaudi::Property<std::vector<unsigned int>> m_itkStripBarrelNeighborWindow{
232 this, "ITkStripBarrelNeighborWindow", {1, 4},
233 "Neighbor window bound {phi, z} of the ITk strip barrel layers"};
234 Gaudi::Property<std::vector<unsigned int>> m_itkStripEndcapNeighborWindow{
235 this, "ITkStripEndcapNeighborWindow", {2, 1},
236 "Neighbor window bound {r, phi} of the ITk strip endcap layers"};
237
239 Gaudi::Property<unsigned int> m_surfaceArrayOverfill{this, "SurfaceArrayOverfill", 0,
240 "Extra cells per direction and axis that each surface fills in the surface arrays"};
241
243 Gaudi::Property<double> m_numberOfHgtdBinsFactor{this, "NumberOfHgtdBinsFactor", 5.0};
244
245 std::unique_ptr<const ActsTrk::DetectorElementToActsGeometryIdMap> m_detIdMap{};
246
247 std::unique_ptr<traccc::host_detector> m_detrayGeometry;
248};
249
250}
251
252#endif
Helper to hold elements for deletion.
StatusCode buildDetrayGeometry()
Converts the built Acts::TrackingGeometry into a Detray geometry and stores it in m_detrayGeometry.
Gaudi::Property< std::vector< size_t > > m_endcapMaterialBins
Gaudi::Property< std::vector< unsigned int > > m_itkStripBarrelNeighborWindow
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry
const InDetDD::TRT_DetectorManager * p_TRTManager
Gaudi::Property< std::vector< std::string > > m_buildSubdetectors
Gaudi::Property< std::vector< unsigned int > > m_itkPixelInnerBarrelNeighborWindow
Most bins the surface array lookup serves on each side of the crossing, as {phi, z}...
const traccc::host_detector * detrayGeometry() const override
Returns the Detray geometry converted from the Acts::TrackingGeometry, or nullptr if none was built.
Gaudi::Property< std::vector< unsigned int > > m_itkPixelOuterBarrelNeighborWindow
Gaudi::Property< std::vector< unsigned int > > m_itkStripEndcapNeighborWindow
Gaudi::Property< std::vector< float > > m_passiveITkInnerPixelBarrelLayerThickness
ActsLayerBuilder::Config makeLayerBuilderConfig(const InDetDD::InDetDetectorManager *manager)
const InDetDD::SiDetectorManager * p_ITkStripManager
Gaudi::Property< std::vector< unsigned int > > m_subDetNoAlignProp
Define the subdetectors for which the tracking geometry does not expect a valid alignment store.
unsigned int populateAlignmentStore(ActsTrk::DetectorAlignStore &store) const override
Loops through the volumes of the tracking geometry and caches the aligned transforms in the store.
Gaudi::Property< std::vector< float > > m_passiveITkOuterPixelBarrelLayerThickness
ToolHandleArray< ActsTrk::IRefineTrackingGeoTool > m_refineVisitors
Gaudi::Property< std::vector< float > > m_passiveITkOuterPixelBarrelLayerHalflengthZ
Acts::CylinderVolumeBuilder::Config makeBeamPipeConfig(std::shared_ptr< const Acts::CylinderVolumeHelper > cvh) const
Gaudi::Property< std::vector< unsigned int > > m_itkPixelOuterEndcapNeighborWindow
Gaudi::Property< std::vector< float > > m_passiveITkStripBarrelLayerRadii
ToolHandle< AthDevice::IMemoryResourceTool > m_hostMR
Tool providing the memory resource that the Detray geometry is allocated from.
Gaudi::Property< std::vector< float > > m_passiveITkStripBarrelLayerThickness
std::shared_ptr< const Acts::ILayerBuilder > makeHGTDLayerBuilder(const HGTD_DetectorManager *manager)
Gaudi::Property< double > m_numberOfHgtdBinsFactor
Special treatment for hgtd layers as well.
std::unique_ptr< const ActsTrk::DetectorElementToActsGeometryIdMap > m_detIdMap
Gaudi::Property< bool > m_printGeo
Print the assembled tracking geometry after building.
Gaudi::Property< unsigned int > m_surfaceArrayOverfill
Extra cells per direction and axis that each surface fills around its footprint.
Gaudi::Property< std::vector< float > > m_passiveITkInnerPixelBarrelLayerRadii
the specifications for building additional passive cylinders in the barrel region: for each cylinder ...
const ActsTrk::GeometryContext & getNominalContext() const override
Returns an empty nominal context without any alignment caches.
std::shared_ptr< const Acts::ILayerBuilder > makeStrawLayerBuilder(const InDetDD::InDetDetectorManager *manager)
Gaudi::Property< std::vector< size_t > > m_barrelMaterialBins
ToolHandleArray< ActsTrk::IBlueprintNodeBuilder > m_blueprintNodeBuilders
virtual const ActsTrk::DetectorElementToActsGeometryIdMap * surfaceIdMap() const override
Returns the pointer to the identifier mapping between Acts::surface ID & IdentifierHash of the ITk su...
ToolHandle< IActsTrackingVolumeBuilder > m_caloVolumeBuilder
std::unique_ptr< ActsTrk::DetectorElementToActsGeometryIdMap > createDetectorElementToGeoIdMap() const
Creates and popules the DetectorElement -> Acts::Surface geo identifier map from the geometry service...
std::shared_ptr< const Acts::TrackingGeometry > trackingGeometry() const override
Returns a pointer to the internal ACTS tracking geometry.
std::unique_ptr< traccc::host_detector > m_detrayGeometry
Gaudi::Property< std::vector< float > > m_passiveITkOuterPixelBarrelLayerRadii
const Acts::TrackingVolume * getEnvelope(const ActsTrk::SystemEnvelope envType) const override
Returns the envelope volume from the tracking geometry that's containing all volumes of the subsystem...
Gaudi::Property< std::vector< float > > m_passiveITkInnerPixelBarrelLayerHalflengthZ
std::shared_ptr< ActsElementVector > m_elementStore
Gaudi::Property< std::vector< float > > m_passiveITkStripBarrelLayerHalflengthZ
TrackingGeometrySvc(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< double > m_numberOfBinsFactor
controls how many bins are created for the sensitive surface grid.
Gaudi::Property< std::vector< unsigned int > > m_itkPixelInnerEndcapNeighborWindow
const InDetDD::SiDetectorManager * p_ITkPixelManager
std::shared_ptr< Acts::TrackingVolume > makeSCTTRTAssembly(const Acts::GeometryContext &gctx, const Acts::ILayerBuilder &sct_lb, const Acts::ILayerBuilder &trt_lb, const Acts::CylinderVolumeHelper &cvh, const std::shared_ptr< const Acts::TrackingVolume > &pixel)
The Detector manager has methods to retrieve the Identifier helper and methods to retrieve the detect...
This is an Identifier helper class for the HGTD subdetector.
Definition HGTD_ID.h:47
Virtual base class for all ID detector managers.
Base class for Pixel and SCT Detector managers.
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:84
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
SystemEnvelope
Define an enumeration to retrieve the envelope tracking volume from.
Message Stream Member.
nested configuration struct for steering of the layer builder