ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsMaterial
src
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
5
#include "
MaterialDumperTool.h
"
6
#include "Acts/Geometry/TrackingGeometry.hpp"
7
#include "Acts/Geometry/TrackingVolume.hpp"
8
#include "Acts/Surfaces/Surface.hpp"
9
10
StatusCode
ActsTrk::MaterialDumperTool::initialize
()
11
{
12
ATH_CHECK
(
m_materialMapWriters
.retrieve());
13
return
StatusCode::SUCCESS;
14
}
15
16
void
ActsTrk::MaterialDumperTool::dumpMaterial
(
const
ActsTrk::GeometryContext
& gctx,
17
const
Acts::TrackingGeometryMaterial& material)
const
18
{
19
for
(
const
auto
& materialWriter :
m_materialMapWriters
) {
20
materialWriter->writeMaterial(gctx, material);
21
}
22
}
23
24
void
ActsTrk::MaterialDumperTool::dumpGeometryMaterial
(
const
ActsTrk::GeometryContext
& gctx,
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
MaterialDumperTool.h
ActsTrk::GeometryContext
Definition
GeometryContext.h:30
ActsTrk::MaterialDumperTool::m_materialMapWriters
ToolHandleArray< IMaterialWriterTool > m_materialMapWriters
The material writers the dumped maps are handed to.
Definition
MaterialDumperTool.h:27
ActsTrk::MaterialDumperTool::dumpMaterial
virtual void dumpMaterial(const ActsTrk::GeometryContext &gctx, const Acts::TrackingGeometryMaterial &material) const override
Definition
MaterialDumperTool.cxx:16
ActsTrk::MaterialDumperTool::initialize
virtual StatusCode initialize() override
Definition
MaterialDumperTool.cxx:10
ActsTrk::MaterialDumperTool::dumpGeometryMaterial
virtual void dumpGeometryMaterial(const ActsTrk::GeometryContext &gctx, const Acts::TrackingGeometry &geometry) const override
Definition
MaterialDumperTool.cxx:24
Generated on
for ATLAS Offline Software by
1.17.0