EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <acts/blob/sPHENIX/Plugins/Json/include/Acts/Plugins/Json/GeometryHierarchyMapJsonConverter.hpp>
Public Types | |
using | Value = value_t |
using | Container = GeometryHierarchyMap< value_t > |
Public Member Functions | |
GeometryHierarchyMapJsonConverter (std::string valueIdentifier) | |
nlohmann::json | toJson (const Container &container) const |
Container | fromJson (const nlohmann::json &encoded) const |
Static Private Member Functions | |
static nlohmann::json | encodeIdentifier (GeometryIdentifier id) |
static GeometryIdentifier | decodeIdentifier (const nlohmann::json &encoded) |
Private Attributes | |
std::string | m_valueIdentifier |
Static Private Attributes | |
static constexpr const char *const | kHeaderKey = "acts-geometry-hierarchy-map" |
static constexpr const char *const | kEntriesKey = "entries" |
static constexpr int | kFormatVersion = 0 |
Convert a geometry hierarchy map to/from Json.
value_t | value type stored in the geometry hierarchy map |
The value type is expected to be directly convertible to/from a Json object. It has to be either a fundamental type or appropriate to_json(json&, const value_t&)
and from_json(const json&, value_t&)
functions must be available. See the relevant nlohmann::json documentation for further information.
A user-defined identifier is stored in the encoded Json object that is used to identify which value type is stored in the file. The identifier is checked for consistency when decoding the Json object.
Definition at line 36 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 36 of file GeometryHierarchyMapJsonConverter.hpp
using Acts::GeometryHierarchyMapJsonConverter< value_t >::Container = GeometryHierarchyMap<value_t> |
Definition at line 39 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 39 of file GeometryHierarchyMapJsonConverter.hpp
using Acts::GeometryHierarchyMapJsonConverter< value_t >::Value = value_t |
Definition at line 38 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 38 of file GeometryHierarchyMapJsonConverter.hpp
|
inline |
Construct the converter.
valueIdentifier | user-defined identifier for the stored value |
Definition at line 44 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 44 of file GeometryHierarchyMapJsonConverter.hpp
References Acts::GeometryHierarchyMapJsonConverter< value_t >::m_valueIdentifier.
|
inlinestaticprivate |
Definition at line 93 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 93 of file GeometryHierarchyMapJsonConverter.hpp
References Acts::GeometryIdentifier::setVolume(), Acts::UnitConstants::u, and nlohmann::basic_json::value().
|
inlinestaticprivate |
Definition at line 73 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 73 of file GeometryHierarchyMapJsonConverter.hpp
References G4TTL::layer, and Acts::Test::volume.
auto Acts::GeometryHierarchyMapJsonConverter< value_t >::fromJson | ( | const nlohmann::json & | encoded | ) | const |
Decode a Json object into a geometry hierarchy map.
encoded | Json object that should be decoded |
std::invalid_argument | in case of format errors |
Definition at line 127 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 127 of file GeometryHierarchyMapJsonConverter.hpp
References Acts::GeometryHierarchyMap< value_t >::find(), and value.
nlohmann::json Acts::GeometryHierarchyMapJsonConverter< value_t >::toJson | ( | const Container & | container | ) | const |
Encode the geometry hierarchy map into a Json object.
container | Geometry hierarchy map that should be encoded |
Definition at line 107 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 107 of file GeometryHierarchyMapJsonConverter.hpp
References nlohmann::basic_json::array(), Acts::GeometryHierarchyMap< value_t >::idAt(), nlohmann::basic_json::object(), nlohmann::basic_json::push_back(), Acts::GeometryHierarchyMap< value_t >::size(), and Acts::GeometryHierarchyMap< value_t >::valueAt().
|
staticprivate |
Definition at line 66 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 66 of file GeometryHierarchyMapJsonConverter.hpp
|
staticprivate |
The version of the encoded Json container format. This must be increased manually everytime the container format changes.
Definition at line 69 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 69 of file GeometryHierarchyMapJsonConverter.hpp
|
staticprivate |
Definition at line 65 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 65 of file GeometryHierarchyMapJsonConverter.hpp
|
private |
Definition at line 71 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 71 of file GeometryHierarchyMapJsonConverter.hpp
Referenced by Acts::GeometryHierarchyMapJsonConverter< value_t >::GeometryHierarchyMapJsonConverter().