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

Dumps the material through the configured material writers. More...

#include <MaterialDumperTool.h>

Inheritance diagram for ActsTrk::MaterialDumperTool:
Collaboration diagram for ActsTrk::MaterialDumperTool:

Public Member Functions

virtual ~MaterialDumperTool ()=default
virtual StatusCode initialize () override
virtual void dumpMaterial (const ActsTrk::GeometryContext &gctx, const Acts::TrackingGeometryMaterial &material) const override
virtual void dumpGeometryMaterial (const ActsTrk::GeometryContext &gctx, const Acts::TrackingGeometry &geometry) const override

Private Attributes

ToolHandleArray< IMaterialWriterTool > m_materialMapWriters {this, "MaterialMapWriters", {}, "The material map writers"}
 The material writers the dumped maps are handed to.

Detailed Description

Dumps the material through the configured material writers.

Definition at line 16 of file MaterialDumperTool.h.

Constructor & Destructor Documentation

◆ ~MaterialDumperTool()

virtual ActsTrk::MaterialDumperTool::~MaterialDumperTool ( )
virtualdefault

Member Function Documentation

◆ dumpGeometryMaterial()

void ActsTrk::MaterialDumperTool::dumpGeometryMaterial ( const ActsTrk::GeometryContext & gctx,
const Acts::TrackingGeometry & geometry ) const
overridevirtual

Definition at line 24 of file MaterialDumperTool.cxx.

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}
virtual void dumpMaterial(const ActsTrk::GeometryContext &gctx, const Acts::TrackingGeometryMaterial &material) const override

◆ dumpMaterial()

void ActsTrk::MaterialDumperTool::dumpMaterial ( const ActsTrk::GeometryContext & gctx,
const Acts::TrackingGeometryMaterial & material ) const
overridevirtual

Definition at line 16 of file MaterialDumperTool.cxx.

18{
19 for (const auto& materialWriter : m_materialMapWriters) {
20 materialWriter->writeMaterial(gctx, material);
21 }
22}
ToolHandleArray< IMaterialWriterTool > m_materialMapWriters
The material writers the dumped maps are handed to.

◆ initialize()

StatusCode ActsTrk::MaterialDumperTool::initialize ( )
overridevirtual

Definition at line 10 of file MaterialDumperTool.cxx.

11{
13 return StatusCode::SUCCESS;
14}
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_materialMapWriters

ToolHandleArray<IMaterialWriterTool> ActsTrk::MaterialDumperTool::m_materialMapWriters {this, "MaterialMapWriters", {}, "The material map writers"}
private

The material writers the dumped maps are handed to.

Definition at line 27 of file MaterialDumperTool.h.

27{this, "MaterialMapWriters", {}, "The material map writers"};

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