ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::axis::multi_axis< ownership, local_frame_t, axis_ts > Class Template Reference

An N-dimensional collection of single axes. More...

#include <detray/utils/grid/axis.hpp>

Inheritance diagram for detray::axis::multi_axis< ownership, local_frame_t, axis_ts >:
[legend]

Public Types

using algebra_type = typename local_frame_type::algebra_type
 Algebra backend used by the local frame.
using buffer_type
 Vecmem based buffer type.
using const_view_type
 Const VecMem view of offsets and edges.
using local_frame_type = local_frame_t
 Projection onto local coordinate system that is spanned by the axes.
using point_type = typename local_frame_type::loc_point
 Point type in the local coordinate system.
using scalar_type = typename detray::detail::first_t<axis_ts...>::scalar_type
 Scalar type used for all constituent axes.
template<bool owning>
using type = multi_axis<owning, local_frame_t, axis_ts...>
 Find the corresponding (non-)owning type.
using view_type
 Vecmem based view type.
using binnings = types::list<typename axis_ts::binning_type...>
 binnings and axis bounds
using bounds = types::list<typename axis_ts::bounds_type...>
 Bounds policies of the constituent axes.
using loc_bin_index = axis::multi_bin<dim>
 Per-axis bin indices for a bin in this multi-axis.
using container_types
 Extract container types.
template<typename T>
using vector_type = typename container_types::template vector_type<T>
 Vector container type used by the axis storage.
using edge_offset_container_type = vector_type<dsized_index_range>
 Axes boundary/bin edges storage.
using edges_container_type = vector_type<scalar_type>
 Container type holding concatenated bin edges.

Public Member Functions

constexpr multi_axis ()=default
 Default constructor.
template<bool owner = is_owning>
requires (!owner)
 multi_axis (const vector_type< dsized_index_range > &edge_offsets, const vector_type< scalar_type > &edges, const unsigned int offset=0)
 Construct from containers that are not owned by this class.
template<concepts::device_view view_t>
 multi_axis (const view_t &view)
 Construct containers from vecmem based view type.
template<bool owner = is_owning>
requires owner
 multi_axis (edge_offset_range_t &&edge_offsets, edge_range_t &&edges)
 Construct from containers - move.
template<bool owner = is_owning>
requires owner
 multi_axis (vecmem::memory_resource &resource)
 Construct containers using a specific memory resources.
constexpr auto bin_edge_offsets () const -> const edge_offset_range_t &
constexpr auto bin_edges () const -> const vector_type< scalar_type > &
template<typename neighbor_t>
multi_bin_range< dim > bin_ranges (const point_type &p, const darray< neighbor_t, 2 > &nhood) const
 Get a bin range on every axis corresponding to the given point and the neighborhood around it.
loc_bin_index bins (const point_type &p) const
 Query the bin index for every coordinate of the given point on the axes.
template<bool owner = is_owning>
requires owner
auto get_data () -> view_type
template<bool owner = is_owning>
requires owner
auto get_data () const -> const_view_type
constexpr auto nbins () const -> dindex
constexpr auto nbins_per_axis () const -> loc_bin_index
constexpr auto operator== (const multi_axis &rhs) const -> bool
 Equality operator.
template<std::size_t I>
types::get< axis_reg, types::id_cast< axis_reg, I > > get_axis () const
 Build an axis object in place.
template<axis::label L>
types::get< axis_reg, L > get_axis () const
template<typename axis_t>
axis_t get_axis () const

Static Public Attributes

static constexpr dindex dim = sizeof...(axis_ts)
 Dimension of the local coordinate system that is spanned by the axes.
static constexpr bool is_owning = ownership
 Whether the axis owns its edge and offset storage.

Detailed Description

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
class detray::axis::multi_axis< ownership, local_frame_t, axis_ts >

An N-dimensional collection of single axes.

Given a point in the grid local coordinate system, which is spanned by the axes in this multi-axes type, the corresponding bin multi-index or multi-index range is returned.

Note
can be owning the data (as member of a standalone grid) or can be non-owning if the grid is part of a larger collection.

Member Typedef Documentation

◆ buffer_type

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
using detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::buffer_type
Initial value:
dmulti_buffer<dvector_buffer<dsized_index_range>,
dvector_buffer<scalar_type>>

Vecmem based buffer type.

◆ const_view_type

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
using detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::const_view_type
Initial value:
dmulti_view<dvector_view<const dsized_index_range>,
dvector_view<const scalar_type>>

Const VecMem view of offsets and edges.

◆ container_types

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
using detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::container_types
Initial value:
typename detray::detail::first_t<axis_ts...>::container_types
typename detray::detail::first_t< axis_ts... >::container_types container_types
Extract container types.
Definition axis.hpp:245

Extract container types.

◆ view_type

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
using detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::view_type
Initial value:
dmulti_view<dvector_view<dsized_index_range>, dvector_view<scalar_type>>

Vecmem based view type.

Constructor & Destructor Documentation

◆ multi_axis() [1/4]

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
template<bool owner = is_owning>
requires owner
detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::multi_axis ( vecmem::memory_resource & resource)
explicit

Construct containers using a specific memory resources.

Parameters
resourceResource used for edge and offset allocations.

◆ multi_axis() [2/4]

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
template<bool owner = is_owning>
requires owner
detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::multi_axis ( edge_offset_range_t && edge_offsets,
edge_range_t && edges )

Construct from containers - move.

Parameters
edge_offsetsPer-axis ranges into the concatenated edge storage.
edgesConcatenated edge values for all axes.

◆ multi_axis() [3/4]

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
template<bool owner = is_owning>
requires (!owner)
detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::multi_axis ( const vector_type< dsized_index_range > & edge_offsets,
const vector_type< scalar_type > & edges,
const unsigned int offset = 0 )

Construct from containers that are not owned by this class.

Parameters
edge_offsetsoffsets into the global edge container
edgesthe global edge container
offsetoffset into the global edge offset container

◆ multi_axis() [4/4]

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
template<concepts::device_view view_t>
detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::multi_axis ( const view_t & view)
explicit

Construct containers from vecmem based view type.

Parameters
viewvecmem view on the axes data

Member Function Documentation

◆ bin_edge_offsets()

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
auto detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::bin_edge_offsets ( ) const->constedge_offset_range_t &
constexpr
Returns
access to the underlying bin edge offset storage - const

◆ bin_edges()

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
auto detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::bin_edges ( ) const->constvector_type< scalar_type > &
constexpr
Returns
access to the underlying bin edge storage - const

◆ bin_ranges()

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
template<typename neighbor_t>
multi_bin_range< dim > detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::bin_ranges ( const point_type & p,
const darray< neighbor_t, 2 > & nhood ) const

Get a bin range on every axis corresponding to the given point and the neighborhood around it.

The neighborhood around the point can be defined in two ways:

  • scalar: neighborhood around the axis value,
  • index: neighborhood in bins The resulting bin index range will contain all bins that belong to a given neighborhood around the lookup point.
Template Parameters
neighbor_tthe type of neighborhood defined on the axis around the point
Parameters
pthe point in the local coordinate system that is spanned by the axes.
nhoodthe search window definition.
Returns
a multi bin range that contains the resulting bin ranges for every axis in the corresponding entry (e.g. rng_x in entry 0)

◆ bins()

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
loc_bin_index detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::bins ( const point_type & p) const

Query the bin index for every coordinate of the given point on the axes.

Parameters
pthe point in the local coordinate system that is spanned by the axes.
Returns
a multi bin that contains the resulting bin indices for every axis in the corresponding entry (e.g. bin_x in entry 0)

◆ get_axis() [1/3]

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
template<typename axis_t>
axis_t detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::get_axis ( ) const
Template Parameters
axis_ttype of the axis.
Returns
an axis object of the given type.

◆ get_axis() [2/3]

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
template<axis::label L>
types::get< axis_reg, L > detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::get_axis ( ) const
Template Parameters
Llabel of the axis.
Returns
an axis object, corresponding to the label.

◆ get_axis() [3/3]

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
template<std::size_t I>
types::get< axis_reg, types::id_cast< axis_reg, I > > detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::get_axis ( ) const

Build an axis object in place.

Template Parameters
Ithe position of the axis in the parameter pack. Also determines which axes data are used to build the instance.
Returns
an axis object, corresponding to the index.

◆ get_data() [1/2]

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
template<bool owner = is_owning>
requires owner
auto detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::get_data ( ) ->view_type
Returns
a vecmem view on the axes data. Only allowed if it owns data.

◆ get_data() [2/2]

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
template<bool owner = is_owning>
requires owner
auto detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::get_data ( ) const->const_view_type
Returns
a vecmem const view on the axes data. Only allowed if it is owning data.

◆ nbins()

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
auto detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::nbins ( ) const->dindex
constexpr
Returns
the total number of bins over all axes

◆ nbins_per_axis()

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
auto detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::nbins_per_axis ( ) const->loc_bin_index
constexpr
Returns
the number of bins per axis

◆ operator==()

template<bool ownership, typename local_frame_t, concepts::axis... axis_ts>
auto detray::axis::multi_axis< ownership, local_frame_t, axis_ts >::operator== ( const multi_axis< ownership, local_frame_t, axis_ts > & rhs) const->bool
constexpr

Equality operator.

Parameters
rhsthe right-hand side of the comparison
Note
in the non-owning case, we compare the values not the pointers
Returns
whether the two axes are equal