ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::grid_factory< bin_t, serializer_t, algebra_t > Class Template Reference

Provides functionality to instantiate grids and grid collections. More...

#include <detray/builders/grid_factory.hpp>

Inheritance diagram for detray::grid_factory< bin_t, serializer_t, algebra_t >:
[legend]

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.

Detailed Description

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
class detray::grid_factory< bin_t, serializer_t, algebra_t >

Provides functionality to instantiate grids and grid collections.

Template Parameters
bin_ttype bins in the grid
serialzier_ttype of the serializer to the storage representations
algebra_tthe matrix/vector/point types to use
container_tthe container types to use

throughout:

Note
that bin_edges is only used for variable binning
that if non-zero axis_spans are provided the values of the mask is overwritten

Constructor & Destructor Documentation

◆ grid_factory()

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
detray::grid_factory< bin_t, serializer_t, algebra_t >::grid_factory ( vecmem::memory_resource & resource)
explicit

Takes the resource of the detector to allocate memory correctly.

Parameters
resourceResource used to allocate grid storage.

Member Function Documentation

◆ new_grid() [1/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
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 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.

Parameters
grid_boundsMask supplying the grid extent.
n_binsNumber of bins on each axis.
bin_capacitiesOptional capacities for local bins.
bin_edgesOptional explicit edges for variable binning.
axis_spansOptional axis ranges that override mask bounds.
Returns
A grid initialized with the requested shape and axis settings.

◆ new_grid() [2/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
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 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.

Parameters
grid_boundsMask supplying the grid extent.
n_binsNumber of bins on each axis.
bin_capacitiesOptional capacities for local bins.
bin_edgesOptional explicit edges for variable binning.
axis_spansOptional axis ranges that override mask bounds.
Returns
A grid initialized with the requested shape and axis settings.

◆ new_grid() [3/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
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 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.

Parameters
grid_boundsMask supplying the grid extent.
n_binsNumber of bins on each axis.
bin_capacitiesOptional capacities for local bins.
bin_edgesOptional explicit edges for variable binning.
axis_spansOptional axis ranges that override mask bounds.
Returns
A grid initialized with the requested shape and axis settings.

◆ new_grid() [4/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
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 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.

Parameters
grid_boundsMask supplying the grid extent.
n_binsNumber of bins on each axis.
bin_capacitiesOptional capacities for local bins.
bin_edgesOptional explicit edges for variable binning.
axis_spansOptional axis ranges that override mask bounds.
Returns
A grid initialized with the requested shape and axis settings.

◆ new_grid() [5/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
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 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.

Parameters
grid_boundsMask supplying the grid extent.
n_binsNumber of bins on each axis.
bin_capacitiesOptional capacities for local bins.
bin_edgesOptional explicit edges for variable binning.
axis_spansOptional axis ranges that override mask bounds.
Returns
A grid initialized with the requested shape and axis settings.

◆ new_grid() [6/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
template<typename grid_shape_t, typename... bound_ts, typename... binning_ts>
requires concepts::shape<grid_shape_t, algebra_t>
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.

Parameters
mMask defining the grid extent.
n_binsNumber of bins on each axis.
bin_capacitiesOptional capacities for local bins.
ax_bin_edgesOptional explicit edges for variable binning.
Returns
A grid initialized with the requested axis types.

◆ new_grid() [7/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
template<concepts::grid grid_t, typename grid_shape_t>
requires concepts::shape<grid_shape_t, algebra_t>
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.

Parameters
mMask defining the grid extent.
n_binsNumber of bins on each axis.
bin_capacitiesOptional capacities for local bins.
ax_bin_edgesOptional explicit edges for variable binning.
Returns
A grid with axes and binning types taken from grid_t.

◆ new_grid() [8/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
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 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.

Parameters
grid_boundsMask supplying the grid extent.
n_binsNumber of bins on each axis.
bin_capacitiesOptional capacities for local bins.
bin_edgesOptional explicit edges for variable binning.
axis_spansOptional axis ranges that override mask bounds.
Returns
A grid initialized with the requested shape and axis settings.

◆ new_grid() [9/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
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 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.

Parameters
grid_boundsMask supplying the grid extent.
n_binsNumber of bins on each axis.
bin_capacitiesOptional capacities for local bins.
bin_edgesOptional explicit edges for variable binning.
axis_spansOptional axis ranges that override mask bounds.
Returns
A grid initialized with the requested shape and axis settings.

◆ new_grid() [10/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
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 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.

Parameters
grid_boundsMask supplying the grid extent.
n_binsNumber of bins on each axis.
bin_capacitiesOptional capacities for local bins.
bin_edgesOptional explicit edges for variable binning.
axis_spansOptional axis ranges that override mask bounds.
Returns
A grid initialized with the requested shape and axis settings.

◆ new_grid() [11/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
template<concepts::coordinate_frame grid_frame_t, typename... bound_ts, typename... binning_ts>
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.

Template Parameters
grid_shape_tthe shape of the resulting grid (e.g. cylinder2D).
e_boundsthe bounds of the regular axes (open vs. closed bounds).
binningsthe binning types of the axes (regular vs. irregular)
Parameters
spansthe span of the axis values for regular axes, otherwise ignored.
n_binsthe number of bins for regular axes, otherwise ignored
bin_capacitiesOptional capacities for local bins.
ax_bin_edgesthe explicit bin edges for irregular axes (lower bin edges + the the upper edge of the last bin), otherwise ignored.
Returns
A grid with initialized axes and empty bins.

◆ new_grid() [12/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
template<typename grid_shape_t, typename... bound_ts, typename... binning_ts>
requires concepts::shape<grid_shape_t, algebra_t>
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.

Parameters
spansAxis spans used by regular axes.
n_binsBin counts used by regular axes.
bin_capacitiesOptional capacities for local bins.
ax_bin_edgesExplicit edges for irregular axes.
boundsAxis-bound types for the shape.
binningsAxis-binning types.
Returns
A grid whose frame is derived from the supplied shape.

◆ new_grid() [13/13]

template<typename bin_t, template< std::size_t > class serializer_t, concepts::algebra algebra_t>
template<concepts::grid grid_t>
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.

Template Parameters
grid_tthe type of the resulting grid
Parameters
spansthe span of the axis values for regular axes, otherwise ignored.
n_binsthe number of bins for regular axes, otherwise ignored
bin_capacitiesOptional capacities for local bins.
ax_bin_edgesthe explicit bin edges for irregular axes (lower bin edges + the the upper edge of the last bin), otherwise ignored.
Returns
A grid of the requested concrete grid type with initialized axes.