Struct Acts::MaterialMapper¶
-
template<typename G>
struct MaterialMapper Struct for mapping global 3D positions to material values.
Global 3D positions are transformed into a
DIM_POS
Dimensional vector which is used to look up the material classification value in the underlying material map.Public Types
-
using Grid_t = G
Public Functions
-
inline MaterialMapper(std::function<ActsVector<DIM_POS>(const Vector3&)> transformPos, Grid_t grid)
Default constructor.
- Parameters
transformPos – [in] Mapping of global 3D coordinates (cartesian) onto grid space
grid – [in] Grid storing material classification values
-
inline const Grid_t &getGrid() const
Get a const reference on the underlying grid structure.
- Returns
Grid reference
-
inline Material getMaterial(const Vector3 &position) const
Retrieve interpolated material at given position.
- Parameters
position – [in] Global 3D position
- Returns
Material at the given position
- Pre
The given
position
must lie within the range of the underlying map.
-
inline MaterialCell getMaterialCell(const Vector3 &position) const
Retrieve material cell for given position.
- Parameters
position – [in] Global 3D position
- Returns
material cell containing the given global position
- Pre
The given
position
must lie within the range of the underlying map.
-
inline std::vector<double> getMax() const
Get the maximum value of all axes of the map.
- Returns
Vector returning the maxima of all map axes
-
inline std::vector<double> getMin() const
Get the minimum value of all axes of the map.
- Returns
Vector returning the minima of all map axes
-
inline std::vector<size_t> getNBins() const
Get the number of bins for all axes of the map.
- Returns
Vector returning number of bins for all map axes
-
inline bool isInside(const Vector3 &position) const
Check whether given 3D position is inside look-up domain.
- Parameters
position – [in] Global 3D position
- Returns
true
if position is inside the defined look-up grid, otherwisefalse
Public Static Attributes
-
static constexpr size_t DIM_POS = Grid_t::DIM
-
struct MaterialCell
Struct representing smallest grid unit in material grid.
This type encapsulate all required information to perform linear interpolation of material classification values within a 3D volume.
Public Functions
-
inline MaterialCell(std::function<ActsVector<DIM_POS>(const Vector3&)> transformPos, std::array<double, DIM_POS> lowerLeft, std::array<double, DIM_POS> upperRight, std::array<Material::ParametersVector, N> materialValues)
Default constructor.
- Parameters
transformPos – [in] Mapping of global 3D coordinates onto grid space
lowerLeft – [in] Generalized lower-left corner of hyper box (containing the minima of the hyper box along each Dimension)
upperRight – [in] Generalized upper-right corner of hyper box (containing the maxima of the hyper box along each Dimension)
materialValues – [in] Material classification values at the hyper box corners sorted in the canonical order defined in Acts::interpolate
-
inline Material getMaterial(const Vector3 &position) const
Retrieve material at given position.
- Parameters
position – [in] Global 3D position
- Returns
Material at the given position
- Pre
The given
position
must lie within the current cell.
-
inline bool isInside(const Vector3 &position) const
Check whether given 3D position is inside this cell.
- Parameters
position – [in] Global 3D position
- Returns
true
if position is inside the current cell, otherwisefalse
Public Static Attributes
-
static constexpr unsigned int N = 1 << DIM_POS
Number of corner points defining the confining hyper-box.
-
inline MaterialCell(std::function<ActsVector<DIM_POS>(const Vector3&)> transformPos, std::array<double, DIM_POS> lowerLeft, std::array<double, DIM_POS> upperRight, std::array<Material::ParametersVector, N> materialValues)
-
using Grid_t = G