Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::MaterialMapJsonConverter Class Reference

read the material from Json More...

#include <acts/blob/sPHENIX/Plugins/Json/include/Acts/Plugins/Json/MaterialMapJsonConverter.hpp>

+ Collaboration diagram for Acts::MaterialMapJsonConverter:

Classes

class  Config
 

Public Types

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

Public Member Functions

 MaterialMapJsonConverter (const Config &config, Acts::Logging::Level level)
 
 ~MaterialMapJsonConverter ()=default
 Destructor.
 
DetectorMaterialMaps jsonToMaterialMaps (const nlohmann::json &materialmaps)
 
nlohmann::json materialMapsToJson (const DetectorMaterialMaps &maps, const IVolumeMaterialJsonDecorator *decorator=nullptr)
 
nlohmann::json trackingGeometryToJson (const TrackingGeometry &tGeometry, const ITrackingGeometryJsonDecorator *decorator=nullptr)
 
void convertToHierarchy (std::vector< std::pair< GeometryIdentifier, Acts::TrackingVolumeAndMaterial >> &volumeHierarchy, std::vector< std::pair< GeometryIdentifier, Acts::SurfaceAndMaterialWithContext >> &surfaceHierarchy, const Acts::TrackingVolume *tVolume)
 

Private Member Functions

const Loggerlogger () const
 Private access to the logging instance.
 

Private Attributes

Config m_cfg
 The config class.
 
std::unique_ptr< const Loggerm_logger {nullptr}
 The logger instance.
 
std::string m_volumeName = "Material Volume Map"
 Name of the volume hierarchy.
 
Acts::GeometryHierarchyMapJsonConverter
< const IVolumeMaterial
*, Acts::IVolumeMaterialJsonDecorator
m_volumeMaterialConverter
 Geometry hierarchy writer for volume material.
 
Acts::GeometryHierarchyMapJsonConverter
< Acts::TrackingVolumeAndMaterial,
Acts::ITrackingGeometryJsonDecorator
m_volumeConverter
 Geometry hierarchy writer for tracking volume.
 
std::string m_surfaceName = "Material Surface Map"
 Name of the surface hierarchy.
 
Acts::GeometryHierarchyMapJsonConverter
< const ISurfaceMaterial
*, Acts::IVolumeMaterialJsonDecorator
m_surfaceMaterialConverter
 Geometry hierarchy writer for surface material.
 
Acts::GeometryHierarchyMapJsonConverter
< Acts::SurfaceAndMaterialWithContext,
Acts::ITrackingGeometryJsonDecorator
m_surfaceConverter
 Geometry hierarchy writer for surface.
 

Detailed Description

read the material from Json

Definition at line 53 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 53 of file MaterialMapJsonConverter.hpp

Member Typedef Documentation

Definition at line 59 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 59 of file MaterialMapJsonConverter.hpp

Definition at line 56 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 56 of file MaterialMapJsonConverter.hpp

Definition at line 58 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 58 of file MaterialMapJsonConverter.hpp

Constructor & Destructor Documentation

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

Constructor

Parameters
configconfiguration struct for the reader
levelThe log level

Definition at line 235 of file MaterialMapJsonConverter.cpp.

View newest version in sPHENIX GitHub at line 235 of file MaterialMapJsonConverter.cpp

References Acts::getDefaultLogger().

+ Here is the call graph for this function:

Acts::MaterialMapJsonConverter::~MaterialMapJsonConverter ( )
default

Destructor.

Member Function Documentation

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

Definition at line 329 of file MaterialMapJsonConverter.cpp.

View newest version in sPHENIX GitHub at line 329 of file MaterialMapJsonConverter.cpp

References Acts::BinnedArray< T >::arrayObjects(), Acts::TrackingVolume::boundarySurfaces(), Acts::TrackingVolume::confinedLayers(), Acts::TrackingVolume::confinedVolumes(), Acts::TrackingVolume::denseVolumes(), Acts::GeometryObject::geometryId(), train_ambiguity_solver::id, m_cfg(), merge_hashes::p, Acts::GeometryIdentifier::volume(), Acts::TrackingVolume::volumeMaterial(), and volumes.

+ Here is the call graph for this function:

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

Convert a json material map to a DetectorMaterialMaps

Parameters
materialmapsThe json material

Definition at line 277 of file MaterialMapJsonConverter.cpp.

View newest version in sPHENIX GitHub at line 277 of file MaterialMapJsonConverter.cpp

References i, Acts::GeometryHierarchyMap< value_t >::idAt(), m_surfaceMaterialConverter(), m_volumeMaterialConverter(), Acts::maps, testing::internal::move(), Acts::GeometryHierarchyMap< value_t >::size(), and Acts::GeometryHierarchyMap< value_t >::valueAt().

Referenced by BOOST_AUTO_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Logger& Acts::MaterialMapJsonConverter::logger ( ) const
inlineprivate

Private access to the logging instance.

Definition at line 160 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 160 of file MaterialMapJsonConverter.hpp

References m_logger.

nlohmann::json Acts::MaterialMapJsonConverter::materialMapsToJson ( const DetectorMaterialMaps maps,
const IVolumeMaterialJsonDecorator decorator = nullptr 
)

Convert a DetectorMaterialMaps to json

Parameters
mapsThe material map collection
decoratornullptr or a decorator to add extra attributes

Convert method

Definition at line 247 of file MaterialMapJsonConverter.cpp.

View newest version in sPHENIX GitHub at line 247 of file MaterialMapJsonConverter.cpp

References it, m_surfaceMaterialConverter(), and m_volumeMaterialConverter().

Referenced by BOOST_AUTO_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 305 of file MaterialMapJsonConverter.cpp.

View newest version in sPHENIX GitHub at line 305 of file MaterialMapJsonConverter.cpp

References Acts::TrackingGeometry::highestTrackingVolume(), m_surfaceConverter(), and m_volumeConverter().

+ Here is the call graph for this function:

Member Data Documentation

Config Acts::MaterialMapJsonConverter::m_cfg
private

The config class.

Definition at line 132 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 132 of file MaterialMapJsonConverter.hpp

std::unique_ptr<const Logger> Acts::MaterialMapJsonConverter::m_logger {nullptr}
private

The logger instance.

Definition at line 135 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 135 of file MaterialMapJsonConverter.hpp

Referenced by logger().

Geometry hierarchy writer for surface.

Definition at line 157 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 157 of file MaterialMapJsonConverter.hpp

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

Geometry hierarchy writer for surface material.

Definition at line 153 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 153 of file MaterialMapJsonConverter.hpp

std::string Acts::MaterialMapJsonConverter::m_surfaceName = "Material Surface Map"
private

Name of the surface hierarchy.

Definition at line 149 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 149 of file MaterialMapJsonConverter.hpp

Geometry hierarchy writer for tracking volume.

Definition at line 146 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 146 of file MaterialMapJsonConverter.hpp

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

Geometry hierarchy writer for volume material.

Definition at line 142 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 142 of file MaterialMapJsonConverter.hpp

std::string Acts::MaterialMapJsonConverter::m_volumeName = "Material Volume Map"
private

Name of the volume hierarchy.

Definition at line 138 of file MaterialMapJsonConverter.hpp.

View newest version in sPHENIX GitHub at line 138 of file MaterialMapJsonConverter.hpp


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