|
ACTS
Experiment-independent tracking
|
class for describing a regular multi-dimensional grid More...
#include <Acts/Utilities/Grid.hpp>
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 | 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 = boost::container::small_vector<std::size_t, 3> |
| Type-erased interface to access the contents of the grid. | |
| using | AnyPointType = boost::container::small_vector<double, 3> |
| Type alias for dynamic point type (coordinates as vector of doubles). | |
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 (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 | |
| 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 (AnyIndexType indices) const override |
| Get the value of a bin for a given set of indices. | |
| std::any | atLocalBinsAny (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 | |
| boost::container::small_vector< const IAxis *, 3 > | axes () const override |
| get the axes as an array of IAxis pointers | |
| const std::tuple< Axes... > & | axesTuple () const |
| get the axes as a tuple | |
| 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 | |
| AnyPointType | binCenterAny (AnyIndexType indices) const override |
| Get the center of a bin for a given set of indices. | |
| point_t | binWidth () const |
| get bin width along each specific axis | |
| template<class Point> | |
| detail::GlobalNeighborHoodIndices< DIM > | closestPointsIndices (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> requires (Concepts::interpolatable<T, Point, std::array<double, DIM>, std::array<double, DIM>>) | |
| T | 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 | |
| AnyPointType | lowerLeftBinEdgeAny (AnyIndexType indices) const override |
| Get the lower left edge of a bin for a given set of 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 | |
| detail::GlobalNeighborHoodIndices< DIM > | neighborHoodIndices (const index_t &localBins, std::array< std::pair< int, int >, DIM > &sizePerAxis) const |
| get global bin indices for neighborhood | |
| detail::GlobalNeighborHoodIndices< DIM > | neighborHoodIndices (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 | |
| AnyIndexType | numLocalBinsAny () const override |
| Get the number of local bins for a given set of indices. | |
| 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 | |
| AnyPointType | upperRightBinEdgeAny (AnyIndexType indices) const override |
| Get the upper right edge of a bin for a given set of indices. | |
| const std::type_info & | valueType () const override |
| Get the type of the values stored in the grid. | |
| Public Member Functions inherited from Acts::IGrid | |
| virtual | ~IGrid ()=default |
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 |
class for describing a regular multi-dimensional grid
| T | type of values stored inside the bins of the grid |
| Axes | parameter 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.
T must be default-constructible. T must not be bool, because std::vector<bool> is special and does not return references to its elements. | using Acts::Grid< T, Axes >::const_reference = const value_type& |
constant reference type to values stored
| using Acts::Grid< T, Axes >::global_iterator_t = GridGlobalIterator<T, Axes...> |
global iterator type
| using Acts::Grid< T, Axes >::index_t = std::array<std::size_t, DIM> |
index type using local bin indices along each axis
| using Acts::Grid< T, Axes >::local_iterator_t = GridLocalIterator<T, Axes...> |
local iterator type
| using Acts::Grid< T, Axes >::point_t = std::array<double, DIM> |
type for points in d-dimensional grid space
| using Acts::Grid< T, Axes >::reference = value_type& |
reference type to values stored
| using Acts::Grid< T, Axes >::value_type = T |
type of values stored
|
explicit |
Constructor from const axis tuple, this will allow creating a grid with a different value type from a template grid object.
| axes |
|
explicit |
Move constructor from axis tuple.
| axes |
|
explicit |
constructor from parameters pack of axes
| axes |
|
explicit |
constructor from parameters pack of axes
| axes |
|
explicit |
constructor from parameters pack of axes and type tag
| axes |
|
explicit |
constructor from parameters pack of axes and type tag
| axes |
| reference Acts::Grid< T, Axes >::at | ( | std::size_t | bin | ) |
access value stored in bin with given global bin number
| [in] | bin | global bin number |
| const_reference Acts::Grid< T, Axes >::at | ( | std::size_t | bin | ) | const |
access value stored in bin with given global bin number
| [in] | bin | global bin number |
| reference Acts::Grid< T, Axes >::atLocalBins | ( | const index_t & | localBins | ) |
access value stored in bin with given local bin numbers
| [in] | localBins | local bin indices along each axis |
| const_reference Acts::Grid< T, Axes >::atLocalBins | ( | const index_t & | localBins | ) | const |
access value stored in bin with given local bin numbers
| [in] | localBins | local bin indices along each axis |
|
overridevirtual |
Get the value of a bin for a given set of indices.
| indices | The indices to get the value of the bin for |
std::any contains a const pointer to the value Implements Acts::IGrid.
|
overridevirtual |
Get the value of a bin for a given set of indices.
| indices | The indices to get the value of the bin for |
std::any contains a const pointer to the value Implements Acts::IGrid.
| reference Acts::Grid< T, Axes >::atPosition | ( | const Point & | point | ) |
access value stored in bin for a given point
| Point | any type with point semantics supporting component access through operator[] |
| [in] | point | point used to look up the corresponding bin in the grid |
Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid.| const_reference Acts::Grid< T, Axes >::atPosition | ( | const Point & | point | ) | const |
access value stored in bin for a given point
| Point | any type with point semantics supporting component access through operator[] |
| [in] | point | point used to look up the corresponding bin in the grid |
Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid.
|
overridevirtual |
get the axes as an array of IAxis pointers
Implements Acts::IGrid.
| const std::tuple< Axes... > & Acts::Grid< T, Axes >::axesTuple | ( | ) | const |
get the axes as a tuple
| global_iterator_t Acts::Grid< T, Axes >::begin | ( | ) | const |
begin iterator for global bins
| local_iterator_t Acts::Grid< T, Axes >::begin | ( | const std::array< std::vector< std::size_t >, DIM > & | navigator | ) | const |
begin iterator for local bins
| navigator | is local navigator for the grid |
| point_t Acts::Grid< T, Axes >::binCenter | ( | const index_t & | localBins | ) | const |
get center position of bin with given local bin numbers
| [in] | localBins | local bin indices along each axis |
|
overridevirtual |
Get the center of a bin for a given set of indices.
| indices | The indices to get the center of the bin for |
Implements Acts::IGrid.
| point_t Acts::Grid< T, Axes >::binWidth | ( | ) | const |
get bin width along each specific axis
| detail::GlobalNeighborHoodIndices< DIM > Acts::Grid< T, Axes >::closestPointsIndices | ( | const Point & | position | ) | const |
get global bin indices for closest points on grid
| Point | any type with point semantics supporting component access through operator[] |
| [in] | position | point of interest |
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). | 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.
| converter_t | the 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.
| cVisitor | the converter object as visitor |
| Grid< U, Axes... > Acts::Grid< T, Axes >::convertType | ( | ) | const |
Convenience function to convert the type of the grid to hold another object type.
| U | the new grid value type |
|
overridevirtual |
| global_iterator_t Acts::Grid< T, Axes >::end | ( | ) | const |
end iterator for global bins
| local_iterator_t Acts::Grid< T, Axes >::end | ( | const std::array< std::vector< std::size_t >, DIM > & | navigator | ) | const |
end iterator for local bins
| navigator | is local navigator for the grid |
| 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
| Point | any type with point semantics supporting component access through operator[] |
| [in] | point | point to look up in the grid |
Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid. | std::size_t Acts::Grid< T, Axes >::globalBinFromLocalBins | ( | const index_t & | localBins | ) | const |
determine global bin index from local bin indices along each axis
| [in] | localBins | local bin indices along each axis |
| std::size_t Acts::Grid< T, Axes >::globalBinFromPosition | ( | const Point & | point | ) | const |
determine global index for bin containing the given point
| Point | any type with point semantics supporting component access through operator[] |
| [in] | point | point to look up in the grid |
Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid. | T Acts::Grid< T, Axes >::interpolate | ( | const Point & | point | ) | const |
interpolate grid values to given position
| Point | type specifying geometric positions |
| U | dummy template parameter identical to T |
| [in] | point | location 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. |
Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid.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 + bT.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. | bool Acts::Grid< T, Axes >::isInside | ( | const Point & | position | ) | const |
check whether given point is inside grid limits
| position | Point to check for inclusion within grid boundaries |
true if \(\text{xmin_i} \le x_i < \text{xmax}_i \forall i=0,
\dots, d-1\), otherwise false Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid.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. | index_t Acts::Grid< T, Axes >::localBinsFromGlobalBin | ( | std::size_t | bin | ) | const |
determine local bin index for each axis from global bin index
| [in] | bin | global bin index |
axes object)| 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
| Point | any type with point semantics supporting component access through operator[] |
| [in] | point | point to look up in the grid |
axes object)Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid. | index_t Acts::Grid< T, Axes >::localBinsFromPosition | ( | const Point & | point | ) | const |
determine local bin index for each axis from the given point
| Point | any type with point semantics supporting component access through operator[] |
| [in] | point | point to look up in the grid |
axes object)Point type must represent a point in d (or higher) dimensions where d is dimensionality of the grid. | point_t Acts::Grid< T, Axes >::lowerLeftBinEdge | ( | const index_t & | localBins | ) | const |
retrieve lower-left bin edge from set of local bin indices
| [in] | localBins | local bin indices along each axis |
localBins must only contain valid bin indices (excluding underflow bins).
|
overridevirtual |
Get the lower left edge of a bin for a given set of indices.
| indices | The indices to get the lower left edge of the bin for |
Implements Acts::IGrid.
| point_t Acts::Grid< T, Axes >::maxPosition | ( | ) | const |
get the maximum value of all axes of one grid
| point_t Acts::Grid< T, Axes >::minPosition | ( | ) | const |
get the minimum value of all axes of one grid
| detail::GlobalNeighborHoodIndices< 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
| [in] | localBins | center bin defined by local bin indices along each axis. If size is negative, center bin is not returned. |
| [in] | sizePerAxis | size of neighborhood for each axis, how many adjacent bins along each axis are considered |
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. | detail::GlobalNeighborHoodIndices< DIM > Acts::Grid< T, Axes >::neighborHoodIndices | ( | const index_t & | localBins, |
| std::size_t | size = 1u ) const |
get global bin indices for neighborhood
| [in] | localBins | center bin defined by local bin indices along each axis |
| [in] | size | size of neighborhood determining how many adjacent bins along each axis are considered |
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. | index_t Acts::Grid< T, Axes >::numLocalBins | ( | ) | const |
get number of bins along each specific axis
|
overridevirtual |
Get the number of local bins for a given set of indices.
Implements Acts::IGrid.
| void Acts::Grid< T, Axes >::setExteriorBins | ( | const value_type & | value | ) |
set all overflow and underflow bins to a certain value
| [in] | value | value to be inserted in every overflow and underflow bin of the grid. |
| std::size_t Acts::Grid< T, Axes >::size | ( | bool | fullCounter = true | ) | const |
total number of bins
| fullCounter | Whether to include under-and overflow bins in the count |
|
overrideprotectedvirtual |
| os | Output stream to write grid representation to |
Implements Acts::IGrid.
| point_t Acts::Grid< T, Axes >::upperRightBinEdge | ( | const index_t & | localBins | ) | const |
retrieve upper-right bin edge from set of local bin indices
| [in] | localBins | local bin indices along each axis |
localBins must only contain valid bin indices (excluding overflow bins).
|
overridevirtual |
Get the upper right edge of a bin for a given set of indices.
| indices | The indices to get the upper right edge of the bin for |
Implements Acts::IGrid.
|
overridevirtual |
Get the type of the values stored in the grid.
Implements Acts::IGrid.
|
staticconstexpr |
number of dimensions of the grid