|
ACTS
Experiment-independent tracking
|
Provides functionality to instantiate grids and grid collections. More...
#include <detray/builders/grid_factory.hpp>
Public Types | |
| using | algebra_type = algebra_t |
| Linear algebra backend used by the grid. | |
| using | bin_type = bin_t |
| Bin container type used for grid values. | |
| template<typename grid_shape_t> | |
| using | grid_type = grid<algebra_t, axes<grid_shape_t>, bin_type, serializer_t> |
| Grid type parameterized by a geometric shape. | |
| template<typename grid_shape_t> | |
| using | loc_bin_index = typename grid_type<grid_shape_t>::loc_bin_index |
| Local index type for bins in a grid of the selected shape. | |
| using | scalar_type = dscalar<algebra_t> |
| Scalar type used by axes and geometry coordinates. | |
| template<typename T> | |
| using | vector_type = host_container_types::template vector_type<T> |
| Host vector container type used by grid storage. | |
Public Member Functions | |
| grid_factory (vecmem::memory_resource &resource) | |
| Takes the resource of the detector to allocate memory correctly. | |
| template<typename r_bounds = axis::closed<axis::label::e_r>, typename phi_bounds = axis::circular<>, typename r_binning = axis::regular<scalar_type, host_container_types>, typename phi_binning = axis::regular<scalar_type, host_container_types>> requires std::is_enum_v<decltype(r_bounds::label)> | |
| auto | new_grid (const mask< annulus2D, algebra_type > &grid_bounds, const darray< std::size_t, 2UL > n_bins, const std::vector< std::pair< loc_bin_index< annulus2D >, dindex > > &bin_capacities={}, const darray< std::vector< scalar_type >, 2UL > &bin_edges=darray< std::vector< scalar_type >, 2UL >(), const darray< std::vector< scalar_type >, 2UL > &axis_spans=darray< std::vector< scalar_type >, 2UL >()) const |
| Build an annular grid from its mask and axis binning. | |
| template<typename rphi_bounds = axis::circular<axis::label::e_rphi>, typename z_bounds = axis::closed<axis::label::e_cyl_z>, typename rphi_binning = axis::regular<scalar_type, host_container_types>, typename z_binning = axis::regular<scalar_type, host_container_types>> requires std::is_enum_v<decltype(rphi_bounds::label)> | |
| auto | new_grid (const mask< concentric_cylinder2D, algebra_type > &grid_bounds, const darray< std::size_t, 2UL > n_bins, const std::vector< std::pair< loc_bin_index< concentric_cylinder2D >, dindex > > &bin_capacities={}, const darray< std::vector< scalar_type >, 2UL > &bin_edges=darray< std::vector< scalar_type >, 2UL >(), const darray< std::vector< scalar_type >, 2UL > &axis_spans=darray< std::vector< scalar_type >, 2UL >()) const |
| Build a concentric cylindrical grid from its mask and axis binning. | |
| template<typename x_bounds = axis::closed<axis::label::e_x>, typename y_bounds = axis::closed<axis::label::e_y>, typename z_bounds = axis::closed<axis::label::e_z>, typename x_binning = axis::regular<scalar_type, host_container_types>, typename y_binning = axis::regular<scalar_type, host_container_types>, typename z_binning = axis::regular<scalar_type, host_container_types>> requires std::is_enum_v<decltype(x_bounds::label)> | |
| auto | new_grid (const mask< cuboid3D, algebra_type > &grid_bounds, const darray< std::size_t, 3UL > n_bins, const std::vector< std::pair< loc_bin_index< cuboid3D >, dindex > > &bin_capacities={}, const darray< std::vector< scalar_type >, 3UL > &bin_edges=darray< std::vector< scalar_type >, 3UL >(), const darray< std::vector< scalar_type >, 3UL > &axis_spans=darray< std::vector< scalar_type >, 3UL >()) const |
| Build a cuboid grid from its mask and axis binning. | |
| template<typename rphi_bounds = axis::circular<axis::label::e_rphi>, typename z_bounds = axis::closed<axis::label::e_cyl_z>, typename rphi_binning = axis::regular<scalar_type, host_container_types>, typename z_binning = axis::regular<scalar_type, host_container_types>> requires std::is_enum_v<decltype(rphi_bounds::label)> | |
| auto | new_grid (const mask< cylinder2D, algebra_type > &grid_bounds, const darray< std::size_t, 2UL > n_bins, const std::vector< std::pair< loc_bin_index< cylinder2D >, dindex > > &bin_capacities={}, const darray< std::vector< scalar_type >, 2UL > &bin_edges=darray< std::vector< scalar_type >, 2UL >(), const darray< std::vector< scalar_type >, 2UL > &axis_spans=darray< std::vector< scalar_type >, 2UL >()) const |
| Build a cylindrical 2D grid from its mask and axis binning. | |
| template<typename r_bounds = axis::closed<axis::label::e_r>, typename phi_bounds = axis::circular<>, typename z_bounds = axis::closed<axis::label::e_z>, typename r_binning = axis::regular<scalar_type, host_container_types>, typename phi_binning = axis::regular<scalar_type, host_container_types>, typename z_binning = axis::regular<scalar_type, host_container_types>> requires std::is_enum_v<decltype(r_bounds::label)> | |
| auto | new_grid (const mask< cylinder3D, algebra_type > &grid_bounds, const darray< std::size_t, 3UL > n_bins, const std::vector< std::pair< loc_bin_index< cylinder3D >, dindex > > &bin_capacities={}, const darray< std::vector< scalar_type >, 3UL > &bin_edges=darray< std::vector< scalar_type >, 3UL >(), const darray< std::vector< scalar_type >, 3UL > &axis_spans=darray< std::vector< scalar_type >, 3UL >()) const |
| Build a cylindrical 3D grid from its mask and axis binning. | |
| template<typename grid_shape_t, typename... bound_ts, typename... binning_ts> requires concepts::shape<grid_shape_t, algebra_t> | |
| auto | new_grid (const mask< grid_shape_t, algebra_type > &m, const darray< std::size_t, grid_shape_t::dim > &n_bins, const std::vector< std::pair< axis::multi_bin< sizeof...(bound_ts)>, dindex > > &bin_capacities={}, const darray< std::vector< scalar_type >, grid_shape_t::dim > &ax_bin_edges={}, const types::list< bound_ts... > &={}, const types::list< binning_ts... > &={}) const |
| Helper overload for grid builder: Build from mask and resolve bounds and binnings. | |
| template<concepts::grid grid_t, typename grid_shape_t> requires concepts::shape<grid_shape_t, algebra_t> | |
| auto | new_grid (const mask< grid_shape_t, algebra_type > &m, const darray< std::size_t, grid_t::dim > &n_bins, const std::vector< std::pair< typename grid_t::loc_bin_index, dindex > > &bin_capacities={}, const darray< std::vector< scalar_type >, grid_t::dim > &ax_bin_edges={}) const |
| Helper overload for grid builder: Build from mask and resolve bounds and binnings from concrete grid type. | |
| template<typename x_bounds = axis::closed<axis::label::e_x>, typename y_bounds = axis::closed<axis::label::e_y>, typename x_binning = axis::regular<scalar_type, host_container_types>, typename y_binning = axis::regular<scalar_type, host_container_types>> requires std::is_enum_v<decltype(x_bounds::label)> | |
| auto | new_grid (const mask< rectangle2D, algebra_type > &grid_bounds, const darray< std::size_t, 2UL > n_bins, const std::vector< std::pair< loc_bin_index< rectangle2D >, dindex > > &bin_capacities={}, const darray< std::vector< scalar_type >, 2UL > &bin_edges=darray< std::vector< scalar_type >, 2UL >(), const darray< std::vector< scalar_type >, 2UL > &axis_spans=darray< std::vector< scalar_type >, 2UL >()) const |
| Build a rectangular grid from its mask and axis binning. | |
| template<typename r_bounds = axis::closed<axis::label::e_r>, typename phi_bounds = axis::circular<>, typename r_binning = axis::regular<scalar_type, host_container_types>, typename phi_binning = axis::regular<scalar_type, host_container_types>> requires std::is_enum_v<decltype(r_bounds::label)> | |
| auto | new_grid (const mask< ring2D, algebra_type > &grid_bounds, const darray< std::size_t, 2UL > n_bins, const std::vector< std::pair< loc_bin_index< ring2D >, dindex > > &bin_capacities={}, const darray< std::vector< scalar_type >, 2UL > &bin_edges=darray< std::vector< scalar_type >, 2UL >(), const darray< std::vector< scalar_type >, 2UL > &axis_spans=darray< std::vector< scalar_type >, 2UL >()) const |
| Build a ring grid from its mask and axis binning. | |
| template<typename x_bounds = axis::closed<axis::label::e_x>, typename y_bounds = axis::closed<axis::label::e_y>, typename x_binning = axis::regular<scalar_type, host_container_types>, typename y_binning = axis::regular<scalar_type, host_container_types>> requires std::is_enum_v<decltype(x_bounds::label)> | |
| auto | new_grid (const mask< trapezoid2D, algebra_type > &grid_bounds, const darray< std::size_t, 2UL > n_bins, const std::vector< std::pair< loc_bin_index< trapezoid2D >, dindex > > &bin_capacities={}, const darray< std::vector< scalar_type >, 2UL > &bin_edges=darray< std::vector< scalar_type >, 2UL >(), const darray< std::vector< scalar_type >, 2UL > &axis_spans=darray< std::vector< scalar_type >, 2UL >()) const |
| Build a trapezoidal grid from its mask and axis binning. | |
| template<concepts::coordinate_frame grid_frame_t, typename... bound_ts, typename... binning_ts> | |
| auto | new_grid (const std::vector< scalar_type > &spans, const std::vector< std::size_t > &n_bins, const std::vector< std::pair< axis::multi_bin< sizeof...(bound_ts)>, dindex > > &bin_capacities={}, const std::vector< std::vector< scalar_type > > &ax_bin_edges={}, const types::list< bound_ts... > &={}, const types::list< binning_ts... > &={}) const |
| Create and empty grid with fully initialized axes. | |
| template<typename grid_shape_t, typename... bound_ts, typename... binning_ts> requires concepts::shape<grid_shape_t, algebra_t> | |
| auto | new_grid (const std::vector< scalar_type > &spans, const std::vector< std::size_t > &n_bins, const std::vector< std::pair< axis::multi_bin< sizeof...(bound_ts)>, dindex > > &bin_capacities={}, const std::vector< std::vector< scalar_type > > &ax_bin_edges={}, const types::list< bound_ts... > &bounds={}, const types::list< binning_ts... > &binnings={}) const |
| Helper to build grid from shape plus binning and bounds types. | |
| template<concepts::grid grid_t> | |
| auto | new_grid (const std::vector< scalar_type > &spans, const std::vector< std::size_t > &n_bins, const std::vector< std::pair< typename grid_t::loc_bin_index, dindex > > &bin_capacities={}, const std::vector< std::vector< scalar_type > > &ax_bin_edges={}) const |
| Create and empty grid with fully initialized axes. | |
Static Public Attributes | |
| static constexpr bool | is_owning = true |
| Grid instances returned by this factory own their axis and bin storage. | |
Provides functionality to instantiate grids and grid collections.
| bin_t | type bins in the grid |
| serialzier_t | type of the serializer to the storage representations |
| algebra_t | the matrix/vector/point types to use |
| container_t | the container types to use |
throughout:
|
explicit |
Takes the resource of the detector to allocate memory correctly.
| resource | Resource used to allocate grid storage. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const mask< annulus2D, algebra_type > & | grid_bounds, |
| const darray< std::size_t, 2UL > | n_bins, | ||
| const std::vector< std::pair< loc_bin_index< annulus2D >, dindex > > & | bin_capacities = {}, | ||
| const darray< std::vector< scalar_type >, 2UL > & | bin_edges = darray<std::vector<scalar_type>, 2UL>(), | ||
| const darray< std::vector< scalar_type >, 2UL > & | axis_spans = darray<std::vector<scalar_type>, 2UL>() ) const |
Build an annular grid from its mask and axis binning.
| grid_bounds | Mask supplying the grid extent. |
| n_bins | Number of bins on each axis. |
| bin_capacities | Optional capacities for local bins. |
| bin_edges | Optional explicit edges for variable binning. |
| axis_spans | Optional axis ranges that override mask bounds. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const mask< concentric_cylinder2D, algebra_type > & | grid_bounds, |
| const darray< std::size_t, 2UL > | n_bins, | ||
| const std::vector< std::pair< loc_bin_index< concentric_cylinder2D >, dindex > > & | bin_capacities = {}, | ||
| const darray< std::vector< scalar_type >, 2UL > & | bin_edges = darray<std::vector<scalar_type>, 2UL>(), | ||
| const darray< std::vector< scalar_type >, 2UL > & | axis_spans = darray<std::vector<scalar_type>, 2UL>() ) const |
Build a concentric cylindrical grid from its mask and axis binning.
| grid_bounds | Mask supplying the grid extent. |
| n_bins | Number of bins on each axis. |
| bin_capacities | Optional capacities for local bins. |
| bin_edges | Optional explicit edges for variable binning. |
| axis_spans | Optional axis ranges that override mask bounds. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const mask< cuboid3D, algebra_type > & | grid_bounds, |
| const darray< std::size_t, 3UL > | n_bins, | ||
| const std::vector< std::pair< loc_bin_index< cuboid3D >, dindex > > & | bin_capacities = {}, | ||
| const darray< std::vector< scalar_type >, 3UL > & | bin_edges = darray<std::vector<scalar_type>, 3UL>(), | ||
| const darray< std::vector< scalar_type >, 3UL > & | axis_spans = darray<std::vector<scalar_type>, 3UL>() ) const |
Build a cuboid grid from its mask and axis binning.
| grid_bounds | Mask supplying the grid extent. |
| n_bins | Number of bins on each axis. |
| bin_capacities | Optional capacities for local bins. |
| bin_edges | Optional explicit edges for variable binning. |
| axis_spans | Optional axis ranges that override mask bounds. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const mask< cylinder2D, algebra_type > & | grid_bounds, |
| const darray< std::size_t, 2UL > | n_bins, | ||
| const std::vector< std::pair< loc_bin_index< cylinder2D >, dindex > > & | bin_capacities = {}, | ||
| const darray< std::vector< scalar_type >, 2UL > & | bin_edges = darray<std::vector<scalar_type>, 2UL>(), | ||
| const darray< std::vector< scalar_type >, 2UL > & | axis_spans = darray<std::vector<scalar_type>, 2UL>() ) const |
Build a cylindrical 2D grid from its mask and axis binning.
| grid_bounds | Mask supplying the grid extent. |
| n_bins | Number of bins on each axis. |
| bin_capacities | Optional capacities for local bins. |
| bin_edges | Optional explicit edges for variable binning. |
| axis_spans | Optional axis ranges that override mask bounds. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const mask< cylinder3D, algebra_type > & | grid_bounds, |
| const darray< std::size_t, 3UL > | n_bins, | ||
| const std::vector< std::pair< loc_bin_index< cylinder3D >, dindex > > & | bin_capacities = {}, | ||
| const darray< std::vector< scalar_type >, 3UL > & | bin_edges = darray<std::vector<scalar_type>, 3UL>(), | ||
| const darray< std::vector< scalar_type >, 3UL > & | axis_spans = darray<std::vector<scalar_type>, 3UL>() ) const |
Build a cylindrical 3D grid from its mask and axis binning.
| grid_bounds | Mask supplying the grid extent. |
| n_bins | Number of bins on each axis. |
| bin_capacities | Optional capacities for local bins. |
| bin_edges | Optional explicit edges for variable binning. |
| axis_spans | Optional axis ranges that override mask bounds. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const mask< grid_shape_t, algebra_type > & | m, |
| const darray< std::size_t, grid_shape_t::dim > & | n_bins, | ||
| const std::vector< std::pair< axis::multi_bin< sizeof...(bound_ts)>, dindex > > & | bin_capacities = {}, | ||
| const darray< std::vector< scalar_type >, grid_shape_t::dim > & | ax_bin_edges = {}, | ||
| const types::list< bound_ts... > & | = {}, | ||
| const types::list< binning_ts... > & | = {} ) const |
Helper overload for grid builder: Build from mask and resolve bounds and binnings.
| m | Mask defining the grid extent. |
| n_bins | Number of bins on each axis. |
| bin_capacities | Optional capacities for local bins. |
| ax_bin_edges | Optional explicit edges for variable binning. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const mask< grid_shape_t, algebra_type > & | m, |
| const darray< std::size_t, grid_t::dim > & | n_bins, | ||
| const std::vector< std::pair< typename grid_t::loc_bin_index, dindex > > & | bin_capacities = {}, | ||
| const darray< std::vector< scalar_type >, grid_t::dim > & | ax_bin_edges = {} ) const |
Helper overload for grid builder: Build from mask and resolve bounds and binnings from concrete grid type.
| m | Mask defining the grid extent. |
| n_bins | Number of bins on each axis. |
| bin_capacities | Optional capacities for local bins. |
| ax_bin_edges | Optional explicit edges for variable binning. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const mask< rectangle2D, algebra_type > & | grid_bounds, |
| const darray< std::size_t, 2UL > | n_bins, | ||
| const std::vector< std::pair< loc_bin_index< rectangle2D >, dindex > > & | bin_capacities = {}, | ||
| const darray< std::vector< scalar_type >, 2UL > & | bin_edges = darray<std::vector<scalar_type>, 2UL>(), | ||
| const darray< std::vector< scalar_type >, 2UL > & | axis_spans = darray<std::vector<scalar_type>, 2UL>() ) const |
Build a rectangular grid from its mask and axis binning.
| grid_bounds | Mask supplying the grid extent. |
| n_bins | Number of bins on each axis. |
| bin_capacities | Optional capacities for local bins. |
| bin_edges | Optional explicit edges for variable binning. |
| axis_spans | Optional axis ranges that override mask bounds. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const mask< ring2D, algebra_type > & | grid_bounds, |
| const darray< std::size_t, 2UL > | n_bins, | ||
| const std::vector< std::pair< loc_bin_index< ring2D >, dindex > > & | bin_capacities = {}, | ||
| const darray< std::vector< scalar_type >, 2UL > & | bin_edges = darray<std::vector<scalar_type>, 2UL>(), | ||
| const darray< std::vector< scalar_type >, 2UL > & | axis_spans = darray<std::vector<scalar_type>, 2UL>() ) const |
Build a ring grid from its mask and axis binning.
| grid_bounds | Mask supplying the grid extent. |
| n_bins | Number of bins on each axis. |
| bin_capacities | Optional capacities for local bins. |
| bin_edges | Optional explicit edges for variable binning. |
| axis_spans | Optional axis ranges that override mask bounds. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const mask< trapezoid2D, algebra_type > & | grid_bounds, |
| const darray< std::size_t, 2UL > | n_bins, | ||
| const std::vector< std::pair< loc_bin_index< trapezoid2D >, dindex > > & | bin_capacities = {}, | ||
| const darray< std::vector< scalar_type >, 2UL > & | bin_edges = darray<std::vector<scalar_type>, 2UL>(), | ||
| const darray< std::vector< scalar_type >, 2UL > & | axis_spans = darray<std::vector<scalar_type>, 2UL>() ) const |
Build a trapezoidal grid from its mask and axis binning.
| grid_bounds | Mask supplying the grid extent. |
| n_bins | Number of bins on each axis. |
| bin_capacities | Optional capacities for local bins. |
| bin_edges | Optional explicit edges for variable binning. |
| axis_spans | Optional axis ranges that override mask bounds. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const std::vector< scalar_type > & | spans, |
| const std::vector< std::size_t > & | n_bins, | ||
| const std::vector< std::pair< axis::multi_bin< sizeof...(bound_ts)>, dindex > > & | bin_capacities = {}, | ||
| const std::vector< std::vector< scalar_type > > & | ax_bin_edges = {}, | ||
| const types::list< bound_ts... > & | = {}, | ||
| const types::list< binning_ts... > & | = {} ) const |
Create and empty grid with fully initialized axes.
| grid_shape_t | the shape of the resulting grid (e.g. cylinder2D). |
| e_bounds | the bounds of the regular axes (open vs. closed bounds). |
| binnings | the binning types of the axes (regular vs. irregular) |
| spans | the span of the axis values for regular axes, otherwise ignored. |
| n_bins | the number of bins for regular axes, otherwise ignored |
| bin_capacities | Optional capacities for local bins. |
| ax_bin_edges | the explicit bin edges for irregular axes (lower bin edges + the the upper edge of the last bin), otherwise ignored. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const std::vector< scalar_type > & | spans, |
| const std::vector< std::size_t > & | n_bins, | ||
| const std::vector< std::pair< axis::multi_bin< sizeof...(bound_ts)>, dindex > > & | bin_capacities = {}, | ||
| const std::vector< std::vector< scalar_type > > & | ax_bin_edges = {}, | ||
| const types::list< bound_ts... > & | bounds = {}, | ||
| const types::list< binning_ts... > & | binnings = {} ) const |
Helper to build grid from shape plus binning and bounds types.
| spans | Axis spans used by regular axes. |
| n_bins | Bin counts used by regular axes. |
| bin_capacities | Optional capacities for local bins. |
| ax_bin_edges | Explicit edges for irregular axes. |
| bounds | Axis-bound types for the shape. |
| binnings | Axis-binning types. |
| auto detray::grid_factory< bin_t, serializer_t, algebra_t >::new_grid | ( | const std::vector< scalar_type > & | spans, |
| const std::vector< std::size_t > & | n_bins, | ||
| const std::vector< std::pair< typename grid_t::loc_bin_index, dindex > > & | bin_capacities = {}, | ||
| const std::vector< std::vector< scalar_type > > & | ax_bin_edges = {} ) const |
Create and empty grid with fully initialized axes.
| grid_t | the type of the resulting grid |
| spans | the span of the axis values for regular axes, otherwise ignored. |
| n_bins | the number of bins for regular axes, otherwise ignored |
| bin_capacities | Optional capacities for local bins. |
| ax_bin_edges | the explicit bin edges for irregular axes (lower bin edges + the the upper edge of the last bin), otherwise ignored. |