ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::TrackingGeometrySvc Class Reference

#include <TrackingGeometrySvc.h>

Inheritance diagram for ActsTrk::TrackingGeometrySvc:

Public Member Functions

StatusCode initialize () override
 TrackingGeometrySvc (const std::string &name, ISvcLocator *pSvcLocator)
std::shared_ptr< const Acts::TrackingGeometry > trackingGeometry () const override
 Returns a pointer to the internal ACTS tracking geometry.
unsigned int populateAlignmentStore (ActsTrk::DetectorAlignStore &store) const override
 Loops through the volumes of the tracking geometry and caches the aligned transforms in the store.
const ActsTrk::GeometryContextgetNominalContext () const override
 Returns an empty nominal context without any alignment caches.
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.
virtual const ActsTrk::DetectorElementToActsGeometryIdMapsurfaceIdMap () const override
 Returns the pointer to the identifier mapping between Acts::surface ID & IdentifierHash of the ITk surfaces.

Private Member Functions

std::unique_ptr< ActsTrk::DetectorElementToActsGeometryIdMapcreateDetectorElementToGeoIdMap () const
 Creates and popules the DetectorElement -> Acts::Surface geo identifier map from the geometry service.
ActsLayerBuilder::Config makeLayerBuilderConfig (const InDetDD::InDetDetectorManager *manager)
std::shared_ptr< const Acts::ILayerBuilder > makeStrawLayerBuilder (const InDetDD::InDetDetectorManager *manager)
std::shared_ptr< const Acts::ILayerBuilder > makeHGTDLayerBuilder (const HGTD_DetectorManager *manager)
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)
Acts::CylinderVolumeBuilder::Config makeBeamPipeConfig (std::shared_ptr< const Acts::CylinderVolumeHelper > cvh) const
bool runConsistencyChecks () const

Private Attributes

ServiceHandle< StoreGateSvcm_detStore
const InDetDD::SiDetectorManagerp_pixelManager {nullptr}
const InDetDD::SiDetectorManagerp_SCTManager {nullptr}
const InDetDD::TRT_DetectorManagerp_TRTManager {nullptr}
const InDetDD::SiDetectorManagerp_ITkPixelManager {nullptr}
const InDetDD::SiDetectorManagerp_ITkStripManager {nullptr}
const BeamPipeDetectorManagerp_beamPipeMgr {nullptr}
const HGTD_DetectorManagerp_HGTDManager {nullptr}
std::shared_ptr< ActsElementVectorm_elementStore {nullptr}
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry {nullptr}
const TRT_IDm_TRT_idHelper {nullptr}
const HGTD_IDm_HGTD_idHelper {nullptr}
ActsTrk::GeometryContext m_nominalContext {}
Gaudi::Property< bool > m_useMaterialMap {this, "UseMaterialMap", false, ""}
Gaudi::Property< bool > m_objDebugOutput {this, "ObjDebugOutput", false, ""}
Gaudi::Property< bool > m_keepGoingOnMaterialMergeFailure {this, "KeepGoingOnMaterialMergeFailure", false, ""}
Gaudi::Property< std::string > m_materialMapInputFileBase {this, "MaterialMapInputFile", "", ""}
Gaudi::Property< std::string > m_materialMapCalibFolder {this, "MaterialMapCalibFolder", ".", ""}
Gaudi::Property< bool > m_buildBeamPipe {this, "BuildBeamPipe", false, ""}
Gaudi::Property< bool > m_printGeo {this, "printGeometry", false}
 Print the assembled tracking geometry after building.
Gaudi::Property< std::vector< size_t > > m_barrelMaterialBins {this, "BarrelMaterialBins", {10, 10}}
Gaudi::Property< std::vector< size_t > > m_endcapMaterialBins {this, "EndcapMaterialBins", {5, 20}}
Gaudi::Property< std::vector< std::string > > m_buildSubdetectors {this, "BuildSubDetectors", {"Pixel", "SCT", "TRT", "Calo", "HGTD", "Muon"}}
Gaudi::Property< std::vector< float > > m_passiveITkInnerPixelBarrelLayerRadii {this, "PassiveITkInnerPixelBarrelLayerRadii", {}}
 the specifications for building additional passive cylinders in the barrel region: for each cylinder you want to specify radius, half length in z and thickness
Gaudi::Property< std::vector< float > > m_passiveITkInnerPixelBarrelLayerHalflengthZ {this, "PassiveITkInnerPixelBarrelLayerHalflengthZ", {}}
Gaudi::Property< std::vector< float > > m_passiveITkInnerPixelBarrelLayerThickness {this, "PassiveITkInnerPixelBarrelLayerThickness", {}}
Gaudi::Property< std::vector< float > > m_passiveITkOuterPixelBarrelLayerRadii {this, "PassiveITkOuterPixelBarrelLayerRadii", {}}
Gaudi::Property< std::vector< float > > m_passiveITkOuterPixelBarrelLayerHalflengthZ {this, "PassiveITkOuterPixelBarrelLayerHalflengthZ", {}}
Gaudi::Property< std::vector< float > > m_passiveITkOuterPixelBarrelLayerThickness {this, "PassiveITkOuterPixelBarrelLayerThickness", {}}
Gaudi::Property< std::vector< float > > m_passiveITkStripBarrelLayerRadii {this, "PassiveITkStripBarrelLayerRadii", {}}
Gaudi::Property< std::vector< float > > m_passiveITkStripBarrelLayerHalflengthZ {this, "PassiveITkStripBarrelLayerHalflengthZ", {}}
Gaudi::Property< std::vector< float > > m_passiveITkStripBarrelLayerThickness {this, "PassiveITkStripBarrelLayerThickness", {}}
BooleanProperty m_runConsistencyChecks
StringProperty m_consistencyCheckOutput
Gaudi::Property< size_t > m_consistencyCheckPoints
ToolHandle< IActsTrackingVolumeBuilderm_caloVolumeBuilder {this, "CaloVolumeBuilder", ""}
ToolHandleArray< ActsTrk::IBlueprintNodeBuilderm_blueprintNodeBuilders {this, "BlueprintNodeBuilders", {}}
ToolHandleArray< ActsTrk::IRefineTrackingGeoToolm_refineVisitors {this, "RefinementTools", {}}
Gaudi::Property< std::vector< unsigned int > > m_subDetNoAlignProp {this, "NotAlignDetectors", {}}
 Define the subdetectors for which the tracking geometry does not expect a valid alignment store.
std::set< ActsTrk::DetectorTypem_subDetNoAlign {}
Gaudi::Property< bool > m_useBlueprint {this, "UseBlueprint", false, "Use the new Blueprint API for geometry construction"}
Gaudi::Property< std::string > m_blueprintGraphviz
Gaudi::Property< bool > m_doEndcapLayerMerging {this, "DoEndcapLayerMerging", true, "Merge overlapping endcap layers in z"}
Gaudi::Property< double > m_numberOfBinsFactor {this, "NumberOfBinsFactor", 5.0}
 controls how many bins are created for the sensitive surface grid.
Gaudi::Property< double > m_numberOfInnermostLayerBinsFactor {this, "NumberOfInnermostLayerBinsFactor",2.0}
 Special treatment for the innermost pixel layer to have more control on bin size to account for shallow angle tracks.
std::unique_ptr< const ActsTrk::DetectorElementToActsGeometryIdMapm_detIdMap {}

Detailed Description

Definition at line 59 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

Constructor & Destructor Documentation

◆ TrackingGeometrySvc()

ActsTrk::TrackingGeometrySvc::TrackingGeometrySvc ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 72 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

74 : base_class(name, svc),
75 m_detStore("StoreGateSvc/DetectorStore", name),
76 m_elementStore (std::make_shared<ActsElementVector>())
77{
78}
std::shared_ptr< ActsElementVector > m_elementStore

Member Function Documentation

◆ createDetectorElementToGeoIdMap()

std::unique_ptr< ActsTrk::DetectorElementToActsGeometryIdMap > ActsTrk::TrackingGeometrySvc::createDetectorElementToGeoIdMap ( ) const
private

Creates and popules the DetectorElement -> Acts::Surface geo identifier map from the geometry service.

Muon system

Definition at line 1254 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

1254 {
1255 // create map from
1256 auto detector_element_to_geoid = std::make_unique<DetectorElementToActsGeometryIdMap>();
1257
1258 struct Counter{
1259 unsigned n_sensitive_elements{0};
1260 unsigned n_detector_elements{0};
1261 unsigned n_wrong_type{0};
1262 };
1263 Counter counter {};
1264 trackingGeometry()->visitSurfaces([this, &counter, &detector_element_to_geoid](const Acts::Surface *surface) {
1265 if (!surface || !surface->isSensitive()) {
1266 ++counter.n_wrong_type;
1267 return;
1268 }
1269 ++counter.n_sensitive_elements;
1270 const auto* placement = dynamic_cast<const ISurfacePlacement*>(surface->surfacePlacement());
1271 if (!placement) {
1272 return;
1273 }
1274
1275 auto insert_id = [&detector_element_to_geoid, &surface, &counter](const xAOD::UncalibMeasType type,
1276 const IdentifierHash& hash) {
1277 detector_element_to_geoid->insert(std::make_pair(makeDetectorElementKey(type, hash),
1278 DetectorElementToActsGeometryIdMap::makeValue(surface->geometryId())));
1279 ++counter.n_detector_elements;
1280 };
1281 switch(placement->detectorType()) {
1282 using enum DetectorType;
1283 case Pixel:
1285 getActsDetectorElement(surface)->identifyHash());
1286 break;
1287 case Sct:
1289 getActsDetectorElement(surface)->identifyHash());
1290 break;
1291 case Hgtd:
1293 getActsDetectorElement(surface)->identifyHash());
1294 break;
1295 case Trt: {
1296 break;
1297 }
1299 case Mdt:
1300 case Rpc:
1301 case Tgc:
1302 case Csc:
1303 case Mm:
1304 case sTgc:{
1305 // surface map not needed for the muon detectors
1306 ++counter.n_detector_elements;
1307 break;
1308 }
1309 case UnDefined:
1310 ATH_MSG_ERROR("Undefined element encountered");
1311 counter.n_detector_elements = 0;
1312 return;
1313 }
1314 }, true /*sensitive surfaces*/);
1315 ATH_MSG_INFO( "Surfaces without associated detector elements " << (counter.n_sensitive_elements -counter.n_detector_elements)
1316 << " (with " << counter.n_detector_elements << ")" );
1317 if (counter.n_sensitive_elements > 0 &&
1318 counter.n_detector_elements==0) {
1319 ATH_MSG_ERROR( "No surface with associated detector element" );
1320 return nullptr;
1321 }
1322 if (counter.n_wrong_type>0) {
1323 ATH_MSG_WARNING( "Surfaces associated to detector elements not of type Trk::TrkDetElementBase :" << counter.n_wrong_type);
1324 }
1325 return detector_element_to_geoid;
1326}
const ActsDetectorElement * getActsDetectorElement(const Acts::Surface &surf)
Attempts to retrieve the ActsDetectorElement associated to the passed ActsSurface.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
std::shared_ptr< const Acts::TrackingGeometry > trackingGeometry() const override
Returns a pointer to the internal ACTS tracking geometry.
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
@ Mm
Maybe not needed in the migration.
@ Tgc
Resitive Plate Chambers.
@ sTgc
Micromegas (NSW).
@ Rpc
Monitored Drift Tubes.
@ Csc
Thin gap champers.
@ Mdt
MuonSpectrometer.
@ UnDefined
Small Thing Gap chambers (NSW).
DetectorElementKey makeDetectorElementKey(xAOD::UncalibMeasType meas_type, unsigned int identifier_hash)
@ Pixel
Definition DetType.h:13
UncalibMeasType
Define the type of the uncalibrated measurement.
static const Acts::GeometryIdentifier & makeValue(const Acts::GeometryIdentifier &geo_id)

◆ getEnvelope()

const Acts::TrackingVolume * ActsTrk::TrackingGeometrySvc::getEnvelope ( const ActsTrk::SystemEnvelope envType) const
override

Returns the envelope volume from the tracking geometry that's containing all volumes of the subsystem.

Definition at line 1234 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

1234 {
1235 const Acts::TrackingVolume* retVol{nullptr};
1236 using namespace ActsTrk::detail::GeoVolIds;
1237 switch (envType) {
1238 using enum ActsTrk::SystemEnvelope;
1239 case ITkExit:
1240 break;
1241 case CaloExit:
1242 retVol = m_trackingGeometry->findVolume(Acts::GeometryIdentifier{}.withVolume(s_caloEnvelopeID));
1243 break;
1244 case MsExit:
1245 break;
1246 }
1247 if(!retVol) {
1248 THROW_EXCEPTION("There is no system envelope "<<envType);
1249 }
1250 return retVol;
1251}
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry
SystemEnvelope
Define an enumeration to retrieve the envelope tracking volume from.
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

◆ getNominalContext()

const GeometryContext & ActsTrk::TrackingGeometrySvc::getNominalContext ( ) const
override

Returns an empty nominal context without any alignment caches.

Definition at line 1151 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

◆ initialize()

StatusCode ActsTrk::TrackingGeometrySvc::initialize ( )
override

Definition at line 80 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

80 {
81 ATH_MSG_INFO(name() << " is initializing");
82 for (unsigned int skipAlign : m_subDetNoAlignProp) {
83 try {
84 m_subDetNoAlign.insert(static_cast<DetectorType>(skipAlign));
85 } catch (...) {
86 ATH_MSG_FATAL("Failed to interpret " << m_subDetNoAlignProp << " as ActsDetectorElements");
87 return StatusCode::FAILURE;
88 }
89 }
90 ATH_CHECK(m_caloVolumeBuilder.retrieve(EnableTool{!m_caloVolumeBuilder.empty()}));
91
92 // FIXME: ActsCaloTrackingVolumeBuilder holds ReadHandle to
93 // CaloDetDescrManager. Hopefully this service is never called before that
94 // object is available.
95 m_autoRetrieveTools = false;
96 m_checkToolDeps = false;
97
98 ATH_MSG_INFO("ACTS version is: v"
99 << Acts::VersionMajor << "." << Acts::VersionMinor << "."
100 << Acts::VersionPatch << " [" << Acts::CommitHash.value_or("unknown hash") << "]");
101
102 // load which subdetectors to build from property
103 std::set<std::string> buildSubdet(m_buildSubdetectors.begin(),
104 m_buildSubdetectors.end());
105 ATH_MSG_INFO("Configured to build " << buildSubdet.size()
106 << " subdetectors:");
107 for (const auto &s : buildSubdet) {
108 ATH_MSG_INFO(" - " << s);
109 }
110
111 ATH_MSG_DEBUG("Loading detector manager(s)");
112 if (buildSubdet.find("Pixel") != buildSubdet.end()) {
113 ATH_CHECK(m_detStore->retrieve(p_pixelManager, "Pixel"));
114 }
115 if (buildSubdet.find("SCT") != buildSubdet.end()) {
116 ATH_CHECK(m_detStore->retrieve(p_SCTManager, "SCT"));
117 }
118 if (buildSubdet.find("TRT") != buildSubdet.end()) {
119 ATH_CHECK(m_detStore->retrieve(p_TRTManager, "TRT"));
120 ATH_CHECK(m_detStore->retrieve(m_TRT_idHelper, "TRT_ID"));
121 }
122 if (buildSubdet.find("ITkPixel") != buildSubdet.end()) {
123 ATH_CHECK(m_detStore->retrieve(p_ITkPixelManager, "ITkPixel"));
124 }
125 if (buildSubdet.find("ITkStrip") != buildSubdet.end()) {
126 ATH_CHECK(m_detStore->retrieve(p_ITkStripManager, "ITkStrip"));
127 }
128 if (buildSubdet.find("HGTD") != buildSubdet.end()) {
129 ATH_CHECK(m_detStore->retrieve(p_HGTDManager, "HGTD"));
130 ATH_CHECK(m_detStore->retrieve(m_HGTD_idHelper, "HGTD_ID"));
131 }
132
133 if(m_buildBeamPipe) {
134 ATH_CHECK(m_detStore->retrieve(p_beamPipeMgr, "BeamPipe"));
135 }
136
137 // Consistency check on the size vectors for passive layers
140 ATH_MSG_FATAL("Consistency check for ITk inner pixel barrel passive layer construction failed. Please check your inputs! ");
141 return StatusCode::FAILURE;
142 }
143
146 ATH_MSG_FATAL("Consistency check for ITk outer pixel barrel passive layer construction failed. Please check your inputs! ");
147 return StatusCode::FAILURE;
148 }
149
152 ATH_MSG_FATAL("Consistency check for ITk strip barrel passive layer construction failed. Please check your inputs! ");
153 return StatusCode::FAILURE;
154 }
155
156 if (m_useBlueprint) {
157
158
159 ATH_MSG_INFO("Using Blueprint API for geometry construction");
160 std::set<std::string> buildSubdet(m_buildSubdetectors.begin(),
161 m_buildSubdetectors.end());
162
164 ATH_CHECK(m_refineVisitors.retrieve());
165
166 using enum Acts::AxisDirection;
167
168 std::vector<ActsTrk::IBlueprintNodeBuilder*> ptrBuilders;
169 std::transform(m_blueprintNodeBuilders.begin(), m_blueprintNodeBuilders.end(),
170 std::back_inserter(ptrBuilders),
171 [](ToolHandle<ActsTrk::IBlueprintNodeBuilder>& b) { return b.get(); });
172
173 auto logger = makeActsAthenaLogger(this, std::string("Blueprint"), std::string("ActsTGSvc"));
174
175 Acts::Experimental::Blueprint::Config cfg;
176 cfg.envelope[AxisZ] = {20_mm, 20_mm};
177 cfg.envelope[AxisR] = {0_mm, 20_mm};
178
179 auto blueprint = std::make_unique<Acts::Experimental::Blueprint>(cfg);
180
181 auto& root = blueprint->addCylinderContainer("Detector", AxisZ);
182 //The starting top node
183 std::shared_ptr<Acts::Experimental::BlueprintNode> currentTop{nullptr};
184
185 for (auto& builder : ptrBuilders) {
186 currentTop = builder->buildBlueprintNode(getNominalContext().context(), std::move(currentTop));
187
188 }
189
190 root.addChild(std::move(currentTop));
191
192 Acts::Experimental::BlueprintOptions blueprintOptions;
193 blueprintOptions.keepGoingOnMaterialMergeFailure = m_keepGoingOnMaterialMergeFailure;
194 std::unique_ptr<Acts::TrackingGeometry> trackingGeometry = blueprint->construct(
195 blueprintOptions, getNominalContext().context(), *logger->clone(std::nullopt, Acts::Logging::DEBUG));
196
197 for (auto& refineVisitor : m_refineVisitors) {
198 trackingGeometry->apply(*refineVisitor);
199 ATH_CHECK(refineVisitor->finalize());
200 }
201 m_refineVisitors.clear();
202
204
205 if (m_objDebugOutput) {
206 Acts::ObjVisualization3D vis;
207 m_trackingGeometry->visualize(vis, getNominalContext().context(), {.visible = false},
208 {.visible = false}, {.visible = true});
209 vis.write("blueprint_sensitive.obj");
210 vis.clear();
211
212 m_trackingGeometry->visualize(vis, getNominalContext().context(), {.visible = true},
213 {.visible = false}, {.visible = false});
214 vis.write("blueprint_volume.obj");
215 vis.clear();
216
217 m_trackingGeometry->visualize(vis, getNominalContext().context(), {.visible = false},
218 {.visible = true}, {.visible = false});
219 vis.write("blueprint_portals.obj");
220 }
221 if (m_printGeo) {
222 Acts::detail::TrackingGeometryPrintVisitor printer{m_nominalContext.context()};
223 m_trackingGeometry->apply(printer);
224 ATH_MSG_INFO("Built tracking geometry \n"<<printer.stream().str());
225 }
227 if (!m_detIdMap) {
228 return StatusCode::FAILURE;
229 }
230
231 return StatusCode::SUCCESS;
232 }
233
234 ATH_MSG_DEBUG("Setting up ACTS geometry helpers");
235
236 Acts::LayerArrayCreator::Config lacCfg;
237 auto layerArrayCreator = std::make_shared<const Acts::LayerArrayCreator>(
238 lacCfg, makeActsAthenaLogger(this, std::string("LayArrCrtr"), std::string("ActsTGSvc")));
239
240 Acts::TrackingVolumeArrayCreator::Config tvcCfg;
241 auto trackingVolumeArrayCreator =
242 std::make_shared<const Acts::TrackingVolumeArrayCreator>(
243 tvcCfg, makeActsAthenaLogger(this, std::string("TrkVolArrCrtr"), std::string("ActsTGSvc")));
244
245 Acts::CylinderVolumeHelper::Config cvhConfig;
246 cvhConfig.layerArrayCreator = layerArrayCreator;
247 cvhConfig.trackingVolumeArrayCreator = trackingVolumeArrayCreator;
248
249 auto cylinderVolumeHelper =
250 std::make_shared<const Acts::CylinderVolumeHelper>(
251 cvhConfig, makeActsAthenaLogger(this, std::string("CylVolHlpr"), std::string("ActsTGSvc")));
252
253 Acts::TrackingGeometryBuilder::Config tgbConfig;
254 tgbConfig.trackingVolumeHelper = cylinderVolumeHelper;
255
256 if (m_useMaterialMap) {
257 std::shared_ptr<const Acts::IMaterialDecorator> matDeco = nullptr;
258
259 std::string matFileFullPath = PathResolverFindCalibFile(m_materialMapCalibFolder.value()+"/"+m_materialMapInputFileBase.value());
260 if (matFileFullPath.empty()) {
261 ATH_MSG_ERROR( "Material Map Input File " << m_materialMapCalibFolder.value() << "/" << m_materialMapInputFileBase.value() << " not found.");
262 return StatusCode::FAILURE;
263 }
264 ATH_MSG_INFO("Configured to use material input: " << matFileFullPath);
265
266 if (matFileFullPath.find(".json") != std::string::npos) {
267 // Set up the converter first
268 Acts::MaterialMapJsonConverter::Config jsonGeoConvConfig;
269 // Set up the json-based decorator
270 matDeco = std::make_shared<const Acts::JsonMaterialDecorator>(
271 jsonGeoConvConfig, matFileFullPath, ActsTrk::actsLevelVector(msg().level()));
272 }
273 tgbConfig.materialDecorator = matDeco;
274 }
275
276 std::array<double, 2> sctECEnvelopeZ{20_mm, 20_mm};
277
278 try {
279 // BeamPipe
280 if(m_buildBeamPipe) {
281 tgbConfig.trackingVolumeBuilders.push_back([&](const auto &gctx,
282 const auto &inner,
283 const auto &) {
284
285 Acts::CylinderVolumeBuilder::Config bpvConfig =
286 makeBeamPipeConfig(cylinderVolumeHelper);
287
288 Acts::CylinderVolumeBuilder beamPipeVolumeBuilder {
289 bpvConfig, makeActsAthenaLogger(this, std::string("BPVolBldr"), std::string("ActsTGSvc"))};
290
291 return beamPipeVolumeBuilder.trackingVolume(gctx, inner);
292 });
293 }
294
295
296
297 // PIXEL
298 if (buildSubdet.count("Pixel") > 0) {
299 tgbConfig.trackingVolumeBuilders.push_back([&](const auto &gctx,
300 const auto &inner,
301 const auto &) {
304 auto lb = std::make_shared<ActsLayerBuilder>(
305 cfg, makeActsAthenaLogger(this, std::string("PixelGMSLayBldr"), std::string("ActsTGSvc")));
306 Acts::CylinderVolumeBuilder::Config cvbConfig;
307 cvbConfig.layerEnvelopeR = {3_mm, 3_mm};
308 cvbConfig.layerEnvelopeZ = 1_mm;
309 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
310 cvbConfig.volumeName = "Pixel";
311 cvbConfig.layerBuilder = lb;
312 cvbConfig.buildToRadiusZero = !m_buildBeamPipe;
313
314 Acts::CylinderVolumeBuilder cvb(
315 cvbConfig, makeActsAthenaLogger(this, std::string("CylVolBldr"), std::string("ActsTGSvc")));
316
317 return cvb.trackingVolume(gctx, inner);
318 });
319 }
320
321 // ITK PIXEL
322 if (buildSubdet.count("ITkPixel") > 0) {
323 tgbConfig.trackingVolumeBuilders.push_back(
324 [&](const auto &gctx, const auto &inner, const auto &) {
327 cfg.objDebugOutput = m_objDebugOutput;
328 cfg.doEndcapLayerMerging = true;
329 cfg.passiveBarrelLayerRadii = m_passiveITkInnerPixelBarrelLayerRadii;
330 cfg.passiveBarrelLayerHalflengthZ = m_passiveITkInnerPixelBarrelLayerHalflengthZ;
331 cfg.passiveBarrelLayerThickness = m_passiveITkInnerPixelBarrelLayerThickness;
332 auto lb = std::make_shared<ActsLayerBuilder>(
333 cfg, makeActsAthenaLogger(this, std::string("ITkPxInLb"), std::string("ActsTGSvc")));
334
335 Acts::CylinderVolumeBuilder::Config cvbConfig;
336 cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
337 cvbConfig.layerEnvelopeZ = 1_mm;
338 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
339 cvbConfig.volumeName = "ITkPixelInner";
340 cvbConfig.layerBuilder = lb;
341 cvbConfig.buildToRadiusZero = !m_buildBeamPipe;
342
343 Acts::CylinderVolumeBuilder cvb(
344 cvbConfig,
345 makeActsAthenaLogger(this, std::string("CylVolBldr"), std::string("ActsTGSvc")));
346
347 return cvb.trackingVolume(gctx, inner);
348 });
349
350 tgbConfig.trackingVolumeBuilders.push_back(
351 [&](const auto &gctx, const auto &inner, const auto &) {
354 cfg.objDebugOutput = m_objDebugOutput;
355 cfg.doEndcapLayerMerging = false;
356 cfg.passiveBarrelLayerRadii = m_passiveITkOuterPixelBarrelLayerRadii;
357 cfg.passiveBarrelLayerHalflengthZ = m_passiveITkOuterPixelBarrelLayerHalflengthZ;
358 cfg.passiveBarrelLayerThickness = m_passiveITkOuterPixelBarrelLayerThickness;
359 auto lb = std::make_shared<ActsLayerBuilder>(
360 cfg, makeActsAthenaLogger(this, std::string("ITkPxOtLb"), std::string("ActsTGSvc")));
361
362 Acts::CylinderVolumeBuilder::Config cvbConfig;
363 cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
364 cvbConfig.layerEnvelopeZ = 1_mm;
365 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
366 cvbConfig.volumeName = "ITkPixelOuter";
367 cvbConfig.layerBuilder = lb;
368 cvbConfig.buildToRadiusZero = false;
369 cvbConfig.checkRingLayout = true;
370 cvbConfig.ringTolerance = 10_mm;
371
372 Acts::CylinderVolumeBuilder cvb(
373 cvbConfig,
374 makeActsAthenaLogger(this, std::string("CylVolBldr"), std::string("ActsTGSvc")));
375
376 return cvb.trackingVolume(gctx, inner);
377 });
378 }
379
380 // ITK STRIP
381 if (buildSubdet.count("ITkStrip") > 0) {
382 tgbConfig.trackingVolumeBuilders.push_back(
383 [&](const auto &gctx, const auto &inner, const auto &) {
386 cfg.objDebugOutput = m_objDebugOutput;
387 cfg.passiveBarrelLayerRadii = m_passiveITkStripBarrelLayerRadii;
388 cfg.passiveBarrelLayerHalflengthZ = m_passiveITkStripBarrelLayerHalflengthZ;
389 cfg.passiveBarrelLayerThickness = m_passiveITkStripBarrelLayerThickness;
390 auto lb = std::make_shared<ActsLayerBuilder>(
391 cfg, makeActsAthenaLogger(this, std::string("ITkStripLB"), std::string("ActsTGSvc")));
392
393 Acts::CylinderVolumeBuilder::Config cvbConfig;
394 cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
395 cvbConfig.layerEnvelopeZ = 1_mm;
396 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
397 cvbConfig.volumeName = "ITkStrip";
398 cvbConfig.layerBuilder = lb;
399 cvbConfig.buildToRadiusZero =
400 buildSubdet.count("ITkPixel") == 0 && !m_buildBeamPipe;
401
402 Acts::CylinderVolumeBuilder cvb(
403 cvbConfig,
404 makeActsAthenaLogger(this, std::string("CylVolBldr"), std::string("ActsTGSvc")));
405
406 return cvb.trackingVolume(gctx, inner);
407 });
408 }
409
410 bool buildSCT = buildSubdet.count("SCT") > 0;
411 bool buildTRT = buildSubdet.count("TRT") > 0;
412
413 if (buildSCT && buildTRT) {
414 // building both we need to take care
415 tgbConfig.trackingVolumeBuilders.push_back(
416 [&](const auto &gctx, const auto &inner, const auto &) {
419 cfg.endcapEnvelopeZ = sctECEnvelopeZ;
420 auto sct_lb = std::make_shared<ActsLayerBuilder>(
421 cfg, makeActsAthenaLogger(this, std::string("SCTGMSLayBldr"), std::string("ActsTGSvc")));
422
423 auto trt_lb = makeStrawLayerBuilder(p_TRTManager);
424
425 return makeSCTTRTAssembly(gctx, *sct_lb, *trt_lb,
426 *cylinderVolumeHelper, inner);
427 });
428
429 } else if (buildSCT) {
430 tgbConfig.trackingVolumeBuilders.push_back(
431 [&](const auto &gctx, const auto &inner, const auto &) {
433 lbCfg.mode = ActsLayerBuilder::Mode::SCT;
434 lbCfg.endcapEnvelopeZ = sctECEnvelopeZ;
435 auto lb = std::make_shared<ActsLayerBuilder>(
436 lbCfg,
437 makeActsAthenaLogger(this, std::string("SCTGMSLayBldr"), std::string("ActsTGSvc")));
438
439 Acts::CylinderVolumeBuilder::Config cvbConfig;
440 cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
441 cvbConfig.layerEnvelopeZ = 2_mm;
442 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
443 cvbConfig.volumeName = "SCT";
444 cvbConfig.layerBuilder = lb;
445 cvbConfig.buildToRadiusZero = false;
446
447 Acts::CylinderVolumeBuilder cvb(
448 cvbConfig,
449 makeActsAthenaLogger(this, std::string("SCTCylVolBldr"), std::string("ActsTGSvc")));
450
451 return cvb.trackingVolume(gctx, inner);
452 });
453 } else if (buildTRT) {
454 tgbConfig.trackingVolumeBuilders.push_back(
455 [&](const auto &gctx, const auto &inner, const auto &) {
457 Acts::CylinderVolumeBuilder::Config cvbConfig;
458 cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
459 cvbConfig.layerEnvelopeZ = 2_mm;
460 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
461 cvbConfig.volumeName = "TRT";
462 cvbConfig.layerBuilder = lb;
463 cvbConfig.buildToRadiusZero = false;
464
465 Acts::CylinderVolumeBuilder cvb(
466 cvbConfig,
467 makeActsAthenaLogger(this, std::string("TRTCylVolBldr"), std::string("ActsTGSvc")));
468
469 return cvb.trackingVolume(gctx, inner);
470 });
471 }
472
473 //HGTD
474 if(buildSubdet.count("HGTD") > 0) {
475 tgbConfig.trackingVolumeBuilders.push_back(
476 [&](const auto &gctx, const auto &inner, const auto &) {
477 auto lb = makeHGTDLayerBuilder(p_HGTDManager); //using ActsHGTDLayerBuilder
478 Acts::CylinderVolumeBuilder::Config cvbConfig;
479 cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
480 cvbConfig.layerEnvelopeZ = 1_mm;
481 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
482 cvbConfig.volumeName = "HGTD";
483 cvbConfig.layerBuilder = lb;
484 cvbConfig.buildToRadiusZero = false;
485
486 Acts::CylinderVolumeBuilder cvb(
487 cvbConfig,
488 makeActsAthenaLogger(this, std::string("HGTDCylVolBldr"), std::string("ActsTGSvc")));
489
490 return cvb.trackingVolume(gctx, inner);
491 });
492 }
493
494 // Calo
495 if (m_caloVolumeBuilder.isEnabled()) {
496 tgbConfig.trackingVolumeBuilders.push_back(
497 [&](const auto &gctx, const auto &inner, const auto &) {
498 return m_caloVolumeBuilder->trackingVolume(gctx, inner, nullptr);
499 });
500 }
501
502 } catch (const std::exception &e) {
503 ATH_MSG_ERROR("Encountered error when building Acts tracking geometry");
504 ATH_MSG_ERROR(e.what());
505 return StatusCode::FAILURE;
506 }
507
508 auto trackingGeometryBuilder =
509 std::make_shared<const Acts::TrackingGeometryBuilder>(
510 tgbConfig, makeActsAthenaLogger(this, std::string("TrkGeomBldr"), std::string("ActsTGSvc")));
511
512 ATH_MSG_VERBOSE("Begin building process");
514 trackingGeometryBuilder->trackingGeometry(getNominalContext().context());
515 ATH_MSG_VERBOSE("Building process completed");
516
517 if (!m_trackingGeometry) {
518 ATH_MSG_ERROR("No ACTS tracking geometry was built. Cannot proceeed");
519 return StatusCode::FAILURE;
520 }
521
522
524 ATH_MSG_INFO("Running extra consistency check! (this is SLOW)");
525 if(!runConsistencyChecks()) {
526 ATH_MSG_ERROR("Consistency check has failed! Geometry is not consistent");
527 return StatusCode::FAILURE;
528 }
529 }
530
532 if (!m_detIdMap) {
533 return StatusCode::FAILURE;
534 }
535
536
537 ATH_MSG_INFO("Acts TrackingGeometry construction completed");
538
539 return StatusCode::SUCCESS;
540}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
const InDetDD::TRT_DetectorManager * p_TRTManager
Gaudi::Property< std::vector< std::string > > m_buildSubdetectors
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.
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< float > > m_passiveITkStripBarrelLayerRadii
Gaudi::Property< std::vector< float > > m_passiveITkStripBarrelLayerThickness
std::shared_ptr< const Acts::ILayerBuilder > makeHGTDLayerBuilder(const HGTD_DetectorManager *manager)
std::unique_ptr< const ActsTrk::DetectorElementToActsGeometryIdMap > m_detIdMap
Gaudi::Property< bool > m_printGeo
Print the assembled tracking geometry after building.
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)
ToolHandleArray< ActsTrk::IBlueprintNodeBuilder > m_blueprintNodeBuilders
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...
Gaudi::Property< std::vector< float > > m_passiveITkOuterPixelBarrelLayerRadii
Gaudi::Property< std::vector< float > > m_passiveITkInnerPixelBarrelLayerHalflengthZ
Gaudi::Property< std::vector< float > > m_passiveITkStripBarrelLayerHalflengthZ
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)
int lb
Definition globals.cxx:23
static Root::TMsgLogger logger("iLumiCalc")
Acts::Logging::Level actsLevelVector(MSG::Level lvl)
MsgStream & msg
Definition testRead.cxx:32

◆ makeBeamPipeConfig()

Acts::CylinderVolumeBuilder::Config ActsTrk::TrackingGeometrySvc::makeBeamPipeConfig ( std::shared_ptr< const Acts::CylinderVolumeHelper > cvh) const
private

Definition at line 1154 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

1155 {
1156
1157 // adapted from InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilder.cxx
1158
1159 PVConstLink beamPipeTopVolume = p_beamPipeMgr->getTreeTop(0);
1160
1161 if (p_beamPipeMgr->getNumTreeTops() == 1){
1162 beamPipeTopVolume = p_beamPipeMgr->getTreeTop(0)->getChildVol(0)->getChildVol(0);
1163 }
1164
1165 Acts::Transform3 beamPipeTransform;
1166 beamPipeTransform.setIdentity();
1167
1168 beamPipeTransform = Acts::Translation3(beamPipeTopVolume->getX().translation());
1169
1170 double beamPipeRadius = 20;
1171
1172 const GeoLogVol* beamPipeLogVolume = beamPipeTopVolume->getLogVol();
1173 const GeoTube* beamPipeTube = nullptr;
1174
1175
1176 if (beamPipeLogVolume == nullptr) {
1177 ATH_MSG_ERROR("Beam pip volume has no log volume");
1178 throw std::runtime_error("Beam pip volume has no log volume");
1179 }
1180 // get the geoShape and translate
1181 beamPipeTube = dynamic_cast<const GeoTube*>(beamPipeLogVolume->getShape());
1182 if (beamPipeTube == nullptr){
1183 ATH_MSG_ERROR("BeamPipeLogVolume was not of type GeoTube");
1184 throw std::runtime_error{"BeamPipeLogVolume was not of type GeoTube"};
1185 }
1186
1187 for(unsigned int i=0;i<beamPipeTopVolume->getNChildVols();i++) {
1188
1189 if(beamPipeTopVolume->getNameOfChildVol(i) == "SectionC03"){
1190
1191 PVConstLink childTopVolume = beamPipeTopVolume->getChildVol(i);
1192 const GeoLogVol* childLogVolume = childTopVolume->getLogVol();
1193 const GeoTube* childTube = nullptr;
1194
1195 if (childLogVolume){
1196 childTube = dynamic_cast<const GeoTube*>(childLogVolume->getShape());
1197 if (childTube){
1198 beamPipeRadius = 0.5 * (childTube->getRMax()+childTube->getRMin());
1199 }
1200 }
1201
1202 break; // Exit loop after SectionC03 is found
1203 }
1204
1205 } // Loop over child volumes
1206
1207 ATH_MSG_VERBOSE("BeamPipe constructed from Database: translation (yes) - radius "
1208 << ( beamPipeTube ? "(yes)" : "(no)") << " - r = " << beamPipeRadius );
1209
1210 ATH_MSG_VERBOSE("BeamPipe shift estimated as : " << Amg::toString(beamPipeTransform.translation()));
1211
1212 Acts::CylinderVolumeBuilder::Config cfg;
1213
1214 Acts::PassiveLayerBuilder::Config bplConfig;
1215 bplConfig.layerIdentification = "BeamPipe";
1216 bplConfig.centralLayerRadii = {beamPipeRadius * 1_mm};
1217 bplConfig.centralLayerHalflengthZ = {3000_mm};
1218 bplConfig.centralLayerThickness = {1_mm};
1219 auto beamPipeBuilder = std::make_shared<const Acts::PassiveLayerBuilder>(
1220 bplConfig, makeActsAthenaLogger(this, std::string("BPLayBldr"), std::string("ActsTGSvc")));
1221
1222 // create the volume for the beam pipe
1223 cfg.trackingVolumeHelper = cvh;
1224 cfg.volumeName = "BeamPipe";
1225 cfg.layerBuilder = beamPipeBuilder;
1226 cfg.layerEnvelopeR = {1_mm, 1_mm};
1227 cfg.buildToRadiusZero = true;
1228
1229 return cfg;
1230}
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.

◆ makeHGTDLayerBuilder()

std::shared_ptr< const Acts::ILayerBuilder > ActsTrk::TrackingGeometrySvc::makeHGTDLayerBuilder ( const HGTD_DetectorManager * manager)
private

Definition at line 808 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

809 {
810
811 std::string managerName = manager->getName();
812 auto matcher = [](const Acts::GeometryContext & /*gctx*/,
813 Acts::AxisDirection /*aDir*/, const Acts::Surface * /*aS*/,
814 const Acts::Surface *
815 /*bS*/) -> bool { return false; };
816
817 Acts::SurfaceArrayCreator::Config sacCfg;
818 sacCfg.surfaceMatcher = matcher;
819 sacCfg.doPhiBinningOptimization = false;
820
821 auto surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>(
822 sacCfg,
823 makeActsAthenaLogger(this, managerName + "SrfArrCrtr", std::string("ActsTGSvc")));
824 Acts::LayerCreator::Config lcCfg;
825 lcCfg.surfaceArrayCreator = surfaceArrayCreator;
826 auto layerCreator = std::make_shared<Acts::LayerCreator>(
827 lcCfg, makeActsAthenaLogger(this, managerName + "LayCrtr", std::string("ActsTGSvc")));
828
829 ActsHGTDLayerBuilder::Config cfg;
830 cfg.mng = static_cast<const HGTD_DetectorManager *>(manager);
831 cfg.elementStore = m_elementStore;
832 cfg.layerCreator = layerCreator;
833 cfg.idHelper = m_HGTD_idHelper;
834 cfg.numberOfBinsFactor = m_numberOfBinsFactor;
835 return std::make_shared<const ActsHGTDLayerBuilder>(
836 cfg, makeActsAthenaLogger(this, managerName + "GMSLayBldr", std::string("ActsTGSvc")));
837}
Gaudi::Property< double > m_numberOfBinsFactor
controls how many bins are created for the sensitive surface grid.
const Matcher_t & matcher() const
Return the matcher object.

◆ makeLayerBuilderConfig()

ActsLayerBuilder::Config ActsTrk::TrackingGeometrySvc::makeLayerBuilderConfig ( const InDetDD::InDetDetectorManager * manager)
private

Definition at line 839 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

840 {
841 using enum Acts::AxisDirection;
842
843 std::string managerName = manager->getName();
844
845 std::shared_ptr<const Acts::ILayerBuilder> gmLayerBuilder;
846 auto matcher = [](const Acts::GeometryContext & /*gctx*/,
847 Acts::AxisDirection aDir, const Acts::Surface *aS,
848 const Acts::Surface *bS) -> bool {
849 auto* a = getActsDetectorElement(aS);
850 auto* b = getActsDetectorElement(bS);
851
852 if ((not a) or (not b)) {
853 throw std::runtime_error(
854 "Cast of surface associated element to ActsDetectorElement failed "
855 "in TrackingGeometrySvc::makeVolumeBuilder");
856 }
857
858 IdentityHelper idA = a->identityHelper();
859 IdentityHelper idB = b->identityHelper();
860
861 // check if same bec
862 // can't be same if not
863 if (idA.bec() != idB.bec())
864 return false;
865
866 if (aDir == AxisPhi) {
867 // std::cout << idA.phi_module() << " <-> " << idB.phi_module() <<
868 // std::endl;
869 return idA.phi_module() == idB.phi_module();
870 }
871
872 if (aDir == AxisZ) {
873 return (idA.eta_module() == idB.eta_module()) &&
874 (idA.layer_disk() == idB.layer_disk()) && (idA.bec() == idB.bec());
875 }
876
877 if (aDir == AxisR) {
878 return (idA.eta_module() == idB.eta_module()) &&
879 (idA.layer_disk() == idB.layer_disk()) && (idB.bec() == idA.bec());
880 }
881
882 return false;
883 };
884
885 Acts::SurfaceArrayCreator::Config sacCfg;
886 sacCfg.surfaceMatcher = matcher;
887
888 auto surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>(
889 sacCfg,
890 makeActsAthenaLogger(this, managerName + "SrfArrCrtr", std::string("ActsTGSvc")));
891 Acts::LayerCreator::Config lcCfg;
892 lcCfg.surfaceArrayCreator = surfaceArrayCreator;
893 auto layerCreator = std::make_shared<Acts::LayerCreator>(
894 lcCfg, makeActsAthenaLogger(this, managerName + "LayCrtr", std::string("ActsTGSvc")));
895
896 ActsLayerBuilder::Config cfg;
897 cfg.surfaceMatcher = matcher;
898
899 // set bins from configuration
900 if (m_barrelMaterialBins.size() != 2) {
901 throw std::invalid_argument("Number of barrel material bin counts != 2");
902 }
903 std::vector<size_t> brlBins(m_barrelMaterialBins);
904 cfg.barrelMaterialBins = {brlBins.at(0), brlBins.at(1)};
905
906 if (m_endcapMaterialBins.size() != 2) {
907 throw std::invalid_argument("Number of endcap material bin counts != 2");
908 }
909 std::vector<size_t> ecBins(m_endcapMaterialBins);
910 cfg.endcapMaterialBins = {ecBins.at(0), ecBins.at(1)};
911
912 cfg.mng = static_cast<const InDetDD::SiDetectorManager *>(manager);
913 // use class member element store
914 cfg.elementStore = m_elementStore;
915 cfg.layerCreator = layerCreator;
916
917 cfg.numberOfBinsFactor = m_numberOfBinsFactor;
918 cfg.numberOfInnermostLayerBinsFactor = m_numberOfInnermostLayerBinsFactor;
919
920 // gmLayerBuilder = std::make_shared<const ActsLayerBuilder>(
921 // cfg, makeActsAthenaLogger(this, managerName + "GMLayBldr",
922 // "ActsTGSvc"));
923
924 // return gmLayerBuilder;
925 return cfg;
926}
static Double_t a
Gaudi::Property< std::vector< size_t > > m_endcapMaterialBins
Gaudi::Property< std::vector< size_t > > m_barrelMaterialBins
Gaudi::Property< double > m_numberOfInnermostLayerBinsFactor
Special treatment for the innermost pixel layer to have more control on bin size to account for shall...
int phi_module() const
int eta_module() const
int layer_disk() const

◆ makeSCTTRTAssembly()

std::shared_ptr< Acts::TrackingVolume > ActsTrk::TrackingGeometrySvc::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 )
private

Definition at line 929 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

932 {
933 ATH_MSG_VERBOSE("Building SCT+TRT assembly");
934
935 Acts::CylinderVolumeBuilder::Config cvbCfg;
936 Acts::CylinderVolumeBuilder cvb(
937 cvbCfg, makeActsAthenaLogger(this, std::string("SCTTRTCVB"), std::string("ActsTGSvc")));
938
939 ATH_MSG_VERBOSE("Making SCT negative layers: ");
940 Acts::VolumeConfig sctNegEC =
941 cvb.analyzeContent(gctx, sct_lb.negativeLayers(gctx), {});
942 ATH_MSG_VERBOSE("Making SCT positive layers: ");
943 Acts::VolumeConfig sctPosEC =
944 cvb.analyzeContent(gctx, sct_lb.positiveLayers(gctx), {});
945 ATH_MSG_VERBOSE("Making SCT central layers: ");
946 Acts::VolumeConfig sctBrl =
947 cvb.analyzeContent(gctx, sct_lb.centralLayers(gctx), {});
948
949 ATH_MSG_VERBOSE("Making TRT negative layers: ");
950 Acts::VolumeConfig trtNegEC =
951 cvb.analyzeContent(gctx, trt_lb.negativeLayers(gctx), {});
952 ATH_MSG_VERBOSE("Making TRT positive layers: ");
953 Acts::VolumeConfig trtPosEC =
954 cvb.analyzeContent(gctx, trt_lb.positiveLayers(gctx), {});
955 ATH_MSG_VERBOSE("Making TRT central layers: ");
956 Acts::VolumeConfig trtBrl =
957 cvb.analyzeContent(gctx, trt_lb.centralLayers(gctx), {});
958
959 // synchronize trt
960
961 double absZMinEC = std::min(std::abs(trtNegEC.zMax), std::abs(trtPosEC.zMin));
962 double absZMaxEC = std::max(std::abs(trtNegEC.zMin), std::abs(trtPosEC.zMax));
963
964 trtNegEC.zMin = -absZMaxEC;
965 trtNegEC.zMax = -absZMinEC;
966 trtPosEC.zMin = absZMinEC;
967 trtPosEC.zMax = absZMaxEC;
968
969 using CVBBV = Acts::CylinderVolumeBounds::BoundValues;
970
971 // if pixel is present, shrink SCT volumes in R
972 bool isSCTSmallerInZ = false;
973 if (pixel) {
974 ATH_MSG_VERBOSE("Shrinking SCT in R (and maybe in increase size in Z) to fit around Pixel");
975 auto pixelBounds = dynamic_cast<const Acts::CylinderVolumeBounds *>(
976 &pixel->volumeBounds());
977 double sctNegECzMin = std::min(sctNegEC.zMin, -pixelBounds->get(CVBBV::eHalfLengthZ));
978 double sctPosECzMax = std::max(sctPosEC.zMax, pixelBounds->get(CVBBV::eHalfLengthZ));
979
980 ATH_MSG_VERBOSE("- SCT +-EC.rMin: " << sctNegEC.rMin << " -> " << pixelBounds->get(CVBBV::eMaxR));
981 ATH_MSG_VERBOSE("- SCT BRL.rMin: " << sctBrl.rMin << " -> " << pixelBounds->get(CVBBV::eMaxR));
982 ATH_MSG_VERBOSE("- SCT EC.zMin: " << sctNegEC.zMin << " -> " << sctNegECzMin);
983 ATH_MSG_VERBOSE("- SCT EC.zMax: " << sctPosEC.zMax << " -> " << sctPosECzMax);
984
985 sctNegEC.rMin = pixelBounds->get(CVBBV::eMaxR);
986 sctPosEC.rMin = pixelBounds->get(CVBBV::eMaxR);
987 sctBrl.rMin = pixelBounds->get(CVBBV::eMaxR);
988
989 isSCTSmallerInZ = sctPosEC.zMax < pixelBounds->get(CVBBV::eHalfLengthZ);
990
991 sctNegEC.zMin = sctNegECzMin;
992 sctPosEC.zMax = sctPosECzMax;
993
994
995 } else {
996 ATH_MSG_VERBOSE("Pixel is not configured, not wrapping");
997 }
998
999 ATH_MSG_VERBOSE("SCT Volume Configuration:");
1000 ATH_MSG_VERBOSE("- SCT::NegativeEndcap: " << sctNegEC.layers.size()
1001 << " layers, "
1002 << sctNegEC.toString());
1003 ATH_MSG_VERBOSE("- SCT::Barrel: " << sctBrl.layers.size() << " layers, "
1004 << sctBrl.toString());
1005 ATH_MSG_VERBOSE("- SCT::PositiveEncap: " << sctPosEC.layers.size()
1006 << " layers, "
1007 << sctPosEC.toString());
1008
1009 ATH_MSG_VERBOSE("TRT Volume Configuration:");
1010 ATH_MSG_VERBOSE("- TRT::NegativeEndcap: " << trtNegEC.layers.size()
1011 << " layers, "
1012 << trtNegEC.toString());
1013 ATH_MSG_VERBOSE("- TRT::Barrel: " << trtBrl.layers.size() << " layers, "
1014 << trtBrl.toString());
1015 ATH_MSG_VERBOSE("- TRT::PositiveEncap: " << trtPosEC.layers.size()
1016 << " layers, "
1017 << trtPosEC.toString());
1018
1019 // harmonize SCT BRL <-> EC, normally the CVB does this, but we're skipping
1020 // that
1021 sctBrl.zMax = (sctBrl.zMax + sctPosEC.zMin) / 2.;
1022 sctBrl.zMin = -sctBrl.zMax;
1023
1024 // and now harmonize everything
1025 // inflate TRT Barrel to match SCT
1026 trtBrl.zMin = sctBrl.zMin;
1027 trtBrl.zMax = sctBrl.zMax;
1028
1029 // extend TRT endcaps outwards z so they match SCT
1030 trtNegEC.zMin = sctNegEC.zMin;
1031 trtPosEC.zMax = sctPosEC.zMax;
1032
1033 // extend endcap in z so it touches barrel
1034 trtNegEC.zMax = trtBrl.zMin;
1035 sctNegEC.zMax = trtBrl.zMin;
1036 trtPosEC.zMin = trtBrl.zMax;
1037 sctPosEC.zMin = trtBrl.zMax;
1038
1039 // extend SCT in R so they touch TRT barel
1040 sctBrl.rMax = trtBrl.rMin;
1041 sctNegEC.rMax = trtNegEC.rMin;
1042 sctPosEC.rMax = trtPosEC.rMin;
1043
1044 // extend TRT endcaps in r to that of Barrel
1045 trtNegEC.rMax = trtBrl.rMax;
1046 trtPosEC.rMax = trtBrl.rMax;
1047
1048 ATH_MSG_VERBOSE("Dimensions after synchronization between SCT and TRT");
1049 ATH_MSG_VERBOSE("SCT Volume Configuration:");
1050 ATH_MSG_VERBOSE("- SCT::NegativeEndcap: " << sctNegEC.layers.size()
1051 << " layers, "
1052 << sctNegEC.toString());
1053 ATH_MSG_VERBOSE("- SCT::Barrel: " << sctBrl.layers.size() << " layers, "
1054 << sctBrl.toString());
1055 ATH_MSG_VERBOSE("- SCT::PositiveEncap: " << sctPosEC.layers.size()
1056 << " layers, "
1057 << sctPosEC.toString());
1058
1059 ATH_MSG_VERBOSE("TRT Volume Configuration:");
1060 ATH_MSG_VERBOSE("- TRT::NegativeEndcap: " << trtNegEC.layers.size()
1061 << " layers, "
1062 << trtNegEC.toString());
1063 ATH_MSG_VERBOSE("- TRT::Barrel: " << trtBrl.layers.size() << " layers, "
1064 << trtBrl.toString());
1065 ATH_MSG_VERBOSE("- TRT::PositiveEncap: " << trtPosEC.layers.size()
1066 << " layers, "
1067 << trtPosEC.toString());
1068
1069 auto makeTVol = [&](const auto &vConf, const auto &name) {
1070 return cvh.createTrackingVolume(gctx, vConf.layers, {},
1071 nullptr, // no material
1072 vConf.rMin, vConf.rMax, vConf.zMin,
1073 vConf.zMax, name);
1074 };
1075
1076 // now turn them into actual TrackingVolumes
1077 auto tvSctNegEC = makeTVol(sctNegEC, "SCT::NegativeEndcap");
1078 auto tvSctBrl = makeTVol(sctBrl, "SCT::Barrel");
1079 auto tvSctPosEC = makeTVol(sctPosEC, "SCT::PositiveEndcap");
1080
1081 auto tvTrtNegEC = makeTVol(trtNegEC, "TRT::NegativeEndcap");
1082 auto tvTrtBrl = makeTVol(trtBrl, "TRT::Barrel");
1083 auto tvTrtPosEC = makeTVol(trtPosEC, "TRT::PositiveEndcap");
1084
1085 // combine the endcaps and the barrels, respetively
1086 auto negEC =
1087 cvh.createContainerTrackingVolume(gctx, {tvSctNegEC, tvTrtNegEC});
1088 auto posEC =
1089 cvh.createContainerTrackingVolume(gctx, {tvSctPosEC, tvTrtPosEC});
1090 auto barrel = cvh.createContainerTrackingVolume(gctx, {tvSctBrl, tvTrtBrl});
1091
1092 // and now combine all of those into one container for the assembly
1093
1094 auto container =
1095 cvh.createContainerTrackingVolume(gctx, {negEC, barrel, posEC});
1096
1097 // if pixel is present, add positive and negative gap volumes so we can wrap
1098 // it all
1099 if (pixel) {
1100 auto containerBounds = dynamic_cast<const Acts::CylinderVolumeBounds *>(
1101 &container->volumeBounds());
1102 auto pixelBounds = dynamic_cast<const Acts::CylinderVolumeBounds *>(
1103 &pixel->volumeBounds());
1104 std::vector<std::shared_ptr<Acts::TrackingVolume>> noVolumes;
1105
1106 if(!isSCTSmallerInZ) {
1107 // pixel is smaller in z, need gap volumes
1108 auto posGap = cvh.createGapTrackingVolume(
1109 gctx, noVolumes,
1110 nullptr, // no material,
1111 pixelBounds->get(CVBBV::eMinR), pixelBounds->get(CVBBV::eMaxR),
1112 pixelBounds->get(CVBBV::eHalfLengthZ),
1113 containerBounds->get(CVBBV::eHalfLengthZ),
1114 0, // material layers,
1115 true, // cylinder
1116 "Pixel::PositiveGap");
1117 auto negGap = cvh.createGapTrackingVolume(
1118 gctx, noVolumes,
1119 nullptr, // no material,
1120 pixelBounds->get(CVBBV::eMinR), pixelBounds->get(CVBBV::eMaxR),
1121 -containerBounds->get(CVBBV::eHalfLengthZ),
1122 -pixelBounds->get(CVBBV::eHalfLengthZ),
1123 0, // material layers,
1124 true, // cylinder
1125 "Pixel::NegativeGap");
1126
1127 auto pixelContainer =
1128 cvh.createContainerTrackingVolume(gctx, {negGap, pixel, posGap});
1129 // and now create one container that contains Pixel+SCT+TRT
1130 container =
1131 cvh.createContainerTrackingVolume(gctx, {pixelContainer, container});
1132 }
1133 else {
1134 // wrap the pixel directly
1135 container =
1136 cvh.createContainerTrackingVolume(gctx, {pixel, container});
1137 }
1138
1139 }
1140
1141 return container;
1142}
Acts::CylinderVolumeBounds::BoundValues CVBBV
const SG::AuxVectorData * container() const
Return the container holding this element.

◆ makeStrawLayerBuilder()

std::shared_ptr< const Acts::ILayerBuilder > ActsTrk::TrackingGeometrySvc::makeStrawLayerBuilder ( const InDetDD::InDetDetectorManager * manager)
private

Definition at line 777 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

778 {
779
780 std::string managerName = manager->getName();
781 auto matcher = [](const Acts::GeometryContext & /*gctx*/,
782 Acts::AxisDirection /*aDir*/, const Acts::Surface * /*aS*/,
783 const Acts::Surface *
784 /*bS*/) -> bool { return false; };
785
786 Acts::SurfaceArrayCreator::Config sacCfg;
787 sacCfg.surfaceMatcher = matcher;
788 sacCfg.doPhiBinningOptimization = false;
789
790 auto surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>(
791 sacCfg,
792 makeActsAthenaLogger(this, managerName + "SrfArrCrtr", std::string("ActsTGSvc")));
793 Acts::LayerCreator::Config lcCfg;
794 lcCfg.surfaceArrayCreator = surfaceArrayCreator;
795 auto layerCreator = std::make_shared<Acts::LayerCreator>(
796 lcCfg, makeActsAthenaLogger(this, managerName + "LayCrtr", std::string("ActsTGSvc")));
797
798 ActsStrawLayerBuilder::Config cfg;
799 cfg.mng = static_cast<const InDetDD::TRT_DetectorManager *>(manager);
800 cfg.elementStore = m_elementStore;
801 cfg.layerCreator = layerCreator;
802 cfg.idHelper = m_TRT_idHelper;
803 return std::make_shared<const ActsStrawLayerBuilder>(
804 cfg, makeActsAthenaLogger(this, managerName + "GMSLayBldr", std::string("ActsTGSvc")));
805}

◆ populateAlignmentStore()

unsigned int ActsTrk::TrackingGeometrySvc::populateAlignmentStore ( ActsTrk::DetectorAlignStore & store) const
override

Loops through the volumes of the tracking geometry and caches the aligned transforms in the store.

Definition at line 1144 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

1144 {
1145 ATH_MSG_DEBUG("Populate the alignment store with all detector elements");
1146 TrackingGeoAlignVisitor visitor{store};
1147 m_trackingGeometry->apply(visitor);
1148 ATH_MSG_DEBUG("Populated with " << visitor.alignedObjects() << " elements");
1149 return visitor.alignedObjects();
1150}
TestStore store
Definition TestStore.cxx:23

◆ runConsistencyChecks()

bool ActsTrk::TrackingGeometrySvc::runConsistencyChecks ( ) const
private

Definition at line 544 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

544 {
545 bool result = true;
546
547 std::vector<Acts::Vector2> localPoints;
548 localPoints.reserve(m_consistencyCheckPoints);
549 std::mt19937 gen;
550 std::uniform_real_distribution<> dist(0.0, 1.0);
551
552 std::optional<std::ofstream> os;
553 if(!m_consistencyCheckOutput.empty()){
554 os = std::ofstream{m_consistencyCheckOutput};
555 if(!os->good()) {
556 throw std::runtime_error{"Failed to open consistency check output file"};
557 }
558 }
559
560 if(os) {
561 (*os) << "geo_id,vol_id,lay_id,sen_id,type,acts_loc0,acts_loc1,acts_inside,trk_loc0,trk_loc1,trk_inside,x,y,z,g2l_loc0,g2l_loc1,trk_x,trk_y,trk_z" << std::endl;
562 }
563 for(size_t i=0;i<m_consistencyCheckPoints;i++) {
564 localPoints.emplace_back(dist(gen), dist(gen));
565 }
566
567 Acts::GeometryContext gctx = getNominalContext().context();
568
569 size_t nTotalSensors = 0;
570 std::array<size_t,3> nInconsistent{0,0,0};
571 size_t nMismatchedCenters = 0;
572 size_t nMismatchedNormals = 0;
573
574 // Comparison of Eigen vectors, similar to a.isApprox(b), but use absolute comparison to also work with zero vectors.
575 // All values will be mm or radians, so 1e-5 is a reasonable precision.
576 auto isApprox = [](auto& a, auto& b) -> bool {
577 return ((a - b).array().abs() < 1e-5).all();
578 };
579
580 m_trackingGeometry->visitSurfaces([&](const Acts::Surface *surface) {
581 nTotalSensors++;
582 const auto* actsDetElem = getActsDetectorElement(surface);
583 if(actsDetElem == nullptr) {
584 ATH_MSG_ERROR("Invalid detector element found");
585 result = false;
586 return;
587 }
588 const auto* siDetElem = dynamic_cast<const InDetDD::SiDetectorElement*>(actsDetElem->upstreamDetectorElement());
589 if(siDetElem == nullptr) {
590 return;
591 }
592
593 const auto* regSurface = dynamic_cast<const Acts::RegularSurface*>(surface);
594 const auto& trkSurface = siDetElem->surface();
595 if(regSurface == nullptr) {
596 ATH_MSG_ERROR("Invalid surface found");
597 result = false;
598 return;
599 }
600
601 Acts::Vector3 center{regSurface->center(gctx)};
602 Amg::Vector3D trkCenter{trkSurface.center()};
603 if (/* auto *b = */ dynamic_cast<const Acts::AnnulusBounds *>(&surface->bounds()))
604 {
605 // // Acts::AnnulusBounds defines center() as center of whole disc, so get it from the bounds
606 // Acts::Vector2 locCenter{0.5 * (b->rMin() + b->rMax()), 0.5 * (b->phiMin() + b->phiMax())};
607 // center = surface->localToGlobal(gctx, locCenter, Acts::Vector3::Zero());
608 center.head<2>() = trkCenter.head<2>(); // that doesn't (quite) work for xy, so just pass that check
609 }
610
611 if(!isApprox(trkCenter, center)) {
612 std::string trkName;
613 if (auto idHelper = siDetElem->getIdHelper())
614 {
615 trkName = idHelper->show_to_string(siDetElem->identify());
616 }
617 ATH_MSG_WARNING("Acts surface "
618 << surface->geometryId()
619 << " center (" << center[0] << ',' << center[1] << ',' << center[2]
620 << ") does not match Trk surface " << trkName
621 << " center (" << trkCenter[0] << ',' << trkCenter[1] << ',' << trkCenter[2] << ')');
622 nMismatchedCenters++;
623 result = false;
624 }
625
626 const auto* lineSurface = dynamic_cast<const Acts::LineSurface*>(surface);
627 if(lineSurface == nullptr) {
628 Acts::Vector3 norm{regSurface->normal(gctx, regSurface->center(gctx))};
629 Amg::Vector3D trkNorm{trkSurface.normal()};
630 if(!isApprox(trkNorm, norm)) {
631 std::string trkName;
632 if (auto idHelper = siDetElem->getIdHelper())
633 {
634 trkName = idHelper->show_to_string(siDetElem->identify());
635 }
636 ATH_MSG_WARNING("Acts surface "
637 << surface->geometryId()
638 << " normal (" << norm[0] << ',' << norm[1] << ',' << norm[2]
639 << ") does not match Trk surface " << trkName
640 << " normal (" << trkNorm[0] << ',' << trkNorm[1] << ',' << trkNorm[2] << ')');
641 nMismatchedNormals++;
642 result = false;
643 }
644 }
645
646 auto doPoints = [&](unsigned int type, const Acts::Vector2& loc) -> std::array<bool,3> {
647 Acts::Vector3 glb = surface->localToGlobal(gctx, loc, Acts::Vector3::Zero());
648
649 Amg::Vector2D locTrk = Amg::Vector2D::Zero();
650 Amg::Vector3D glbTrk = Amg::Vector3D::Zero();
651 Acts::Vector2 locg2l = Acts::Vector2::Zero();
652 bool locg2lOk = false;
653 auto locTrkRes = trkSurface.globalToLocal(glb);
654 if (locTrkRes) {
655 locTrk = locTrkRes.value();
656 glbTrk = trkSurface.localToGlobal(locTrk);
657
658 auto locg2lRes = surface->globalToLocal(gctx, glbTrk, Acts::Vector3::Zero());
659 if (locg2lRes.ok()) {
660 locg2lOk = true;
661 locg2l = locg2lRes.value();
662 }
663 }
664
665 auto gId = surface->geometryId();
666 if(os) {
667 (*os) << gId.value()
668 << "," << gId.volume()
669 << "," << gId.layer()
670 << "," << gId.sensitive()
671 << "," << type
672 << "," << loc[0]
673 << "," << loc[1]
674 << "," << surface->insideBounds(loc)
675 << "," << locTrk[0]
676 << "," << locTrk[1]
677 << "," << trkSurface.insideBounds(locTrk)
678 << "," << glb[0]
679 << "," << glb[1]
680 << "," << glb[2]
681 << "," << locg2l[0]
682 << "," << locg2l[1]
683 << "," << glbTrk[0]
684 << "," << glbTrk[1]
685 << "," << glbTrk[2]
686 << std::endl;
687 }
688
689 return {surface->insideBounds(loc) == trkSurface.insideBounds(locTrk),
690 locg2lOk ? isApprox(loc, locg2l) : true,
691 locTrkRes ? isApprox(glb, glbTrk) : true};
692 };
693
694
695 constexpr double envelope = 10.0 * Acts::UnitConstants::mm;
696
697 std::array<bool,3> allOk{true,true,true};
698 if(const auto* bounds = dynamic_cast<const Acts::PlanarBounds*>(&surface->bounds()); bounds) {
699 ATH_MSG_VERBOSE("Planar bounds");
700
701 const Acts::RectangleBounds& boundingBox = bounds->boundingBox();
702 Acts::Vector2 min = boundingBox.min().array() - envelope;
703 Acts::Vector2 max = boundingBox.max().array() + envelope;
704 Acts::Vector2 diag = max - min;
705
706 for(const auto& testPoint : localPoints) {
707 Acts::Vector2 loc = min.array() + (testPoint.array() * diag.array());
708 auto pointOk = doPoints(0, loc);
709 for (size_t i=0; i<pointOk.size(); ++i) {
710 if (!pointOk[i]) {
711 result = false;
712 allOk[i] = false;
713 }
714 }
715 }
716
717 }
718 else if(const auto* bounds = dynamic_cast<const Acts::AnnulusBounds*>(&surface->bounds()); bounds) {
719 ATH_MSG_VERBOSE("Annulus bounds");
720
721 // custom bounding box algo
722 std::vector<Acts::Vector2> vertices = bounds->vertices(5); // 5 segments on the radial edges
723 Acts::Vector2 min{std::numeric_limits<double>::max(), std::numeric_limits<double>::max()};
724 Acts::Vector2 max{std::numeric_limits<double>::lowest(), std::numeric_limits<double>::lowest()};
725 for (const auto& vtx : vertices) {
726 min = min.array().min(vtx.array());
727 max = max.array().max(vtx.array());
728 }
729 min.array() -= envelope;
730 max.array() += envelope;
731 Acts::Vector2 diag = max - min;
732
733 for(const auto& testPoint : localPoints) {
734 Acts::Vector2 locXY = min.array() + (testPoint.array() * diag.array());
735 Acts::Vector2 locPC = dynamic_cast<const Acts::DiscSurface&>(*surface).localCartesianToPolar(locXY);
736
737 auto pointOk = doPoints(1, locPC);
738 for (size_t i=0; i<pointOk.size(); ++i) {
739 if (!pointOk[i]) {
740 result = false;
741 allOk[i] = false;
742 }
743 }
744 }
745
746 }
747 else {
748 result = false;
749 }
750
751 for (size_t i=0; i<allOk.size(); ++i) {
752 if (!allOk[i]) {
753 ++nInconsistent[i];
754 }
755 }
756
757 });
758
759 ATH_MSG_INFO("Total number of sensors : " << nTotalSensors);
760 ATH_MSG_INFO("Number of sensors with mismatched centers : " << nMismatchedCenters);
761 ATH_MSG_INFO("Number of sensors with mismatched normals : " << nMismatchedNormals);
762 ATH_MSG_INFO("Number of sensors with inconsistent inside: " << nInconsistent[0]);
763 ATH_MSG_INFO("Number of sensors with inconsistent g2l : " << nInconsistent[1]);
764 ATH_MSG_INFO("Number of sensors with inconsistent l2g : " << nInconsistent[2]);
765
766 return result;
767}
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
Acts::GeometryContext context() const
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D

◆ surfaceIdMap()

const ActsTrk::DetectorElementToActsGeometryIdMap * ActsTrk::TrackingGeometrySvc::surfaceIdMap ( ) const
overridevirtual

Returns the pointer to the identifier mapping between Acts::surface ID & IdentifierHash of the ITk surfaces.

Definition at line 541 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

541 {
542 return m_detIdMap.get();
543}

◆ trackingGeometry()

std::shared_ptr< const Acts::TrackingGeometry > ActsTrk::TrackingGeometrySvc::trackingGeometry ( ) const
override

Returns a pointer to the internal ACTS tracking geometry.

Definition at line 770 of file Acts/ActsGeometry/src/TrackingGeometrySvc.cxx.

770 {
771
772 ATH_MSG_VERBOSE("Retrieving tracking geometry");
773 return m_trackingGeometry;
774}

Member Data Documentation

◆ m_barrelMaterialBins

Gaudi::Property<std::vector<size_t> > ActsTrk::TrackingGeometrySvc::m_barrelMaterialBins {this, "BarrelMaterialBins", {10, 10}}
private

Definition at line 127 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

127{this, "BarrelMaterialBins", {10, 10}};

◆ m_blueprintGraphviz

Gaudi::Property<std::string> ActsTrk::TrackingGeometrySvc::m_blueprintGraphviz
private
Initial value:
{this, "BlueprintGraphviz",
"", "Write the blueprint graph to a file. No file will be written if empty"}

Definition at line 167 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

167 {this, "BlueprintGraphviz",
168 "", "Write the blueprint graph to a file. No file will be written if empty"};

◆ m_blueprintNodeBuilders

ToolHandleArray<ActsTrk::IBlueprintNodeBuilder> ActsTrk::TrackingGeometrySvc::m_blueprintNodeBuilders {this, "BlueprintNodeBuilders", {}}
private

Definition at line 158 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

158{this, "BlueprintNodeBuilders", {}};

◆ m_buildBeamPipe

Gaudi::Property<bool> ActsTrk::TrackingGeometrySvc::m_buildBeamPipe {this, "BuildBeamPipe", false, ""}
private

Definition at line 122 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

122{this, "BuildBeamPipe", false, ""};

◆ m_buildSubdetectors

Gaudi::Property<std::vector<std::string> > ActsTrk::TrackingGeometrySvc::m_buildSubdetectors {this, "BuildSubDetectors", {"Pixel", "SCT", "TRT", "Calo", "HGTD", "Muon"}}
private

Definition at line 129 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

129{this, "BuildSubDetectors", {"Pixel", "SCT", "TRT", "Calo", "HGTD", "Muon"}};

◆ m_caloVolumeBuilder

ToolHandle<IActsTrackingVolumeBuilder> ActsTrk::TrackingGeometrySvc::m_caloVolumeBuilder {this, "CaloVolumeBuilder", ""}
private

Definition at line 156 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

156{this, "CaloVolumeBuilder", ""};

◆ m_consistencyCheckOutput

StringProperty ActsTrk::TrackingGeometrySvc::m_consistencyCheckOutput
private
Initial value:
{this, "ConsistencyCheckOutput",
"", "Output file for geometry debugging, will not write if empty",}

Definition at line 150 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

150 {this, "ConsistencyCheckOutput",
151 "", "Output file for geometry debugging, will not write if empty",};

◆ m_consistencyCheckPoints

Gaudi::Property<size_t> ActsTrk::TrackingGeometrySvc::m_consistencyCheckPoints
private
Initial value:
{this, "ConsistencyCheckPoints",
1000, "number of random points for consistency check"}

Definition at line 153 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

153 {this, "ConsistencyCheckPoints",
154 1000, "number of random points for consistency check"};

◆ m_detIdMap

std::unique_ptr<const ActsTrk::DetectorElementToActsGeometryIdMap> ActsTrk::TrackingGeometrySvc::m_detIdMap {}
private

Definition at line 179 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

179{};

◆ m_detStore

ServiceHandle<StoreGateSvc> ActsTrk::TrackingGeometrySvc::m_detStore
private

Definition at line 100 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

◆ m_doEndcapLayerMerging

Gaudi::Property<bool> ActsTrk::TrackingGeometrySvc::m_doEndcapLayerMerging {this, "DoEndcapLayerMerging", true, "Merge overlapping endcap layers in z"}
private

Definition at line 169 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

169{this, "DoEndcapLayerMerging", true, "Merge overlapping endcap layers in z"};

◆ m_elementStore

std::shared_ptr<ActsElementVector> ActsTrk::TrackingGeometrySvc::m_elementStore {nullptr}
private

Definition at line 109 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

109{nullptr};

◆ m_endcapMaterialBins

Gaudi::Property<std::vector<size_t> > ActsTrk::TrackingGeometrySvc::m_endcapMaterialBins {this, "EndcapMaterialBins", {5, 20}}
private

Definition at line 128 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

128{this, "EndcapMaterialBins", {5, 20}};

◆ m_HGTD_idHelper

const HGTD_ID* ActsTrk::TrackingGeometrySvc::m_HGTD_idHelper {nullptr}
private

Definition at line 113 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

113{nullptr};

◆ m_keepGoingOnMaterialMergeFailure

Gaudi::Property<bool> ActsTrk::TrackingGeometrySvc::m_keepGoingOnMaterialMergeFailure {this, "KeepGoingOnMaterialMergeFailure", false, ""}
private

Definition at line 119 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

119{this, "KeepGoingOnMaterialMergeFailure", false, ""};

◆ m_materialMapCalibFolder

Gaudi::Property<std::string> ActsTrk::TrackingGeometrySvc::m_materialMapCalibFolder {this, "MaterialMapCalibFolder", ".", ""}
private

Definition at line 121 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

121{this, "MaterialMapCalibFolder", ".", ""};

◆ m_materialMapInputFileBase

Gaudi::Property<std::string> ActsTrk::TrackingGeometrySvc::m_materialMapInputFileBase {this, "MaterialMapInputFile", "", ""}
private

Definition at line 120 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

120{this, "MaterialMapInputFile", "", ""};

◆ m_nominalContext

ActsTrk::GeometryContext ActsTrk::TrackingGeometrySvc::m_nominalContext {}
private

Definition at line 115 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

115{};

◆ m_numberOfBinsFactor

Gaudi::Property<double> ActsTrk::TrackingGeometrySvc::m_numberOfBinsFactor {this, "NumberOfBinsFactor", 5.0}
private

controls how many bins are created for the sensitive surface grid.

1 results in the same number of bins as there are surfaces per layer in each dimension. using a higher number will reduce the number of surfaces per bin, thus speeding up navigation, but increasing memory consumption.

Definition at line 174 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

174{this, "NumberOfBinsFactor", 5.0};

◆ m_numberOfInnermostLayerBinsFactor

Gaudi::Property<double> ActsTrk::TrackingGeometrySvc::m_numberOfInnermostLayerBinsFactor {this, "NumberOfInnermostLayerBinsFactor",2.0}
private

Special treatment for the innermost pixel layer to have more control on bin size to account for shallow angle tracks.

Definition at line 177 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

177{this, "NumberOfInnermostLayerBinsFactor",2.0};

◆ m_objDebugOutput

Gaudi::Property<bool> ActsTrk::TrackingGeometrySvc::m_objDebugOutput {this, "ObjDebugOutput", false, ""}
private

Definition at line 118 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

118{this, "ObjDebugOutput", false, ""};

◆ m_passiveITkInnerPixelBarrelLayerHalflengthZ

Gaudi::Property<std::vector<float> > ActsTrk::TrackingGeometrySvc::m_passiveITkInnerPixelBarrelLayerHalflengthZ {this, "PassiveITkInnerPixelBarrelLayerHalflengthZ", {}}
private

Definition at line 136 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

136{this, "PassiveITkInnerPixelBarrelLayerHalflengthZ", {}};

◆ m_passiveITkInnerPixelBarrelLayerRadii

Gaudi::Property<std::vector<float> > ActsTrk::TrackingGeometrySvc::m_passiveITkInnerPixelBarrelLayerRadii {this, "PassiveITkInnerPixelBarrelLayerRadii", {}}
private

the specifications for building additional passive cylinders in the barrel region: for each cylinder you want to specify radius, half length in z and thickness

Definition at line 135 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

135{this, "PassiveITkInnerPixelBarrelLayerRadii", {}};

◆ m_passiveITkInnerPixelBarrelLayerThickness

Gaudi::Property<std::vector<float> > ActsTrk::TrackingGeometrySvc::m_passiveITkInnerPixelBarrelLayerThickness {this, "PassiveITkInnerPixelBarrelLayerThickness", {}}
private

Definition at line 137 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

137{this, "PassiveITkInnerPixelBarrelLayerThickness", {}};

◆ m_passiveITkOuterPixelBarrelLayerHalflengthZ

Gaudi::Property<std::vector<float> > ActsTrk::TrackingGeometrySvc::m_passiveITkOuterPixelBarrelLayerHalflengthZ {this, "PassiveITkOuterPixelBarrelLayerHalflengthZ", {}}
private

Definition at line 140 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

140{this, "PassiveITkOuterPixelBarrelLayerHalflengthZ", {}};

◆ m_passiveITkOuterPixelBarrelLayerRadii

Gaudi::Property<std::vector<float> > ActsTrk::TrackingGeometrySvc::m_passiveITkOuterPixelBarrelLayerRadii {this, "PassiveITkOuterPixelBarrelLayerRadii", {}}
private

Definition at line 139 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

139{this, "PassiveITkOuterPixelBarrelLayerRadii", {}};

◆ m_passiveITkOuterPixelBarrelLayerThickness

Gaudi::Property<std::vector<float> > ActsTrk::TrackingGeometrySvc::m_passiveITkOuterPixelBarrelLayerThickness {this, "PassiveITkOuterPixelBarrelLayerThickness", {}}
private

Definition at line 141 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

141{this, "PassiveITkOuterPixelBarrelLayerThickness", {}};

◆ m_passiveITkStripBarrelLayerHalflengthZ

Gaudi::Property<std::vector<float> > ActsTrk::TrackingGeometrySvc::m_passiveITkStripBarrelLayerHalflengthZ {this, "PassiveITkStripBarrelLayerHalflengthZ", {}}
private

Definition at line 144 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

144{this, "PassiveITkStripBarrelLayerHalflengthZ", {}};

◆ m_passiveITkStripBarrelLayerRadii

Gaudi::Property<std::vector<float> > ActsTrk::TrackingGeometrySvc::m_passiveITkStripBarrelLayerRadii {this, "PassiveITkStripBarrelLayerRadii", {}}
private

Definition at line 143 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

143{this, "PassiveITkStripBarrelLayerRadii", {}};

◆ m_passiveITkStripBarrelLayerThickness

Gaudi::Property<std::vector<float> > ActsTrk::TrackingGeometrySvc::m_passiveITkStripBarrelLayerThickness {this, "PassiveITkStripBarrelLayerThickness", {}}
private

Definition at line 145 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

145{this, "PassiveITkStripBarrelLayerThickness", {}};

◆ m_printGeo

Gaudi::Property<bool> ActsTrk::TrackingGeometrySvc::m_printGeo {this, "printGeometry", false}
private

Print the assembled tracking geometry after building.

Definition at line 125 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

125{this, "printGeometry", false};

◆ m_refineVisitors

ToolHandleArray<ActsTrk::IRefineTrackingGeoTool> ActsTrk::TrackingGeometrySvc::m_refineVisitors {this, "RefinementTools", {}}
private

Definition at line 160 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

160{this, "RefinementTools", {}};

◆ m_runConsistencyChecks

BooleanProperty ActsTrk::TrackingGeometrySvc::m_runConsistencyChecks
private
Initial value:
{this, "RunConsistencyChecks",
false, "Run extra consistency checks w.r.t to Trk::. This is SLOW!"}

Definition at line 147 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

147 {this, "RunConsistencyChecks",
148 false, "Run extra consistency checks w.r.t to Trk::. This is SLOW!"};

◆ m_subDetNoAlign

std::set<ActsTrk::DetectorType> ActsTrk::TrackingGeometrySvc::m_subDetNoAlign {}
private

Definition at line 163 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

163{};

◆ m_subDetNoAlignProp

Gaudi::Property<std::vector<unsigned int> > ActsTrk::TrackingGeometrySvc::m_subDetNoAlignProp {this, "NotAlignDetectors", {}}
private

Define the subdetectors for which the tracking geometry does not expect a valid alignment store.

Definition at line 162 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

162{this, "NotAlignDetectors", {}};

◆ m_trackingGeometry

std::shared_ptr<const Acts::TrackingGeometry> ActsTrk::TrackingGeometrySvc::m_trackingGeometry {nullptr}
private

Definition at line 110 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

110{nullptr};

◆ m_TRT_idHelper

const TRT_ID* ActsTrk::TrackingGeometrySvc::m_TRT_idHelper {nullptr}
private

Definition at line 112 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

112{nullptr};

◆ m_useBlueprint

Gaudi::Property<bool> ActsTrk::TrackingGeometrySvc::m_useBlueprint {this, "UseBlueprint", false, "Use the new Blueprint API for geometry construction"}
private

Definition at line 165 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

165{this, "UseBlueprint", false, "Use the new Blueprint API for geometry construction"};

◆ m_useMaterialMap

Gaudi::Property<bool> ActsTrk::TrackingGeometrySvc::m_useMaterialMap {this, "UseMaterialMap", false, ""}
private

Definition at line 117 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

117{this, "UseMaterialMap", false, ""};

◆ p_beamPipeMgr

const BeamPipeDetectorManager* ActsTrk::TrackingGeometrySvc::p_beamPipeMgr {nullptr}
private

Definition at line 106 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

106{nullptr};

◆ p_HGTDManager

const HGTD_DetectorManager* ActsTrk::TrackingGeometrySvc::p_HGTDManager {nullptr}
private

Definition at line 107 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

107{nullptr};

◆ p_ITkPixelManager

const InDetDD::SiDetectorManager* ActsTrk::TrackingGeometrySvc::p_ITkPixelManager {nullptr}
private

Definition at line 104 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

104{nullptr};

◆ p_ITkStripManager

const InDetDD::SiDetectorManager* ActsTrk::TrackingGeometrySvc::p_ITkStripManager {nullptr}
private

Definition at line 105 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

105{nullptr};

◆ p_pixelManager

const InDetDD::SiDetectorManager* ActsTrk::TrackingGeometrySvc::p_pixelManager {nullptr}
private

Definition at line 101 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

101{nullptr};

◆ p_SCTManager

const InDetDD::SiDetectorManager* ActsTrk::TrackingGeometrySvc::p_SCTManager {nullptr}
private

Definition at line 102 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

102{nullptr};

◆ p_TRTManager

const InDetDD::TRT_DetectorManager* ActsTrk::TrackingGeometrySvc::p_TRTManager {nullptr}
private

Definition at line 103 of file Acts/ActsGeometry/src/TrackingGeometrySvc.h.

103{nullptr};

The documentation for this class was generated from the following files: