![]() |
Analysis Software
Documentation for sPHENIX simulation software
|
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 Logger & | logger () const |
| Private access to the logging instance. | |
Private Attributes | |
| Config | m_cfg |
| The config class. | |
| std::unique_ptr< const Logger > | m_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. | |
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
| using Acts::MaterialMapJsonConverter::DetectorMaterialMaps = std::pair<SurfaceMaterialMap, VolumeMaterialMap> |
Definition at line 59 of file MaterialMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 59 of file MaterialMapJsonConverter.hpp
| using Acts::MaterialMapJsonConverter::SurfaceMaterialMap = std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>> |
Definition at line 56 of file MaterialMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 56 of file MaterialMapJsonConverter.hpp
| using Acts::MaterialMapJsonConverter::VolumeMaterialMap = std::map<GeometryIdentifier, std::shared_ptr<const IVolumeMaterial>> |
Definition at line 58 of file MaterialMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 58 of file MaterialMapJsonConverter.hpp
| Acts::MaterialMapJsonConverter::MaterialMapJsonConverter | ( | const Config & | config, |
| Acts::Logging::Level | level | ||
| ) |
Constructor
| config | configuration struct for the reader |
| level | The 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:
|
default |
Destructor.
| 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.
| volumeHierarchy | is a vector of volume to be filled |
| surfaceHierarchy | is a vector of surfaces to be filled |
| tVolume | is 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
| materialmaps | The 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:
|
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
| maps | The material map collection |
| decorator | nullptr 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.
| tGeometry | is the tracking geometry |
| decorator | nullptr 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:
|
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
|
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().
|
private |
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
|
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
|
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
|
private |
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
|
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
|
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