|
ACTS
Experiment-independent tracking
|
Converter for tracking geometry JSON payloads. More...
#include <ActsPlugins/Json/TrackingGeometryJsonConverter.hpp>
Classes | |
| struct | Config |
| Configuration for the tracking geometry JSON converter. More... | |
| struct | IdToPointerLikeLookup |
| Generic lookup from serialized ID to pointer-like object holder. More... | |
| struct | Options |
| JSON serialization options for tracking geometry conversion. More... | |
| struct | PointerToIdLookup |
| Generic lookup from object pointer identity to serialized object ID. More... | |
Public Types | |
| using | NavigationPolicyDecoder |
| Navigation policy decoder. | |
| using | NavigationPolicyEncoder |
| Navigation policy encoder. | |
| using | PortalIdLookup = PointerToIdLookup<Portal, kPortalLookupContext> |
| Portal map to its JSON ID. | |
| using | PortalLinkDecoder |
| Portal link decoder. | |
| using | PortalLinkEncoder |
| Portal link encoder. | |
| using | PortalPointerLookup |
| JSON ID map to its portal. | |
| using | SurfaceIdLookup = PointerToIdLookup<Surface, kSurfaceLookupContext> |
| Surface map to its JSON ID. | |
| using | SurfacePointerLookup |
| JSON ID map to its surface. | |
| using | VolumeBoundsDecoder = JsonKindDispatcher<std::unique_ptr<VolumeBounds>> |
| Volume bounds decoder. | |
| using | VolumeBoundsEncoder = TypeDispatcher<VolumeBounds, nlohmann::json()> |
| Volume bounds encoder. | |
| using | VolumeIdLookup |
| Tracking volume map to its JSON ID. | |
| using | VolumePointerLookup |
| JSON ID map to its tracking volume. | |
Public Member Functions | |
| TrackingGeometryJsonConverter (Config config=Config::defaultConfig(), std::unique_ptr< const Acts::Logger > logger=Acts::getDefaultLogger("TrackingGeometryJsonConverter", Acts::Logging::INFO)) | |
| Construct converter with custom or default dispatch configuration. | |
| std::shared_ptr< TrackingGeometry > | fromJson (const GeometryContext &gctx, const nlohmann::json &encoded, const Options &options=Options{}) const |
| Reconstruct a tracking geometry from JSON. | |
| std::unique_ptr< Acts::INavigationPolicy > | navigationPolicyFromJson (const Acts::GeometryContext &gctx, const nlohmann::json &encoded, const Acts::TrackingVolume &volume, const Acts::Logger &logger) const |
| Deserialize navigation policy using configured decoders. | |
| nlohmann::json | navigationPolicyToJson (const INavigationPolicy &policy) const |
| Serialize navigation policy using the configured dispatcher. | |
| std::unique_ptr< PortalLinkBase > | portalLinkFromJson (const nlohmann::json &encoded, const SurfacePointerLookup &surfaces, const VolumePointerLookup &volumes) const |
| Deserialize one portal link using configured decoders. | |
| nlohmann::json | portalLinkToJson (const GeometryContext &gctx, const PortalLinkBase &link, const SurfaceIdLookup &surfaceIds, const VolumeIdLookup &volumeIds) const |
| Serialize one portal link using the configured dispatcher. | |
| nlohmann::json | toJson (const GeometryContext &gctx, const TrackingGeometry &geometry, const Options &options=Options{}) const |
| Convert a tracking geometry to JSON. | |
| std::shared_ptr< TrackingVolume > | trackingVolumeFromJson (const GeometryContext &gctx, const nlohmann::json &encoded, const Options &options=Options{}) const |
| Reconstruct a tracking volume hierarchy from JSON. | |
| nlohmann::json | trackingVolumeToJson (const GeometryContext &gctx, const TrackingVolume &world, const Options &options=Options{}) const |
| Convert a tracking volume hierarchy to JSON. | |
Converter for tracking geometry JSON payloads.
High-level conversion overview:
Navigation policy decoder.
Navigation policy encoder.
Portal link decoder.
Portal link encoder.
JSON ID map to its portal.
JSON ID map to its surface.
Tracking volume map to its JSON ID.
JSON ID map to its tracking volume.
|
explicit |
Construct converter with custom or default dispatch configuration.
| config | The conversion dispatch configuration |
| logger | The logger instance |
| std::shared_ptr< TrackingGeometry > Acts::TrackingGeometryJsonConverter::fromJson | ( | const GeometryContext & | gctx, |
| const nlohmann::json & | encoded, | ||
| const Options & | options = Options{} ) const |
Reconstruct a tracking geometry from JSON.
| gctx | geometry context |
| encoded | serialized tracking geometry |
| options | options for the conversion |
| std::unique_ptr< Acts::INavigationPolicy > Acts::TrackingGeometryJsonConverter::navigationPolicyFromJson | ( | const Acts::GeometryContext & | gctx, |
| const nlohmann::json & | encoded, | ||
| const Acts::TrackingVolume & | volume, | ||
| const Acts::Logger & | logger ) const |
Deserialize navigation policy using configured decoders.
| gctx | geometry context |
| encoded | serialized navigation policy |
| volume | tracking volume to assign navigation policy to |
| logger | logging instance |
| nlohmann::json Acts::TrackingGeometryJsonConverter::navigationPolicyToJson | ( | const INavigationPolicy & | policy | ) | const |
Serialize navigation policy using the configured dispatcher.
| policy | navigation policy to serialize |
| std::unique_ptr< PortalLinkBase > Acts::TrackingGeometryJsonConverter::portalLinkFromJson | ( | const nlohmann::json & | encoded, |
| const SurfacePointerLookup & | surfaces, | ||
| const VolumePointerLookup & | volumes ) const |
Deserialize one portal link using configured decoders.
| encoded | serialized portal link |
| surfaces | id-to-surface map for internal lookup |
| volumes | id-to-volume map for internal lookup |
| nlohmann::json Acts::TrackingGeometryJsonConverter::portalLinkToJson | ( | const GeometryContext & | gctx, |
| const PortalLinkBase & | link, | ||
| const SurfaceIdLookup & | surfaceIds, | ||
| const VolumeIdLookup & | volumeIds ) const |
Serialize one portal link using the configured dispatcher.
| gctx | geometry context |
| link | portal link to serialize |
| surfaceIds | surface-to-id map for internal lookup |
| volumeIds | volume-to-id map for internal lookup |
| nlohmann::json Acts::TrackingGeometryJsonConverter::toJson | ( | const GeometryContext & | gctx, |
| const TrackingGeometry & | geometry, | ||
| const Options & | options = Options{} ) const |
Convert a tracking geometry to JSON.
| gctx | geometry context |
| geometry | tracking geometry to convert |
| options | options for the conversion |
| std::shared_ptr< TrackingVolume > Acts::TrackingGeometryJsonConverter::trackingVolumeFromJson | ( | const GeometryContext & | gctx, |
| const nlohmann::json & | encoded, | ||
| const Options & | options = Options{} ) const |
Reconstruct a tracking volume hierarchy from JSON.
| gctx | geometry context |
| encoded | serialized tracking volume hierarchy |
| options | options for the conversion |
| nlohmann::json Acts::TrackingGeometryJsonConverter::trackingVolumeToJson | ( | const GeometryContext & | gctx, |
| const TrackingVolume & | world, | ||
| const Options & | options = Options{} ) const |
Convert a tracking volume hierarchy to JSON.
| gctx | geometry context |
| world | top tracking volume in the hierarchy |
| options | options for the conversion |