Analysis Software
Documentation for sPHENIX simulation software
|
class for describing a regular multi-dimensional grid More...
#include <acts/blob/sPHENIX/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< ActsScalar, 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)=delete | |
default constructor | |
Grid (std::tuple< Axes...> &&axes) | |
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< ActsScalar, 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 | |
point_t | binWidth () const |
get bin width along each specific axis | |
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<ActsScalar, DIM>, std::array<ActsScalar, 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 | |
detail::GlobalNeighborHoodIndices < DIM > | neighborHoodIndices (const index_t &localBins, std::array< std::pair< int, int >, DIM > &sizePerAxis) const |
get global bin indices for neighborhood | |
size_t | size (bool fullCounter=true) 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 39 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 39 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<ActsScalar, DIM> |
using Acts::detail::Grid< T, Axes >::reference = value_type& |
using Acts::detail::Grid< T, Axes >::value_type = T |
|
delete |
default constructor
[in] | axes | actual axis objects spanning the grid |
|
inline |
|
inline |
access value stored in bin with given global bin number
[in] | bin | global bin number |
Definition at line 106 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 106 of file Grid.hpp
Referenced by Acts::Sycl::SeedFinder< external_spacepoint_t >::createSeedsForGroup(), Acts::SeedFinder< external_spacepoint_t, Acts::Cuda >::createSeedsForGroup(), Acts::Cuda::SeedFinder< external_spacepoint_t >::createSeedsForGroup(), Acts::SeedFinder< external_spacepoint_t, platform_t >::createSeedsForGroup(), Acts::Experimental::BoundVolumesGrid1Impl::for(), Acts::from_json(), Acts::SeedFinder< external_spacepoint_t, platform_t >::getCompatibleDoublets(), Acts::detail::Grid< external_spacepoint_t >::interpolate(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::lookup(), Acts::mapMaterialPoints(), Acts::Neighbour< external_spacepoint_t >::Neighbour(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache(), Acts::detail::Grid< external_spacepoint_t >::setExteriorBins(), while(), and ActsExamples::RootMaterialWriter::writeMaterial().
|
inline |
|
inline |
access value stored in bin with given local bin numbers
[in] | localBins | local bin indices along each axis |
Definition at line 123 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 123 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().
|
inline |
access value stored in bin with given local bin numbers
[in] | localBins | local bin indices along each axis |
Definition at line 135 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 135 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 78 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 78 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 97 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 97 of file Grid.hpp
|
inline |
Definition at line 458 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 458 of file Grid.hpp
Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::getAxes(), and Acts::PortalJsonConverter::toJsonDetray().
|
inline |
get center position of bin with given local bin numbers
[in] | localBins | local bin indices along each axis |
Definition at line 168 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 168 of file Grid.hpp
Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::getBinCenterImpl().
|
inline |
|
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 151 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 151 of file Grid.hpp
|
inlinestatic |
dimensionality of grid
Definition at line 159 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 159 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 212 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 212 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 195 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 195 of file Grid.hpp
Referenced by Acts::detail::Grid< external_spacepoint_t >::atLocalBins(), 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 184 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 184 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 ActsScalar
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 ActsScalar
(or a value which is implicitly convertible). Coordinate indices must start at 0. Definition at line 352 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 352 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 389 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 389 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 241 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 241 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 259 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 259 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::detail::Grid< external_spacepoint_t >::globalBinFromFromLowerLeftEdge().
|
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 229 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 229 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 275 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 275 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 310 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 310 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::from_json(), Acts::mapMaterialPoints(), and while().
|
inline |
get the minimum value of all axes of one grid
Definition at line 305 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 305 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::from_json(), Acts::mapMaterialPoints(), and while().
|
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 408 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 408 of file Grid.hpp
Referenced by Acts::ATLASBottomBinFinder< SpacePoint >::findBins(), Acts::ATLASTopBinFinder< SpacePoint >::findBins(), Acts::BinFinder< external_spacepoint_t >::findBins(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache().
|
inline |
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 along each dimension. Definition at line 429 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 429 of file Grid.hpp
|
inline |
get number of bins along each specific axis
Definition at line 300 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 300 of file Grid.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::from_json(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::isValidBin(), Acts::mapMaterialPoints(), Acts::detail::Grid< external_spacepoint_t >::size(), and while().
|
inlineprivate |
Definition at line 471 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 471 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 440 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 440 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(), and ActsExamples::RootMaterialWriter::writeMaterial().
|
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 286 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 286 of file Grid.hpp
Referenced by Acts::detail::Grid< external_spacepoint_t >::interpolate().
|
static |
number of dimensions of the grid
Definition at line 42 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 42 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 464 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 464 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 >::binWidth(), 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 466 of file Grid.hpp.
View newest version in sPHENIX GitHub at line 466 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().