ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::PortalJsonConverter Namespace Reference

Classes

struct  Options

Functions

std::shared_ptr< Experimental::Portal > fromJson (const GeometryContext &gctx, const nlohmann::json &jPortal, const std::vector< std::shared_ptr< Experimental::DetectorVolume > > &detectorVolumes)
 convert from json format
nlohmann::json toJson (const Experimental::ExternalNavigationDelegate &updator, const std::vector< const Experimental::DetectorVolume * > &detectorVolumes)
 convert to json format
nlohmann::json toJson (const GeometryContext &gctx, const Experimental::Portal &portal, const std::vector< const Experimental::DetectorVolume * > &detectorVolumes, const Options &options=Options{})
 Convert to json format.
std::tuple< std::vector< nlohmann::json >, std::vector< std::shared_ptr< Surface > > > toJsonDetray (const GeometryContext &gctx, const Experimental::Portal &portal, std::size_t ip, const Experimental::DetectorVolume &volume, const std::vector< OrientedSurface > &orientedSurfaces, const std::vector< const Experimental::DetectorVolume * > &detectorVolumes, const Options &options=Options{})
 Convert to json format - dedicated Detray function.

Function Documentation

◆ fromJson()

std::shared_ptr< Experimental::Portal > Acts::PortalJsonConverter::fromJson ( const GeometryContext & gctx,
const nlohmann::json & jPortal,
const std::vector< std::shared_ptr< Experimental::DetectorVolume > > & detectorVolumes )

convert from json format

Parameters
gctxthe geometry context
jPortalis the json portal description
detectorVolumesis the list of already created detector volumes
Returns
a Portal

◆ toJson() [1/2]

nlohmann::json Acts::PortalJsonConverter::toJson ( const Experimental::ExternalNavigationDelegate & updator,
const std::vector< const Experimental::DetectorVolume * > & detectorVolumes )

convert to json format

Parameters
updatorthe detector volume updator
detectorVolumesthe list of all detector volumes
Returns
a json object

◆ toJson() [2/2]

nlohmann::json Acts::PortalJsonConverter::toJson ( const GeometryContext & gctx,
const Experimental::Portal & portal,
const std::vector< const Experimental::DetectorVolume * > & detectorVolumes,
const Options & options = Options{} )

Convert to json format.

Parameters
gctxthe geometry context
portalthe portal instance
detectorVolumesis the list of all detector voluems for portal pointing
optionshow to write this thing out
Returns
a json object

◆ toJsonDetray()

std::tuple< std::vector< nlohmann::json >, std::vector< std::shared_ptr< Surface > > > Acts::PortalJsonConverter::toJsonDetray ( const GeometryContext & gctx,
const Experimental::Portal & portal,
std::size_t ip,
const Experimental::DetectorVolume & volume,
const std::vector< OrientedSurface > & orientedSurfaces,
const std::vector< const Experimental::DetectorVolume * > & detectorVolumes,
const Options & options = Options{} )

Convert to json format - dedicated Detray function.

Parameters
gctxthe geometry context
portalthe portal instance
ipis the portal index that could be used to pick the oriented surface
volumeis the detector volume to which these surfaces belong to
orientedSurfacesare the bounding surfaces (may still need to be split)
detectorVolumesis the list of all detector voluems for portal pointing
optionshow to write this thing out
Note
that detray relies on singly connected masks, hence a portal from ACTS with multi volume link needs to be split into the multiple volumes
detray also only has outside pointing links
Returns
a tuple of json object