|
ACTS
Experiment-independent tracking
|
Versioned material-document conversion, independent of the legacy material converters. More...
#include <ActsPlugins/Json/TrackingGeometryMaterialJsonConverter.hpp>
Classes | |
| struct | Config |
| Built-in or application-extended serialization registry. More... | |
| class | DecodeContext |
| Per-document decoding state, also available to application decoders. More... | |
| class | EncodeContext |
| Per-document encoding state, also available to application encoders. More... | |
| struct | Options |
| Output options. Version is a property of this codec, not an option. More... | |
Public Types | |
| using | SlabStore = std::shared_ptr<std::vector<MaterialSlab>> |
| Shared grid slab allocation. | |
| using | SurfaceDecoder |
| Surface decoder dispatch by kind. | |
| using | SurfaceEncoder |
| Concrete surface encoder dispatch. | |
Public Member Functions | |
| TrackingGeometryMaterialJsonConverter (Config config=Config::defaultConfig()) | |
| Construct with default or application-extended dispatchers. | |
| TrackingGeometryMaterial | fromFile (const std::filesystem::path &path) const |
| Read a document, detecting encoding/compression from file contents. | |
| TrackingGeometryMaterial | fromJson (const nlohmann::json &encoded) const |
| Decode and validate a complete material document. | |
| void | toFile (const TrackingGeometryMaterial &material, const std::filesystem::path &path, const Options &options=Options::defaultOptions()) const |
| Write JSON/CBOR with optional zstd, selected by the filename extension. | |
| nlohmann::json | toJson (const TrackingGeometryMaterial &material, const Options &options=Options::defaultOptions()) const |
| Encode a complete material document. | |
Versioned material-document conversion, independent of the legacy material converters.
Applies no material to geometry. The reader checks construction invariants; use the offline JSON Schema for full format validation. Version 1 supports surface material only; volume assignments are rejected.
Surface decoder dispatch by kind.
Concrete surface encoder dispatch.
|
explicit |
Construct with default or application-extended dispatchers.
| config | Payload conversion registry |
| TrackingGeometryMaterial Acts::TrackingGeometryMaterialJsonConverter::fromFile | ( | const std::filesystem::path & | path | ) | const |
Read a document, detecting encoding/compression from file contents.
| path | Input filename |
| TrackingGeometryMaterial Acts::TrackingGeometryMaterialJsonConverter::fromJson | ( | const nlohmann::json & | encoded | ) | const |
Decode and validate a complete material document.
| encoded | Versioned document, never the legacy hierarchy-map layout |
| void Acts::TrackingGeometryMaterialJsonConverter::toFile | ( | const TrackingGeometryMaterial & | material, |
| const std::filesystem::path & | path, | ||
| const Options & | options = Options::defaultOptions() ) const |
Write JSON/CBOR with optional zstd, selected by the filename extension.
| material | Material container |
| path | Output filename |
| options | Output precision, formatting and compression |
| nlohmann::json Acts::TrackingGeometryMaterialJsonConverter::toJson | ( | const TrackingGeometryMaterial & | material, |
| const Options & | options = Options::defaultOptions() ) const |
Encode a complete material document.
| material | Container, including an optional description |
| options | Output precision (formatting applies only to files) |
| std::invalid_argument | if volume assignments are present or the requested precision is outside [0, 23] |