File MaterialMapJsonConverter.hpp

namespace Acts


This file is foreseen for the Geometry module to replace Extent


typedef std::tuple<std::shared_ptr<const Acts::Surface>, std::shared_ptr<const Acts::ISurfaceMaterial>, Acts::GeometryContext> SurfaceAndMaterialWithContext
typedef std::pair<const Acts::TrackingVolume*, std::shared_ptr<const Acts::IVolumeMaterial>> TrackingVolumeAndMaterial
class MaterialMapJsonConverter
#include <Acts/Plugins/Json/MaterialMapJsonConverter.hpp>

read the material from Json

Public Types

using DetectorMaterialMaps = std::pair<SurfaceMaterialMap, VolumeMaterialMap>
using SurfaceMaterialMap = std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>
using VolumeMaterialMap = std::map<GeometryIdentifier, std::shared_ptr<const IVolumeMaterial>>

Public Functions

MaterialMapJsonConverter(const Config &config, Acts::Logging::Level level)


  • config – configuration struct for the reader

  • level – The log level

~MaterialMapJsonConverter() = default


void convertToHierarchy(std::vector<std::pair<GeometryIdentifier, Acts::TrackingVolumeAndMaterial>> &volumeHierarchy, std::vector<std::pair<GeometryIdentifier, Acts::SurfaceAndMaterialWithContext>> &surfaceHierarchy, const Acts::TrackingVolume *tVolume)

Go through a volume to find subvolume, layers and surfaces.

Store volumes and surfaces in two vector used to initialised the geometry hierarchy.

  • volumeHierarchy – is a vector of volume to be filled

  • surfaceHierarchy – is a vector of surfaces to be filled

  • tVolume – is a volume

DetectorMaterialMaps jsonToMaterialMaps(const nlohmann::json &materialmaps)

Convert a json material map to a DetectorMaterialMaps.


materialmaps – The json material

nlohmann::json materialMapsToJson(const DetectorMaterialMaps &maps, const IVolumeMaterialJsonDecorator *decorator = nullptr)

Convert a DetectorMaterialMaps to json.

  • maps – The material map collection

  • decorator – nullptr or a decorator to add extra attributes

nlohmann::json trackingGeometryToJson(const TrackingGeometry &tGeometry, const ITrackingGeometryJsonDecorator *decorator = nullptr)

Convert a tracking geometry to json.

Can be used to initialise the material mapping process.

  • tGeometry – is the tracking geometry

  • decorator – nullptr or a decorator to add extra attributes

Private Functions

inline const Logger &logger() const

Private access to the logging instance.

Private Members

Config m_cfg

The config class.

std::unique_ptr<const Logger> m_logger = {nullptr}

The logger instance.

Acts::GeometryHierarchyMapJsonConverter<Acts::SurfaceAndMaterialWithContext, Acts::ITrackingGeometryJsonDecorator> m_surfaceConverter

Geometry hierarchy writer for surface.

Acts::GeometryHierarchyMapJsonConverter<const ISurfaceMaterial*, Acts::IVolumeMaterialJsonDecorator> m_surfaceMaterialConverter

Geometry hierarchy writer for surface material.

std::string m_surfaceName = "Material Surface Map"

Name of the surface hierarchy.

Acts::GeometryHierarchyMapJsonConverter<Acts::TrackingVolumeAndMaterial, Acts::ITrackingGeometryJsonDecorator> m_volumeConverter

Geometry hierarchy writer for tracking volume.

Acts::GeometryHierarchyMapJsonConverter<const IVolumeMaterial*, Acts::IVolumeMaterialJsonDecorator> m_volumeMaterialConverter

Geometry hierarchy writer for volume material.

std::string m_volumeName = "Material Volume Map"

Name of the volume hierarchy.

class Config
#include <Acts/Plugins/Json/MaterialMapJsonConverter.hpp>

Configuration of the Converter.

Public Members

GeometryContext context = GeometryContext()

Default geometry context to extract surface transforms.

bool processApproaches = true

Steering to handle approach data.

bool processBoundaries = true

Steering to handle boundary data.

bool processDenseVolumes = false

Steering to handle volume data.

bool processNonMaterial = false

Add proto material to all surfaces.

bool processRepresenting = true

Steering to handle representing data.

bool processSensitives = true

Steering to handle sensitive data.

bool processVolumes = true

Steering to handle volume data.