ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::MaterialMapJsonConverter Class Reference

read the material from Json More...

#include <ActsPlugins/Json/MaterialMapJsonConverter.hpp>

Classes

class  Config
 Configuration of the Converter. More...

Public Member Functions

 MaterialMapJsonConverter (const Config &config, Acts::Logging::Level level)
 Constructor.
 ~MaterialMapJsonConverter ()=default
 Destructor.
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.
TrackingGeometryMaterial jsonToMaterialMaps (const nlohmann::json &materialmaps)
 Convert a json material map to a TrackingGeometryMaterial.
nlohmann::json materialMapsToJson (const TrackingGeometryMaterial &maps, const IVolumeMaterialJsonDecorator *decorator=nullptr)
 Convert a TrackingGeometryMaterial to json.
nlohmann::json trackingGeometryToJson (const TrackingGeometry &tGeometry, const ITrackingGeometryJsonDecorator *decorator=nullptr)
 Convert a tracking geometry to json.

Detailed Description

read the material from Json

Constructor & Destructor Documentation

◆ MaterialMapJsonConverter()

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

Constructor.

Parameters
configconfiguration struct for the reader
levelThe log level

◆ ~MaterialMapJsonConverter()

Acts::MaterialMapJsonConverter::~MaterialMapJsonConverter ( )
default

Destructor.

Member Function Documentation

◆ convertToHierarchy()

void Acts::MaterialMapJsonConverter::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.

Parameters
volumeHierarchyis a vector of volume to be filled
surfaceHierarchyis a vector of surfaces to be filled
tVolumeis a volume

◆ jsonToMaterialMaps()

TrackingGeometryMaterial Acts::MaterialMapJsonConverter::jsonToMaterialMaps ( const nlohmann::json & materialmaps)

Convert a json material map to a TrackingGeometryMaterial.

Parameters
materialmapsThe json material
Returns
Converted tracking geometry material from JSON

◆ materialMapsToJson()

nlohmann::json Acts::MaterialMapJsonConverter::materialMapsToJson ( const TrackingGeometryMaterial & maps,
const IVolumeMaterialJsonDecorator * decorator = nullptr )

Convert a TrackingGeometryMaterial to json.

Parameters
mapsThe material map collection
decoratornullptr or a decorator to add extra attributes
Returns
JSON representation of the material maps

◆ trackingGeometryToJson()

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

Convert a tracking geometry to json.

Can be used to initialise the material mapping process.

Parameters
tGeometryis the tracking geometry
decoratornullptr or a decorator to add extra attributes
Returns
JSON representation of the tracking geometry