Analysis Software
Documentation for sPHENIX simulation software
|
#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 decorator_t *decorator) const |
Container | fromJson (const nlohmann::json &encoded) const |
Static Public Member Functions | |
static nlohmann::json | encodeIdentifier (const GeometryIdentifier &id) |
static GeometryIdentifier | decodeIdentifier (const nlohmann::json &encoded) |
Decode a geometry identifier from a json object. | |
Private Attributes | |
std::string | m_valueIdentifier |
Static Private Attributes | |
static constexpr const char * | kHeaderKey = "acts-geometry-hierarchy-map" |
static constexpr const char * | 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 37 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 37 of file GeometryHierarchyMapJsonConverter.hpp
using Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t >::Container = GeometryHierarchyMap<value_t> |
Definition at line 40 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 40 of file GeometryHierarchyMapJsonConverter.hpp
using Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t >::Value = value_t |
Definition at line 39 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 39 of file GeometryHierarchyMapJsonConverter.hpp
|
inline |
Construct the converter.
valueIdentifier | user-defined identifier for the stored value |
Definition at line 45 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 45 of file GeometryHierarchyMapJsonConverter.hpp
|
inlinestatic |
Decode a geometry identifier from a json object.
encoded | is the json object that carries the encoded identifier |
Definition at line 97 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 97 of file GeometryHierarchyMapJsonConverter.hpp
|
inlinestatic |
Encode the geometry identifier
id | is the geometry identifier that will be encoded |
Definition at line 70 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 70 of file GeometryHierarchyMapJsonConverter.hpp
auto Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_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 169 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 169 of file GeometryHierarchyMapJsonConverter.hpp
References entry, Acts::GeometryHierarchyMap< value_t >::find(), testing::internal::move(), and value.
nlohmann::json Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t >::toJson | ( | const Container & | container, |
const decorator_t * | decorator | ||
) | const |
Encode the geometry hierarchy map into a Json object.
container | Geometry hierarchy map that should be encoded |
decorator | nullptr or a decorator to add extra values to the json output |
Definition at line 145 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 145 of file GeometryHierarchyMapJsonConverter.hpp
References TauVsDIS_MachineLearning_Differentiation::array, Acts::decorateJson(), entry, i, Acts::GeometryHierarchyMap< value_t >::idAt(), testing::internal::move(), Acts::GeometryHierarchyMap< value_t >::size(), value, and Acts::GeometryHierarchyMap< value_t >::valueAt().
|
staticprivate |
Definition at line 109 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 109 of file GeometryHierarchyMapJsonConverter.hpp
|
staticprivate |
The version of the encoded Json container format. This must be increased manually every time the container format changes.
Definition at line 112 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 112 of file GeometryHierarchyMapJsonConverter.hpp
|
staticprivate |
Definition at line 108 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 108 of file GeometryHierarchyMapJsonConverter.hpp
|
private |
Definition at line 114 of file GeometryHierarchyMapJsonConverter.hpp.
View newest version in sPHENIX GitHub at line 114 of file GeometryHierarchyMapJsonConverter.hpp