ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::Grid< T, Axes > Class Template Referencefinal

class for describing a regular multi-dimensional grid More...

#include <Acts/Utilities/Grid.hpp>

Inheritance diagram for Acts::Grid< T, Axes >:
[legend]
Collaboration diagram for Acts::Grid< T, Axes >:
[legend]

Public Types

using const_reference = const value_type&
 constant reference type to values stored
using global_iterator_t = GridGlobalIterator<T, Axes...>
 global iterator type
using index_t = std::array<std::size_t, DIM>
 index type using local bin indices along each axis
using local_iterator_t = GridLocalIterator<T, Axes...>
 local iterator type
using multi_axis_t = MultiAxis<Axes...>
 multi axis type
using point_t = std::array<double, DIM>
 type for points in d-dimensional grid space
using reference = value_type&
 reference type to values stored
using value_type = T
 type of values stored
using AnyIndexType = IMultiAxis::AnyLocalBins
 Type alias for dynamic index type (indices as vector of std::size_t).
using AnyPointType = IMultiAxis::AnyPoint
 Type alias for dynamic point type (coordinates as vector of doubles).
using AnyAxesVector = IMultiAxis::AnyAxesVector
 Dynamically sized vector of (non-owning) pointers to the contained axes.

Public Member Functions

 Grid (Axes &&... axes)
 constructor from parameters pack of axes
 Grid (const Axes &... axes)
 constructor from parameters pack of axes
 Grid (const std::tuple< Axes... > &axes)
 Constructor from const axis tuple, this will allow creating a grid with a different value type from a template grid object.
 Grid (multi_axis_t axes)
 Move constructor from axis tuple.
 Grid (std::tuple< Axes... > &&axes)
 Move constructor from axis tuple.
 Grid (TypeTag< T >, Axes &&... axes)
 constructor from parameters pack of axes and type tag
 Grid (TypeTag< T >, const Axes &... axes)
 constructor from parameters pack of axes and type tag
 Grid (TypeTag< T >, multi_axis_t axes)
 constructor from parameters pack of axes and type tag
reference at (std::size_t bin)
 access value stored in bin with given global bin number
const_reference at (std::size_t bin) const
 access value stored in bin with given global bin number
reference atLocalBins (const index_t &localBins)
 access value stored in bin with given local bin numbers
const_reference atLocalBins (const index_t &localBins) const
 access value stored in bin with given local bin numbers
std::any atLocalBinsAny (const AnyIndexType &indices) const override
 Get the value of a bin for a given set of indices.
std::any atLocalBinsAny (const AnyIndexType &indices) override
 Get the value of a bin for a given set of indices.
template<class Point>
reference atPosition (const Point &point)
 access value stored in bin for a given point
template<class Point>
const_reference atPosition (const Point &point) const
 access value stored in bin for a given point
AnyAxesVector axes () const override
 get the axes as an array of IAxis pointers
const std::tuple< Axes... > & axesTuple () const
 get the axes as a tuple
const IAxisaxis (std::size_t index) const override
 Get the axis object for a given index.
global_iterator_t begin () const
 begin iterator for global bins
local_iterator_t begin (const std::array< std::vector< std::size_t >, DIM > &navigator) const
 begin iterator for local bins
point_t binCenter (const index_t &localBins) const
 get center position of bin with given local bin numbers
point_t binWidth () const
 get bin width along each specific axis
template<class Point>
detail::FlatNeighborHoodIndices< DIMclosestPointsIndices (const Point &position) const
 get global bin indices for closest points on grid
template<typename converter_t>
Grid< typename converter_t::value_type, Axes... > convertGrid (converter_t &cVisitor) const
 Convenience function to convert the type of the grid to hold another object type.
template<typename U>
Grid< U, Axes... > convertType () const
 Convenience function to convert the type of the grid to hold another object type.
std::size_t dimensions () const override
 dimensionality of grid
global_iterator_t end () const
 end iterator for global bins
local_iterator_t end (const std::array< std::vector< std::size_t >, DIM > &navigator) const
 end iterator for local bins
template<class Point>
std::size_t globalBinFromFromLowerLeftEdge (const Point &point) const
 determine global bin index of the bin with the lower left edge closest to the given point for each axis
std::size_t globalBinFromLocalBins (const index_t &localBins) const
 determine global bin index from local bin indices along each axis
template<class Point>
std::size_t globalBinFromPosition (const Point &point) const
 determine global index for bin containing the given point
template<class Point>
interpolate (const Point &point) const
 interpolate grid values to given position
template<class Point>
bool isInside (const Point &position) const
 check whether given point is inside grid limits
index_t localBinsFromGlobalBin (std::size_t bin) const
 determine local bin index for each axis from global bin index
template<class Point>
index_t localBinsFromLowerLeftEdge (const Point &point) const
 determine local bin index of the bin with the lower left edge closest to the given point for each axis
template<class Point>
index_t localBinsFromPosition (const Point &point) const
 determine local bin index for each axis from the given point
point_t lowerLeftBinEdge (const index_t &localBins) const
 retrieve lower-left bin edge from set of local bin indices
point_t maxPosition () const
 get the maximum value of all axes of one grid
point_t minPosition () const
 get the minimum value of all axes of one grid
const multi_axis_tmultiAxis () const
 Get the multi-axis object for the grid.
const IMultiAxismultiAxisAny () const override
 Get the multi-axis object for the grid.
detail::FlatNeighborHoodIndices< DIMneighborHoodIndices (const index_t &localBins, std::array< std::pair< int, int >, DIM > &sizePerAxis) const
 get global bin indices for neighborhood
detail::FlatNeighborHoodIndices< DIMneighborHoodIndices (const index_t &localBins, std::size_t size=1u) const
 get global bin indices for neighborhood
index_t numLocalBins () const
 get number of bins along each specific axis
void setExteriorBins (const value_type &value)
 set all overflow and underflow bins to a certain value
std::size_t size (bool fullCounter=true) const
 total number of bins
point_t upperRightBinEdge (const index_t &localBins) const
 retrieve upper-right bin edge from set of local bin indices
const std::type_info & valueType () const override
 Type-erased interface to access the contents of the grid.
virtual AnyPointType lowerLeftBinEdgeAny (const AnyIndexType &indices) const
 Get the lower left edge of a bin for a given set of indices.
virtual AnyPointType upperRightBinEdgeAny (const AnyIndexType &indices) const
 Get the upper right edge of a bin for a given set of indices.
virtual AnyPointType binCenterAny (const AnyIndexType &indices) const
 Get the center of a bin for a given set of indices.
virtual AnyIndexType numLocalBinsAny () const
 Get the number of local bins for a given set of indices.

Static Public Attributes

static constexpr std::size_t DIM = sizeof...(Axes)
 number of dimensions of the grid

Protected Member Functions

void toStream (std::ostream &os) const override

Detailed Description

template<typename T, class... Axes>
requires (std::is_default_constructible_v<T> && !std::is_same_v<T, bool>)
class Acts::Grid< T, Axes >

class for describing a regular multi-dimensional grid

Template Parameters
Ttype of values stored inside the bins of the grid
Axesparameter pack of axis types defining the grid

Class describing a multi-dimensional, regular grid which can store objects in its multi-dimensional bins. Bins are hyper-boxes and can be accessed either by global bin index, local bin indices or position.

Note
T must be default-constructible.
T must not be bool, because std::vector<bool> is special and does not return references to its elements.

Constructor & Destructor Documentation

◆ Grid() [1/8]

template<typename T, class... Axes>
Acts::Grid< T, Axes >::Grid ( const std::tuple< Axes... > & axes)
explicit

Constructor from const axis tuple, this will allow creating a grid with a different value type from a template grid object.

Parameters
axes

◆ Grid() [2/8]

template<typename T, class... Axes>
Acts::Grid< T, Axes >::Grid ( std::tuple< Axes... > && axes)
explicit

Move constructor from axis tuple.

Parameters
axes

◆ Grid() [3/8]

template<typename T, class... Axes>
Acts::Grid< T, Axes >::Grid ( Axes &&... axes)
explicit

constructor from parameters pack of axes

Parameters
axes

◆ Grid() [4/8]

template<typename T, class... Axes>
Acts::Grid< T, Axes >::Grid ( const Axes &... axes)
explicit

constructor from parameters pack of axes

Parameters
axes

◆ Grid() [5/8]

template<typename T, class... Axes>
Acts::Grid< T, Axes >::Grid ( TypeTag< T > ,
Axes &&... axes )
explicit

constructor from parameters pack of axes and type tag

Parameters
axes

◆ Grid() [6/8]

template<typename T, class... Axes>
Acts::Grid< T, Axes >::Grid ( TypeTag< T > ,
const Axes &... axes )
explicit

constructor from parameters pack of axes and type tag

Parameters
axes

◆ Grid() [7/8]

template<typename T, class... Axes>
Acts::Grid< T, Axes >::Grid ( multi_axis_t axes)
explicit

Move constructor from axis tuple.

Parameters
axes

◆ Grid() [8/8]

template<typename T, class... Axes>
Acts::Grid< T, Axes >::Grid ( TypeTag< T > ,
multi_axis_t axes )
explicit

constructor from parameters pack of axes and type tag

Parameters
axes

Member Function Documentation

◆ at() [1/2]

template<typename T, class... Axes>
reference Acts::Grid< T, Axes >::at ( std::size_t bin)

access value stored in bin with given global bin number

Parameters
binglobal bin number
Returns
reference to value stored in bin containing the given point

◆ at() [2/2]

template<typename T, class... Axes>
const_reference Acts::Grid< T, Axes >::at ( std::size_t bin) const

access value stored in bin with given global bin number

Parameters
binglobal bin number
Returns
const-reference to value stored in bin containing the given point

◆ atLocalBins() [1/2]

template<typename T, class... Axes>
reference Acts::Grid< T, Axes >::atLocalBins ( const index_t & localBins)

access value stored in bin with given local bin numbers

Parameters
localBinslocal bin indices along each axis
Returns
reference to value stored in bin containing the given point
Precondition
All local bin indices must be a valid index for the corresponding axis (including the under-/overflow bin for this axis).

◆ atLocalBins() [2/2]

template<typename T, class... Axes>
const_reference Acts::Grid< T, Axes >::atLocalBins ( const index_t & localBins) const

access value stored in bin with given local bin numbers

Parameters
localBinslocal bin indices along each axis
Returns
const-reference to value stored in bin containing the given point
Precondition
All local bin indices must be a valid index for the corresponding axis (including the under-/overflow bin for this axis).

◆ atLocalBinsAny() [1/2]

template<typename T, class... Axes>
std::any Acts::Grid< T, Axes >::atLocalBinsAny ( const AnyIndexType & indices) const
overridevirtual

Get the value of a bin for a given set of indices.

Parameters
indicesThe indices to get the value of the bin for
Returns
The value of the bin: the std::any contains a const pointer to the value

Implements Acts::IGrid.

◆ atLocalBinsAny() [2/2]

template<typename T, class... Axes>
std::any Acts::Grid< T, Axes >::atLocalBinsAny ( const AnyIndexType & indices)
overridevirtual

Get the value of a bin for a given set of indices.

Parameters
indicesThe indices to get the value of the bin for
Returns
The value of the bin: the std::any contains a const pointer to the value

Implements Acts::IGrid.

◆ atPosition() [1/2]

template<typename T, class... Axes>
template<class Point>
reference Acts::Grid< T, Axes >::atPosition ( const Point & point)

access value stored in bin for a given point

Template Parameters
Pointany type with point semantics supporting component access through operator[]
Parameters
pointpoint used to look up the corresponding bin in the grid
Returns
reference to value stored in bin containing the given point
Precondition
The given Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid.
Note
The look-up considers under-/overflow bins along each axis. Therefore, the look-up will never fail.

◆ atPosition() [2/2]

template<typename T, class... Axes>
template<class Point>
const_reference Acts::Grid< T, Axes >::atPosition ( const Point & point) const

access value stored in bin for a given point

Template Parameters
Pointany type with point semantics supporting component access through operator[]
Parameters
pointpoint used to look up the corresponding bin in the grid
Returns
const-reference to value stored in bin containing the given point
Precondition
The given Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid.
Note
The look-up considers under-/overflow bins along each axis. Therefore, the look-up will never fail.

◆ axes()

template<typename T, class... Axes>
AnyAxesVector Acts::Grid< T, Axes >::axes ( ) const
overridevirtual

get the axes as an array of IAxis pointers

Returns
Vector containing pointers to all grid axes

Reimplemented from Acts::IGrid.

◆ axesTuple()

template<typename T, class... Axes>
const std::tuple< Axes... > & Acts::Grid< T, Axes >::axesTuple ( ) const

get the axes as a tuple

Returns
Reference to the tuple containing all grid axes
Deprecated
Use grid.multiAxis().getAxesTuple() instead

◆ axis()

template<typename T, class... Axes>
const IAxis & Acts::Grid< T, Axes >::axis ( std::size_t index) const
overridevirtual

Get the axis object for a given index.

Parameters
indexThe index of the axis to get
Returns
The axis object for the given index

Reimplemented from Acts::IGrid.

◆ begin() [1/2]

template<typename T, class... Axes>
global_iterator_t Acts::Grid< T, Axes >::begin ( ) const

begin iterator for global bins

Returns
Iterator pointing to the first global bin

◆ begin() [2/2]

template<typename T, class... Axes>
local_iterator_t Acts::Grid< T, Axes >::begin ( const std::array< std::vector< std::size_t >, DIM > & navigator) const

begin iterator for local bins

Parameters
navigatoris local navigator for the grid
Returns
Iterator pointing to the first local bin

◆ binCenter()

template<typename T, class... Axes>
point_t Acts::Grid< T, Axes >::binCenter ( const index_t & localBins) const

get center position of bin with given local bin numbers

Parameters
localBinslocal bin indices along each axis
Returns
center position of bin
Precondition
All local bin indices must be a valid index for the corresponding axis (excluding the under-/overflow bins for each axis).
Deprecated
Use grid.multiAxis().getBinCenter(localBins) instead

◆ binWidth()

template<typename T, class... Axes>
point_t Acts::Grid< T, Axes >::binWidth ( ) const

get bin width along each specific axis

Returns
array giving the bin width alonf all axes
Deprecated
Use grid.multiAxis().getBinWidth({}) instead

◆ closestPointsIndices()

template<typename T, class... Axes>
template<class Point>
detail::FlatNeighborHoodIndices< DIM > Acts::Grid< T, Axes >::closestPointsIndices ( const Point & position) const

get global bin indices for closest points on grid

Template Parameters
Pointany type with point semantics supporting component access through operator[]
Parameters
positionpoint of interest
Returns
Iterable thatemits the indices of bins whose lower-left corners are the closest points on the grid to the input.
Precondition
The given Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid. It must lie within the grid range (i.e. not within a under-/overflow bin).
Deprecated
Use grid.multiAxis().getClosestPointsIndices(point) instead

◆ convertGrid()

template<typename T, class... Axes>
template<typename converter_t>
Grid< typename converter_t::value_type, Axes... > Acts::Grid< T, Axes >::convertGrid ( converter_t & cVisitor) const

Convenience function to convert the type of the grid to hold another object type.

Template Parameters
converter_tthe converter type

This is designed to be most flexible with a converter object as a visitor. If needed, such a visitor could also use caching or other techniques to speed up the conversion.

Parameters
cVisitorthe converter object as visitor
Returns
a new grid with the same axes and a different value type

◆ convertType()

template<typename T, class... Axes>
template<typename U>
Grid< U, Axes... > Acts::Grid< T, Axes >::convertType ( ) const

Convenience function to convert the type of the grid to hold another object type.

Template Parameters
Uthe new grid value type
Returns
a new grid with the same axes and a different value type

◆ dimensions()

template<typename T, class... Axes>
std::size_t Acts::Grid< T, Axes >::dimensions ( ) const
overridevirtual

dimensionality of grid

Returns
number of axes spanning the grid

Implements Acts::IGrid.

◆ end() [1/2]

template<typename T, class... Axes>
global_iterator_t Acts::Grid< T, Axes >::end ( ) const

end iterator for global bins

Returns
Iterator pointing one past the last global bin

◆ end() [2/2]

template<typename T, class... Axes>
local_iterator_t Acts::Grid< T, Axes >::end ( const std::array< std::vector< std::size_t >, DIM > & navigator) const

end iterator for local bins

Parameters
navigatoris local navigator for the grid
Returns
Iterator pointing one past the last local bin

◆ globalBinFromFromLowerLeftEdge()

template<typename T, class... Axes>
template<class Point>
std::size_t Acts::Grid< T, Axes >::globalBinFromFromLowerLeftEdge ( const Point & point) const

determine global bin index of the bin with the lower left edge closest to the given point for each axis

Template Parameters
Pointany type with point semantics supporting component access through operator[]
Parameters
pointpoint to look up in the grid
Returns
global index for bin containing the given point
Precondition
The given Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid.
Note
This could be a under-/overflow bin along one or more axes.
Deprecated
Use grid.multiAxis().getGlobalBinFromLowerLeftEdge(point) instead

◆ globalBinFromLocalBins()

template<typename T, class... Axes>
std::size_t Acts::Grid< T, Axes >::globalBinFromLocalBins ( const index_t & localBins) const

determine global bin index from local bin indices along each axis

Parameters
localBinslocal bin indices along each axis
Returns
global index for bin defined by the local bin indices
Precondition
All local bin indices must be a valid index for the corresponding axis (including the under-/overflow bin for this axis).
Deprecated
Use grid.multiAxis().getGlobalBinFromLocalBins(localBins) instead

◆ globalBinFromPosition()

template<typename T, class... Axes>
template<class Point>
std::size_t Acts::Grid< T, Axes >::globalBinFromPosition ( const Point & point) const

determine global index for bin containing the given point

Template Parameters
Pointany type with point semantics supporting component access through operator[]
Parameters
pointpoint to look up in the grid
Returns
global index for bin containing the given point
Precondition
The given Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid.
Note
This could be a under-/overflow bin along one or more axes.
Deprecated
Use grid.multiAxis().getGlobalBinFromPoint(point) instead

◆ interpolate()

template<typename T, class... Axes>
template<class Point>
T Acts::Grid< T, Axes >::interpolate ( const Point & point) const

interpolate grid values to given position

Template Parameters
Pointtype specifying geometric positions
Udummy template parameter identical to T
Parameters
pointlocation to which to interpolate grid values. The position must be within the grid dimensions and not lie in an under-/overflow bin along any axis.
Returns
interpolated value at given position
Precondition
The given Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid.
Note
This function is available only if the following conditions are fulfilled:
  • Given U and V of value type T as well as two double a and b, then the following must be a valid expression a * U + b
  • V yielding an object which is (implicitly) convertible to T.
  • Point must represent a d-dimensional position and support coordinate access using operator[] which should return a double (or a value which is implicitly convertible). Coordinate indices must start at 0.
Bin values are interpreted as being the field values at the lower-left corner of the corresponding hyper-box.

◆ isInside()

template<typename T, class... Axes>
template<class Point>
bool Acts::Grid< T, Axes >::isInside ( const Point & position) const

check whether given point is inside grid limits

Parameters
positionPoint to check for inclusion within grid boundaries
Returns
true if \(\text{xmin_i} \le x_i < \text{xmax}_i \forall i=0, \dots, d-1\), otherwise false
Precondition
The given Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid.
Postcondition
If true is returned, the global bin containing the given point is a valid bin, i.e. it is neither a underflow nor an overflow bin along any axis.
Deprecated
Use grid.multiAxis().isInside(position) instead

◆ localBinsFromGlobalBin()

template<typename T, class... Axes>
index_t Acts::Grid< T, Axes >::localBinsFromGlobalBin ( std::size_t bin) const

determine local bin index for each axis from global bin index

Parameters
binglobal bin index
Returns
array with local bin indices along each axis (in same order as given axes object)
Note
Local bin indices can contain under-/overflow bins along the corresponding axis.
Deprecated
Use grid.multiAxis().getLocalBinsFromGlobalBin(bin) instead

◆ localBinsFromLowerLeftEdge()

template<typename T, class... Axes>
template<class Point>
index_t Acts::Grid< T, Axes >::localBinsFromLowerLeftEdge ( const Point & point) const

determine local bin index of the bin with the lower left edge closest to the given point for each axis

Template Parameters
Pointany type with point semantics supporting component access through operator[]
Parameters
pointpoint to look up in the grid
Returns
array with local bin indices along each axis (in same order as given axes object)
Precondition
The given Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid.
Note
This could be a under-/overflow bin along one or more axes.
Deprecated
Use grid.multiAxis().getLocalBinsFromLowerLeftEdge(point) instead

◆ localBinsFromPosition()

template<typename T, class... Axes>
template<class Point>
index_t Acts::Grid< T, Axes >::localBinsFromPosition ( const Point & point) const

determine local bin index for each axis from the given point

Template Parameters
Pointany type with point semantics supporting component access through operator[]
Parameters
pointpoint to look up in the grid
Returns
array with local bin indices along each axis (in same order as given axes object)
Precondition
The given Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid.
Note
This could be a under-/overflow bin along one or more axes.
Deprecated
Use grid.multiAxis().getLocalBinsFromPoint(point) instead

◆ lowerLeftBinEdge()

template<typename T, class... Axes>
point_t Acts::Grid< T, Axes >::lowerLeftBinEdge ( const index_t & localBins) const

retrieve lower-left bin edge from set of local bin indices

Parameters
localBinslocal bin indices along each axis
Returns
generalized lower-left bin edge position
Precondition
localBins must only contain valid bin indices (excluding underflow bins).
Deprecated
Use grid.multiAxis().getLowerLeftBinEdge(localBins) instead

◆ maxPosition()

template<typename T, class... Axes>
point_t Acts::Grid< T, Axes >::maxPosition ( ) const

get the maximum value of all axes of one grid

Returns
array returning the maxima of all given axes
Deprecated
Use grid.multiAxis().getMaxPoint() instead

◆ minPosition()

template<typename T, class... Axes>
point_t Acts::Grid< T, Axes >::minPosition ( ) const

get the minimum value of all axes of one grid

Returns
array returning the minima of all given axes
Deprecated
Use grid.multiAxis().getMinPoint() instead

◆ multiAxis()

template<typename T, class... Axes>
const multi_axis_t & Acts::Grid< T, Axes >::multiAxis ( ) const

Get the multi-axis object for the grid.

Returns
The multi-axis object for the grid

◆ multiAxisAny()

template<typename T, class... Axes>
const IMultiAxis & Acts::Grid< T, Axes >::multiAxisAny ( ) const
overridevirtual

Get the multi-axis object for the grid.

Returns
The multi-axis object for the grid

Implements Acts::IGrid.

◆ neighborHoodIndices() [1/2]

template<typename T, class... Axes>
detail::FlatNeighborHoodIndices< DIM > Acts::Grid< T, Axes >::neighborHoodIndices ( const index_t & localBins,
std::array< std::pair< int, int >, DIM > & sizePerAxis ) const

get global bin indices for neighborhood

Parameters
localBinscenter bin defined by local bin indices along each axis. If size is negative, center bin is not returned.
sizePerAxissize of neighborhood for each axis, how many adjacent bins along each axis are considered
Returns
set of global bin indices for all bins in neighborhood
Note
Over-/underflow bins are included in the neighborhood.
The size parameter sets the range by how many units each local bin index is allowed to be varied. All local bin indices are varied independently, that is diagonal neighbors are included. Ignoring the truncation of the neighborhood size reaching beyond over-/underflow bins, the neighborhood is of size \(2 \times \text{size}+1\) along each dimension.
Deprecated
Use grid.multiAxis().getNeighborHoodIndices(localBins, sizePerAxis) instead

◆ neighborHoodIndices() [2/2]

template<typename T, class... Axes>
detail::FlatNeighborHoodIndices< DIM > Acts::Grid< T, Axes >::neighborHoodIndices ( const index_t & localBins,
std::size_t size = 1u ) const

get global bin indices for neighborhood

Parameters
localBinscenter bin defined by local bin indices along each axis
sizesize of neighborhood determining how many adjacent bins along each axis are considered
Returns
set of global bin indices for all bins in neighborhood
Note
Over-/underflow bins are included in the neighborhood.
The size parameter sets the range by how many units each local bin index is allowed to be varied. All local bin indices are varied independently, that is diagonal neighbors are included. Ignoring the truncation of the neighborhood size reaching beyond over-/underflow bins, the neighborhood is of size \(2 \times \text{size}+1\) along each dimension.
Deprecated
Use grid.multiAxis().getNeighborHoodIndices(localBins, size) instead

◆ numLocalBins()

template<typename T, class... Axes>
index_t Acts::Grid< T, Axes >::numLocalBins ( ) const

get number of bins along each specific axis

Returns
array giving the number of bins along all axes
Note
Not including under- and overflow bins
Deprecated
Use grid.multiAxis().getNBins() instead

◆ setExteriorBins()

template<typename T, class... Axes>
void Acts::Grid< T, Axes >::setExteriorBins ( const value_type & value)

set all overflow and underflow bins to a certain value

Parameters
valuevalue to be inserted in every overflow and underflow bin of the grid.

◆ size()

template<typename T, class... Axes>
std::size_t Acts::Grid< T, Axes >::size ( bool fullCounter = true) const

total number of bins

Parameters
fullCounterWhether to include under-and overflow bins in the count
Returns
total number of bins in the grid
Note
This number contains under-and overflow bins along all axes.

◆ toStream()

template<typename T, class... Axes>
void Acts::Grid< T, Axes >::toStream ( std::ostream & os) const
overrideprotectedvirtual
Parameters
osOutput stream to write grid representation to

Implements Acts::IGrid.

◆ upperRightBinEdge()

template<typename T, class... Axes>
point_t Acts::Grid< T, Axes >::upperRightBinEdge ( const index_t & localBins) const

retrieve upper-right bin edge from set of local bin indices

Parameters
localBinslocal bin indices along each axis
Returns
generalized upper-right bin edge position
Precondition
localBins must only contain valid bin indices (excluding overflow bins).
Deprecated
Use grid.multiAxis().getUpperRightBinEdge(localBins) instead

◆ valueType()

template<typename T, class... Axes>
const std::type_info & Acts::Grid< T, Axes >::valueType ( ) const
overridevirtual

Type-erased interface to access the contents of the grid.

Note
This interface has non-negligible runtime overhead due to packing and unpacking from/to std::any and the dynamically sized index and point types. USE WITH CARE! Get the type of the values stored in the grid
Returns
The type of the values stored in the grid

Implements Acts::IGrid.