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/sPHENIX/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< GeometryIdentifier, std::shared_ptr< const ISurfaceMaterial >>
 
using VolumeMaterialMap = std::map< GeometryIdentifier, 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
< GeometryIdentifier,
std::shared_ptr< const
ISurfaceMaterial > >, std::map
< GeometryIdentifier,
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.
 
MaterialSlabMatrix jsonToMaterialMatrix (const nlohmann::json &data)
 Create the Material Matrix.
 
BinUtility jsonToBinUtility (const nlohmann::json &bin)
 Create the BinUtility for from Json.
 
Transform3D jsonToTransform (const nlohmann::json &transfo)
 Create the local to global transform 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 95 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 95 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 854 of file JsonGeometryConverter.cpp.

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

References Acts::Surface::bounds(), Acts::CylinderBounds::eHalfLengthZ, Acts::CylinderBounds::eR, Acts::GeometryObject::geometryId(), 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:

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

Create Json from a detector represenation.

Definition at line 276 of file JsonGeometryConverter.cpp.

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

References ACTS_VERBOSE, nlohmann::to_string(), value, 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 909 of file JsonGeometryConverter.cpp.

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

References Acts::binningValueNames, charm_jet_strange_helicity::bins, Acts::closed, max, min, Acts::open, and nlohmann::basic_json::size().

+ Here is the call graph for this function:

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

Convert method

Parameters
surfaceMaterialMapThe indexed material map collection

Definition at line 108 of file JsonGeometryConverter.cpp.

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

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

Referenced by 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::MaterialSlabMatrix 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

Definition at line 894 of file JsonGeometryConverter.cpp.

View newest version in sPHENIX GitHub at line 894 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 371 of file JsonGeometryConverter.cpp.

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

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

+ Here is the call graph for this function:

Acts::Transform3D Acts::JsonGeometryConverter::jsonToTransform ( const nlohmann::json transfo)
private

Create the local to global transform for from Json.

Create the local to global transform.

Definition at line 931 of file JsonGeometryConverter.cpp.

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

References Acts::Test::transform.

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 409 of file JsonGeometryConverter.cpp.

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

References Acts::detail::Grid< T, Axes >::at(), 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(), Acts::detail::Grid< T, Axes >::numLocalBins(), and value.

+ Here is the call graph for this function:

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

Private access to the logging instance.

Definition at line 258 of file JsonGeometryConverter.hpp.

View newest version in sPHENIX GitHub at line 258 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 222 of file JsonGeometryConverter.cpp.

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

References value, and Acts::JsonGeometryConverter::DetectorRep::volumes.

Referenced by BOOST_AUTO_TEST_CASE(), and ActsExamples::JsonMaterialWriter::write().

+ Here is the caller graph for this function:

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

SurfaceMaterial to Json

Parameters
theSurfaceMaterial

Definition at line 650 of file JsonGeometryConverter.cpp.

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

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

+ 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 494 of file JsonGeometryConverter.cpp.

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

References Acts::TrackingGeometry::highestTrackingVolume().

Referenced by ActsExamples::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 744 of file JsonGeometryConverter.cpp.

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

References nlohmann::basic_json::array(), Acts::detail::Grid< T, Axes >::at(), 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 255 of file JsonGeometryConverter.hpp.

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

Referenced by JsonGeometryConverter(), and logger().


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