ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
|
class for describing a regular multi-dimensional grid More...
#include <acts/blob/master/Core/include/Acts/Utilities/detail/Grid.hpp>
Public Types | |
using | value_type = T |
type of values stored | |
using | reference = value_type & |
reference type to values stored | |
using | const_reference = const value_type & |
constant reference type to values stored | |
using | point_t = std::array< double, DIM > |
type for points in d-dimensional grid space | |
using | index_t = std::array< size_t, DIM > |
index type using local bin indices along each axis | |
Public Member Functions | |
Grid (std::tuple< Axes...> axes) | |
default constructor | |
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 | |
reference | at (size_t bin) |
access value stored in bin with given global bin number | |
const_reference | at (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 | |
template<class Point > | |
detail::GlobalNeighborHoodIndices < DIM > | closestPointsIndices (const Point &position) const |
get global bin indices for closest points on grid | |
std::array< double, DIM > | binCenter (const index_t &localBins) const |
get center position of bin with given local bin numbers | |
template<class Point > | |
size_t | globalBinFromPosition (const Point &point) const |
determine global index for bin containing the given point | |
size_t | globalBinFromLocalBins (const index_t &localBins) const |
determine global bin index from local bin indices along each axis | |
template<class Point > | |
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 | |
template<class Point > | |
index_t | localBinsFromPosition (const Point &point) const |
determine local bin index for each axis from the given point | |
index_t | localBinsFromGlobalBin (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 | |
point_t | lowerLeftBinEdge (const index_t &localBins) const |
retrieve lower-left bin edge from set of local bin indices | |
point_t | upperRightBinEdge (const index_t &localBins) const |
retrieve upper-right bin edge from set of local bin indices | |
index_t | numLocalBins () const |
get number of bins along each specific axis | |
point_t | minPosition () const |
get the minimum value of all axes of one grid | |
point_t | maxPosition () const |
get the maximum value of all axes of one grid | |
void | setExteriorBins (const value_type &value) |
set all overflow and underflow bins to a certain value | |
template<class Point , typename U = T, typename = std::enable_if_t<can_interpolate< Point, std::array<double, DIM>, std::array<double, DIM>, U>::value>> | |
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 | |
detail::GlobalNeighborHoodIndices < DIM > | neighborHoodIndices (const index_t &localBins, size_t size=1u) const |
get global bin indices for neighborhood | |
size_t | size () const |
total number of bins | |
std::array< const IAxis *, DIM > | axes () const |
Static Public Member Functions | |
static constexpr size_t | dimensions () |
dimensionality of grid | |
Static Public Attributes | |
static constexpr size_t | DIM = sizeof...(Axes) |
number of dimensions of the grid | |
Private Member Functions | |
detail::GlobalNeighborHoodIndices < DIM > | rawClosestPointsIndices (const index_t &localBins) const |
Private Attributes | |
std::tuple< Axes...> | m_axes |
set of axis defining the multi-dimensional grid | |
std::vector< T > | m_values |
linear value store for each bin | |
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. Definition at line 38 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 38 of file Grid.hpp
using Acts::detail::Grid< T, Axes >::const_reference = const value_type& |
using Acts::detail::Grid< T, Axes >::index_t = std::array<size_t, DIM> |
using Acts::detail::Grid< T, Axes >::point_t = std::array<double, DIM> |
using Acts::detail::Grid< T, Axes >::reference = value_type& |
using Acts::detail::Grid< T, Axes >::value_type = T |
|
inline |
|
inline |
access value stored in bin with given global bin number
[in] | bin | global bin number |
Definition at line 104 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 104 of file Grid.hpp
Referenced by Acts::detail::Grid< external_spacepoint_t >::interpolate(), Acts::JsonGeometryConverter::jsonToVolumeMaterial(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::lookup(), Acts::mapMaterialPoints(), Acts::NeighborhoodIterator< external_spacepoint_t >::NeighborhoodIterator(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache(), Acts::detail::Grid< external_spacepoint_t >::setExteriorBins(), and Acts::JsonGeometryConverter::volumeMaterialToJson().
|
inline |
|
inline |
access value stored in bin with given local bin numbers
[in] | localBins | local bin indices along each axis |
Definition at line 121 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 121 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::mapMaterialPoints().
|
inline |
access value stored in bin with given local bin numbers
[in] | localBins | local bin indices along each axis |
Definition at line 133 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 133 of file Grid.hpp
|
inline |
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.Definition at line 76 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 76 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::lookup().
|
inline |
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.Definition at line 95 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 95 of file Grid.hpp
|
inline |
Definition at line 419 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 419 of file Grid.hpp
Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::getAxes().
|
inline |
get center position of bin with given local bin numbers
[in] | localBins | local bin indices along each axis |
Definition at line 166 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 166 of file Grid.hpp
Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::getBinCenterImpl().
|
inline |
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). Definition at line 149 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 149 of file Grid.hpp
|
inlinestatic |
dimensionality of grid
Definition at line 157 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 157 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().
|
inline |
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. Definition at line 210 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 210 of file Grid.hpp
|
inline |
determine global bin index from local bin indices along each axis
[in] | localBins | local bin indices along each axis |
Definition at line 193 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 193 of file Grid.hpp
Referenced by Acts::detail::Grid< external_spacepoint_t >::atLocalBins(), Acts::BinnedSPGroupIterator< external_spacepoint_t >::BinnedSPGroupIterator(), Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::detail::Grid< external_spacepoint_t >::globalBinFromFromLowerLeftEdge(), and Acts::detail::Grid< external_spacepoint_t >::globalBinFromPosition().
|
inline |
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. Definition at line 182 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 182 of file Grid.hpp
Referenced by Acts::detail::Grid< external_spacepoint_t >::atPosition(), Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::neighbors().
|
inline |
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 + 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. Definition at line 345 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 345 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().
|
inline |
check whether given point is inside grid limits
true
if , 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. Definition at line 382 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 382 of file Grid.hpp
|
inline |
determine local bin index for each axis from global bin index
[in] | bin | global bin index |
axes
object)Definition at line 239 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 239 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::getBinCenterImpl(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::isValidBin(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache().
|
inline |
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. Definition at line 257 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 257 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::detail::Grid< external_spacepoint_t >::globalBinFromFromLowerLeftEdge(), and Acts::mapMaterialPoints().
|
inline |
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. Definition at line 227 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 227 of file Grid.hpp
Referenced by Acts::detail::Grid< external_spacepoint_t >::closestPointsIndices(), Acts::detail::Grid< external_spacepoint_t >::globalBinFromPosition(), and Acts::detail::Grid< external_spacepoint_t >::interpolate().
|
inline |
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). Definition at line 273 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 273 of file Grid.hpp
Referenced by Acts::detail::Grid< external_spacepoint_t >::interpolate().
|
inline |
get the maximum value of all axes of one grid
Definition at line 303 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 303 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::JsonGeometryConverter::jsonToVolumeMaterial(), and Acts::mapMaterialPoints().
|
inline |
get the minimum value of all axes of one grid
Definition at line 298 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 298 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::JsonGeometryConverter::jsonToVolumeMaterial(), and Acts::mapMaterialPoints().
|
inline |
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 along each dimension. Definition at line 401 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 401 of file Grid.hpp
Referenced by Acts::BinFinder< external_spacepoint_t >::findBins(), Acts::ATLASTopBinFinder< SpacePoint >::findBins(), Acts::ATLASBottomBinFinder< SpacePoint >::findBins(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache().
|
inline |
get number of bins along each specific axis
Definition at line 293 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 293 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::isValidBin(), Acts::JsonGeometryConverter::jsonToVolumeMaterial(), Acts::mapMaterialPoints(), and Acts::detail::Grid< external_spacepoint_t >::size().
|
inlineprivate |
Definition at line 432 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 432 of file Grid.hpp
Referenced by Acts::detail::Grid< external_spacepoint_t >::closestPointsIndices(), and Acts::detail::Grid< external_spacepoint_t >::interpolate().
|
inline |
|
inline |
total number of bins
Definition at line 411 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 411 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::detail::Grid< external_spacepoint_t >::Grid(), Acts::mapMaterialPoints(), Acts::detail::Grid< external_spacepoint_t >::neighborHoodIndices(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::size(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::SurfaceGridLookup(), and Acts::JsonGeometryConverter::volumeMaterialToJson().
|
inline |
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). Definition at line 284 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 284 of file Grid.hpp
Referenced by Acts::detail::Grid< external_spacepoint_t >::interpolate().
|
static |
number of dimensions of the grid
Definition at line 41 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 41 of file Grid.hpp
Referenced by Acts::detail::Grid< external_spacepoint_t >::dimensions(), Acts::detail::Grid< external_spacepoint_t >::interpolate(), and Acts::detail::Grid< external_spacepoint_t >::localBinsFromLowerLeftEdge().
|
private |
set of axis defining the multi-dimensional grid
Definition at line 425 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 425 of file Grid.hpp
Referenced by Acts::detail::Grid< external_spacepoint_t >::axes(), Acts::detail::Grid< external_spacepoint_t >::binCenter(), Acts::detail::Grid< external_spacepoint_t >::globalBinFromLocalBins(), Acts::detail::Grid< external_spacepoint_t >::isInside(), Acts::detail::Grid< external_spacepoint_t >::localBinsFromGlobalBin(), Acts::detail::Grid< external_spacepoint_t >::localBinsFromLowerLeftEdge(), Acts::detail::Grid< external_spacepoint_t >::localBinsFromPosition(), Acts::detail::Grid< external_spacepoint_t >::lowerLeftBinEdge(), Acts::detail::Grid< external_spacepoint_t >::maxPosition(), Acts::detail::Grid< external_spacepoint_t >::minPosition(), Acts::detail::Grid< external_spacepoint_t >::neighborHoodIndices(), Acts::detail::Grid< external_spacepoint_t >::numLocalBins(), Acts::detail::Grid< external_spacepoint_t >::rawClosestPointsIndices(), Acts::detail::Grid< external_spacepoint_t >::setExteriorBins(), and Acts::detail::Grid< external_spacepoint_t >::upperRightBinEdge().
|
private |
linear value store for each bin
Definition at line 427 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 427 of file Grid.hpp
Referenced by Acts::detail::Grid< external_spacepoint_t >::at(), Acts::detail::Grid< external_spacepoint_t >::atLocalBins(), Acts::detail::Grid< external_spacepoint_t >::atPosition(), and Acts::detail::Grid< external_spacepoint_t >::Grid().