ATLAS Offline Software
Loading...
Searching...
No Matches
MaterialDumperTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "Acts/Geometry/TrackingGeometry.hpp"
7#include "Acts/Geometry/TrackingVolume.hpp"
8#include "Acts/Surfaces/Surface.hpp"
9
11{
13 return StatusCode::SUCCESS;
14}
15
17 const Acts::TrackingGeometryMaterial& material) const
18{
19 for (const auto& materialWriter : m_materialMapWriters) {
20 materialWriter->writeMaterial(gctx, material);
21 }
22}
23
25 const Acts::TrackingGeometry& geometry) const
26{
27 // Collect the material assigned to the geometry, keyed by geometry ID,
28 // in the same container the material mapping produces
29 Acts::TrackingGeometryMaterial geometryMaterial;
30 geometry.visitSurfaces([&geometryMaterial](const Acts::Surface* surface) {
31 if (surface->surfaceMaterialSharedPtr()) {
32 geometryMaterial.surfaceMaterials[surface->geometryId()] = surface->surfaceMaterialSharedPtr();
33 }
34 }, false);
35 geometry.visitVolumes([&geometryMaterial](const Acts::TrackingVolume* volume) {
36 if (volume->hasMaterial()) {
37 geometryMaterial.volumeMaterials[volume->geometryId()] = volume->volumeMaterialPtr();
38 }
39 });
40
41 dumpMaterial(gctx, geometryMaterial);
42}
#define ATH_CHECK
Evaluate an expression and check for errors.
ToolHandleArray< IMaterialWriterTool > m_materialMapWriters
The material writers the dumped maps are handed to.
virtual void dumpMaterial(const ActsTrk::GeometryContext &gctx, const Acts::TrackingGeometryMaterial &material) const override
virtual StatusCode initialize() override
virtual void dumpGeometryMaterial(const ActsTrk::GeometryContext &gctx, const Acts::TrackingGeometry &geometry) const override