ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::JsonGeometryConverter Class Reference

read the material from Json More...

#include <acts/blob/master/Plugins/Json/include/Acts/Plugins/Json/JsonGeometryConverter.hpp>

+ Collaboration diagram for Acts::JsonGeometryConverter:

Classes

class  Config
 
struct  DetectorRep
 Detector representation for Json writing. More...
 
struct  LayerRep
 Layer representation for Json writing. More...
 
struct  VolumeRep
 Volume representation for Json writing. More...
 

Public Types

using SurfaceMaterialMap = std::map< GeometryID, std::shared_ptr< const ISurfaceMaterial >>
 
using VolumeMaterialMap = std::map< GeometryID, std::shared_ptr< const IVolumeMaterial >>
 
using DetectorMaterialMaps = std::pair< SurfaceMaterialMap, VolumeMaterialMap >
 
using geo_id_value = uint64_t
 
using SurfaceMaterialRep = std::map< geo_id_value, const ISurfaceMaterial * >
 
using SurfaceRep = std::map< geo_id_value, const Surface * >
 
using VolumeMaterialRep = std::map< geo_id_value, const IVolumeMaterial * >
 

Public Member Functions

 JsonGeometryConverter (const Config &cfg)
 
 ~JsonGeometryConverter ()=default
 Destructor.
 
std::pair< std::map
< GeometryID, std::shared_ptr
< const ISurfaceMaterial >
>, std::map< GeometryID,
std::shared_ptr< const
IVolumeMaterial > > > 
jsonToMaterialMaps (const nlohmann::json &materialmaps)
 
nlohmann::json materialMapsToJson (const DetectorMaterialMaps &maps)
 
nlohmann::json trackingGeometryToJson (const TrackingGeometry &tGeometry)
 

Private Member Functions

void convertToRep (DetectorRep &detRep, const TrackingVolume &tVolume)
 
LayerRep convertToRep (const Layer &tLayer)
 
const ISurfaceMaterialjsonToSurfaceMaterial (const nlohmann::json &material)
 Create the Surface Material.
 
const IVolumeMaterialjsonToVolumeMaterial (const nlohmann::json &material)
 Create the Volume Material.
 
MaterialPropertiesMatrix jsonToMaterialMatrix (const nlohmann::json &data)
 Create the Material Matrix.
 
BinUtility jsonToBinUtility (const nlohmann::json &bin)
 Create the BinUtility for from Json.
 
nlohmann::json detectorRepToJson (const DetectorRep &detRep)
 Create Json from a detector represenation.
 
nlohmann::json surfaceMaterialToJson (const ISurfaceMaterial &sMaterial)
 
nlohmann::json volumeMaterialToJson (const IVolumeMaterial &vMaterial)
 
void addSurfaceToJson (nlohmann::json &sjson, const Surface *surface)
 
Acts::BinUtility DefaultBin (const Acts::Surface &surface)
 
Acts::BinUtility DefaultBin (const Acts::TrackingVolume &volume)
 
const Loggerlogger () const
 Private access to the logging instance.
 

Private Attributes

Config m_cfg
 The config class.
 

Detailed Description

read the material from Json

Definition at line 30 of file JsonGeometryConverter.hpp.

View newest version in sPHENIX GitHub at line 30 of file JsonGeometryConverter.hpp

Member Typedef Documentation

Definition at line 38 of file JsonGeometryConverter.hpp.

View newest version in sPHENIX GitHub at line 38 of file JsonGeometryConverter.hpp

Definition at line 40 of file JsonGeometryConverter.hpp.

View newest version in sPHENIX GitHub at line 40 of file JsonGeometryConverter.hpp

Definition at line 33 of file JsonGeometryConverter.hpp.

View newest version in sPHENIX GitHub at line 33 of file JsonGeometryConverter.hpp

Definition at line 42 of file JsonGeometryConverter.hpp.

View newest version in sPHENIX GitHub at line 42 of file JsonGeometryConverter.hpp

Definition at line 43 of file JsonGeometryConverter.hpp.

View newest version in sPHENIX GitHub at line 43 of file JsonGeometryConverter.hpp

Definition at line 36 of file JsonGeometryConverter.hpp.

View newest version in sPHENIX GitHub at line 36 of file JsonGeometryConverter.hpp

Definition at line 44 of file JsonGeometryConverter.hpp.

View newest version in sPHENIX GitHub at line 44 of file JsonGeometryConverter.hpp

Constructor & Destructor Documentation

Acts::JsonGeometryConverter::JsonGeometryConverter ( const Config cfg)

Constructor

Parameters
cfgconfiguration struct for the reader

Definition at line 44 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 44 of file JsonGeometryConverter.cpp

References Acts::JsonGeometryConverter::Config::logger, and m_cfg.

Acts::JsonGeometryConverter::~JsonGeometryConverter ( )
default

Destructor.

Member Function Documentation

void Acts::JsonGeometryConverter::addSurfaceToJson ( nlohmann::json sjson,
const Surface surface 
)
private

Add surface information to json surface

Parameters
Thejson surface The surface

Definition at line 805 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 805 of file JsonGeometryConverter.cpp

References Acts::Surface::bounds(), Acts::CylinderBounds::eHalfLengthZ, Acts::CylinderBounds::eR, Acts::GeometryObject::geoID(), Acts::CylinderBounds::get(), Acts::AnnulusBounds::phiMax(), Acts::AnnulusBounds::phiMin(), Acts::RadialBounds::rMax(), Acts::AnnulusBounds::rMax(), Acts::RadialBounds::rMin(), Acts::AnnulusBounds::rMin(), and Acts::Surface::transform().

+ Here is the call graph for this function:

Acts::BinUtility Acts::JsonGeometryConverter::DefaultBin ( const Acts::Surface surface)
private
Acts::BinUtility Acts::JsonGeometryConverter::DefaultBin ( const Acts::TrackingVolume volume)
private

Default BinUtility to create proto material

Parameters
theVolume

Definition at line 928 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 928 of file JsonGeometryConverter.cpp

References Acts::binPhi, Acts::binR, Acts::binX, Acts::binY, Acts::binZ, Acts::closed, Acts::CuboidVolumeBounds::eHalfLengthX, Acts::CuboidVolumeBounds::eHalfLengthY, Acts::CuboidVolumeBounds::eHalfLengthZ, Acts::CylinderVolumeBounds::eHalfLengthZ, Acts::CylinderVolumeBounds::eHalfPhiSector, Acts::CylinderVolumeBounds::eMaxR, Acts::CylinderVolumeBounds::eMinR, Acts::open, and Acts::Volume::volumeBounds().

+ Here is the call graph for this function:

json Acts::JsonGeometryConverter::detectorRepToJson ( const DetectorRep detRep)
private

Create Json from a detector represenation.

Definition at line 219 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 219 of file JsonGeometryConverter.cpp

References ACTS_VERBOSE, nlohmann::to_string(), and Acts::JsonGeometryConverter::DetectorRep::volumes.

+ Here is the call graph for this function:

Acts::BinUtility Acts::JsonGeometryConverter::jsonToBinUtility ( const nlohmann::json bin)
private

Create the BinUtility for from Json.

Create the BinUtility for this.

Definition at line 865 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 865 of file JsonGeometryConverter.cpp

References Acts::binningValueNames, Acts::closed, max, min, and Acts::open.

std::pair< std::map< Acts::GeometryID, std::shared_ptr< const Acts::ISurfaceMaterial > >, std::map< Acts::GeometryID, std::shared_ptr< const Acts::IVolumeMaterial > > > Acts::JsonGeometryConverter::jsonToMaterialMaps ( const nlohmann::json materialmaps)

Convert method

Parameters
surfaceMaterialMapThe indexed material map collection

Definition at line 56 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 56 of file JsonGeometryConverter.cpp

References ACTS_VERBOSE, Acts::GeometryID::setApproach(), Acts::GeometryID::setBoundary(), Acts::GeometryID::setLayer(), Acts::GeometryID::setSensitive(), and Acts::GeometryID::setVolume().

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::JsonMaterialDecorator::JsonMaterialDecorator().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Acts::MaterialPropertiesMatrix Acts::JsonGeometryConverter::jsonToMaterialMatrix ( const nlohmann::json data)
private

Create the Material Matrix.

Create the Material Matrix from Json

Parameters
datais the json part representing a material data array

This is assumed to be an array or array of array[6]

Definition at line 846 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 846 of file JsonGeometryConverter.cpp

const Acts::ISurfaceMaterial * Acts::JsonGeometryConverter::jsonToSurfaceMaterial ( const nlohmann::json material)
private

Create the Surface Material.

Create the Surface Material from Json

  • factory method, ownership given
    Parameters
    materialis the json part representing a material object

Definition at line 314 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 314 of file JsonGeometryConverter.cpp

References Acts::BinUtility::bins(), and nlohmann::basic_json::items().

+ Here is the call graph for this function:

const Acts::IVolumeMaterial * Acts::JsonGeometryConverter::jsonToVolumeMaterial ( const nlohmann::json material)
private

Create the Volume Material.

Create the Volume Material from Json

  • factory method, ownership given
    Parameters
    materialis the json part representing a material object

Definition at line 346 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 346 of file JsonGeometryConverter.cpp

References Acts::detail::Grid< T, Axes >::at(), bin, Acts::Material::classificationNumbers(), Acts::createGrid2D(), Acts::createGrid3D(), Acts::BinUtility::dimensions(), nlohmann::basic_json::items(), max, Acts::detail::Grid< T, Axes >::maxPosition(), min, Acts::detail::Grid< T, Axes >::minPosition(), and Acts::detail::Grid< T, Axes >::numLocalBins().

+ Here is the call graph for this function:

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

Private access to the logging instance.

Definition at line 250 of file JsonGeometryConverter.hpp.

View newest version in sPHENIX GitHub at line 250 of file JsonGeometryConverter.hpp

References Acts::JsonGeometryConverter::Config::logger, and m_cfg.

json Acts::JsonGeometryConverter::materialMapsToJson ( const DetectorMaterialMaps maps)

Convert method

Parameters
surfaceMaterialMapThe indexed material map collection

Convert method

Definition at line 165 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 165 of file JsonGeometryConverter.cpp

References Acts::JsonGeometryConverter::DetectorRep::volumes.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and FW::Json::JsonMaterialWriter::write().

+ Here is the caller graph for this function:

json Acts::JsonGeometryConverter::surfaceMaterialToJson ( const ISurfaceMaterial sMaterial)
private

SurfaceMaterial to Json

Parameters
theSurfaceMaterial

Return the thickness in mm

Definition at line 587 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 587 of file JsonGeometryConverter.cpp

References Acts::BinUtility::binningData(), Acts::binningValueNames, Acts::closed, if(), and nlohmann::basic_json::push_back().

+ Here is the call graph for this function:

json Acts::JsonGeometryConverter::trackingGeometryToJson ( const TrackingGeometry tGeometry)

Write method

Parameters
tGeometryis the tracking geometry which contains the material

Definition at line 431 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 431 of file JsonGeometryConverter.cpp

References Acts::TrackingGeometry::highestTrackingVolume().

Referenced by FW::Json::JsonMaterialWriter::write().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

json Acts::JsonGeometryConverter::volumeMaterialToJson ( const IVolumeMaterial vMaterial)
private

VolumeMaterial to Json

Parameters
theVolumeMaterial

Definition at line 689 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 689 of file JsonGeometryConverter.cpp

References Acts::detail::Grid< T, Axes >::at(), bin, Acts::BinUtility::binningData(), Acts::binningValueNames, Acts::closed, if(), mat, nlohmann::basic_json::push_back(), and Acts::detail::Grid< T, Axes >::size().

+ Here is the call graph for this function:

Member Data Documentation

Config Acts::JsonGeometryConverter::m_cfg
private

The config class.

Definition at line 247 of file JsonGeometryConverter.hpp.

View newest version in sPHENIX GitHub at line 247 of file JsonGeometryConverter.hpp

Referenced by JsonGeometryConverter(), and logger().


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