|
ACTS
Experiment-independent tracking
|
Type-safe view into a grid with const access. More...
#include <Acts/Utilities/AnyGridView.hpp>
Public Types | |
| using | AnyIndexType = IGrid::AnyIndexType |
| Type for indices, imported from IGrid. | |
| using | AnyPointType = IGrid::AnyPointType |
| Type for points, imported from IGrid. | |
| using | GridPointerType = const IGrid* |
| Type of pointer to grid, const or non-const depending on isConst. | |
Public Member Functions | |
| template<typename... Axes> | |
| AnyGridConstView (const Grid< T, Axes... > &grid) | |
| Constructor from const concrete Grid reference. | |
| AnyGridConstView (const IGrid &grid) | |
| Constructor from const IGrid reference. | |
| const T & | atLocalBins (const AnyIndexType &indices) const |
| Access value at given local bin indices with const access. | |
| AnyPointType | binCenter (const IGrid::AnyIndexType &indices) const |
| Get the center position of a bin for given indices. | |
| void | checkType () |
| Check if the grid's value type matches the template parameter T. | |
| std::size_t | dimensions () const |
| Get the number of dimensions of the grid. | |
| AnyPointType | lowerLeftBinEdge (const IGrid::AnyIndexType &indices) const |
| Get the lower left edge position of a bin for given indices. | |
| AnyIndexType | numLocalBins () const |
| Get the number of bins along each axis. | |
| AnyPointType | upperRightBinEdge (const IGrid::AnyIndexType &indices) const |
| Get the upper right edge position of a bin for given indices. | |
Public Attributes | |
| GridPointerType | m_grid |
| Type-erased pointer to the underlying const grid. | |
Type-safe view into a grid with const access.
| T | Type of values stored in the grid |
This class provides a type-safe interface to access grid objects through the type-erased IGrid interface with const access only. It ensures that the grid being viewed contains values of the expected type T.
Example usage:
| using Acts::AnyGridConstView< T >::AnyIndexType = IGrid::AnyIndexType |
Type for indices, imported from IGrid.
| using Acts::AnyGridConstView< T >::AnyPointType = IGrid::AnyPointType |
Type for points, imported from IGrid.
| using Acts::AnyGridConstView< T >::GridPointerType = const IGrid* |
Type of pointer to grid, const or non-const depending on isConst.
|
explicit |
Constructor from const IGrid reference.
| grid | The grid to view |
|
explicit |
Constructor from const concrete Grid reference.
| Axes | Parameter pack of axis types defining the grid |
| grid | The concrete grid to view |
| const T & Acts::AnyGridConstView< T >::atLocalBins | ( | const AnyIndexType & | indices | ) | const |
Access value at given local bin indices with const access.
| indices | The local bin indices |
| std::invalid_argument | if indices size doesn't match grid dimensions |
| std::out_of_range | if indices are out of bounds |
| AnyPointType Acts::AnyGridConstView< T >::binCenter | ( | const IGrid::AnyIndexType & | indices | ) | const |
Get the center position of a bin for given indices.
| indices | The local bin indices |
| void Acts::AnyGridConstView< T >::checkType | ( | ) |
Check if the grid's value type matches the template parameter T.
| std::invalid_argument | if there's a type mismatch |
| std::size_t Acts::AnyGridConstView< T >::dimensions | ( | ) | const |
Get the number of dimensions of the grid.
| AnyPointType Acts::AnyGridConstView< T >::lowerLeftBinEdge | ( | const IGrid::AnyIndexType & | indices | ) | const |
Get the lower left edge position of a bin for given indices.
| indices | The local bin indices |
| AnyIndexType Acts::AnyGridConstView< T >::numLocalBins | ( | ) | const |
Get the number of bins along each axis.
| AnyPointType Acts::AnyGridConstView< T >::upperRightBinEdge | ( | const IGrid::AnyIndexType & | indices | ) | const |
Get the upper right edge position of a bin for given indices.
| indices | The local bin indices |
| GridPointerType Acts::AnyGridConstView< T >::m_grid |
Type-erased pointer to the underlying const grid.