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

Functions

template<typename axis_generator_type, typename value_type = std::vector<std::size_t>>
auto fromJson (const nlohmann::json &jGrid, const axis_generator_type &aGenerator)
 Templated grid conversion from json.
template<typename grid_type>
nlohmann::json toJson (const grid_type &grid)
 Templated grid conversion to json.
template<typename grid_type>
nlohmann::json toJsonDetray (const grid_type &grid, bool swapAxis=false)
 Templated grid conversion to json.

Function Documentation

◆ fromJson()

template<typename axis_generator_type, typename value_type = std::vector<std::size_t>>
auto Acts::GridJsonConverter::fromJson ( const nlohmann::json & jGrid,
const axis_generator_type & aGenerator )

Templated grid conversion from json.

Template Parameters
axis_generator_typethe type of the axis generator which determines the grid type
Parameters
jGridthe json object to represent the grid
aGeneratorthe axis generator
Note
the axis generator also defines the grid dimension
Returns
a grid object

◆ toJson()

template<typename grid_type>
nlohmann::json Acts::GridJsonConverter::toJson ( const grid_type & grid)

Templated grid conversion to json.

Template Parameters
grid_typethe type of the grid
Parameters
gridthe grid object
Returns
a json object to represent the grid

◆ toJsonDetray()

template<typename grid_type>
nlohmann::json Acts::GridJsonConverter::toJsonDetray ( const grid_type & grid,
bool swapAxis = false )

Templated grid conversion to json.

Template Parameters
grid_typethe type of the grid
Parameters
gridthe grid object
swapAxis- this is needed for detray
Note
detray has a different offset for the local indices, it starts at 0
Returns
a json object to represent the grid