File InterpolatedMaterialMap.hpp¶
-
namespace Acts
Note
This file is foreseen for the
Geometry
module to replaceExtent
-
template<typename Mapper_t>
class InterpolatedMaterialMap : public Acts::IVolumeMaterial - #include <Acts/Material/InterpolatedMaterialMap.hpp>
Interpolate material classification values from material values on a given grid.
This class implements a material service which is initialized by a material map defined by:
a list of material values on a regular grid in some n-Dimensional space,
a transformation of global 3D coordinates onto this n-Dimensional space.
a transformation of local n-Dimensional material coordinates into global (cartesian) 3D coordinates
The material value for a given global position is then determined by:
mapping the position onto the grid,
looking up the material classification values on the closest grid points,
doing a linear interpolation of these values.
Warning
Each classification number of the material is interpolated independently and thus does not consider any correlations that exists between these values. This might work out since the used material is already a mean of the materials in a certain bin and can therewith be treated as a collection of numbers.
- Template Parameters
G – Type of the grid
Public Functions
-
inline InterpolatedMaterialMap(Mapper_t &&mapper)
Create interpolated map.
- Parameters
mapper – [in] Material map
-
inline InterpolatedMaterialMap(Mapper_t &&mapper, BinUtility bu)
Create interpolated map.
- Parameters
mapper – [in] Material map
bu – [in]
BinUtility
for build from
-
inline const BinUtility &binUtility() const
Return the BinUtility.
-
inline const Mapper_t &getMapper() const
Convenience method to access underlying material mapper.
- Returns
The material mapper
-
inline Material getMaterial(const Vector3 &position) const
Retrieve the interpolated material.
- Parameters
position – [in] Global 3D position
- Returns
material at given position
-
inline Material getMaterial(const Vector3 &position, Cache &cache) const
Retrieve material.
- Parameters
position – [in] Global 3D position
cache – [inout] Cache object. Contains material cell used for interpolation
- Returns
material at given position
-
inline Material getMaterialGradient(const Vector3 &position, ActsMatrix<5, 5> &derivative) const
Retrieve material value & its “gradient”.
Note
Currently the derivative is not calculated
- Parameters
position – [in] Global 3D position
derivative – [out] “Gradient” of material as (5x5) matrix
- Returns
Material
-
inline Material getMaterialGradient(const Vector3 &position, ActsMatrix<5, 5> &derivative, Cache &cache) const
Retrieve material value & its “gradient”.
Note
Currently the derivative is not calculated
Note
Cache is not used currently
- Parameters
position – [in] Global 3D position
derivative – [out] “Gradient” of material as (5x5) matrix
cache – [inout] Cache object. Contains cell used for
- Returns
Material
-
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 map, otherwisefalse
-
inline virtual const Material material(const Vector3 &position) const
Retrieve the binned material.
- Parameters
position – [in] Global 3D position
- Returns
Material at given position
-
inline virtual std::ostream &toStream(std::ostream &sl) const
Output Method for std::ostream.
- Parameters
sl – The outoput stream
Private Functions
Private Members
-
BinUtility m_binUtility = {}¶
-
struct Cache
- #include <Acts/Material/InterpolatedMaterialMap.hpp>
Temporary storage of a certain cell to improve material access.
Public Members
-
bool initialized = false
Boolean statement if the cell is initialized.
-
std::optional<typename Mapper_t::MaterialCell> matCell
Stored material cell.
-
bool initialized = false
-
template<typename G>
struct MaterialMapper¶ - #include <Acts/Material/InterpolatedMaterialMap.hpp>
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 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
Private Members
- std::function< ActsVector< DIM_POS >const Vector3 &)> m_transformPos
Geometric transformation applied to global 3D positions.
-
struct MaterialCell¶
- #include <Acts/Material/InterpolatedMaterialMap.hpp>
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
Public Static Attributes
Private Members
-
std::array<Material::ParametersVector, N> m_materialValues¶
Material component vectors at the hyper-box corners.
Note
These values must be order according to the prescription detailed in Acts::interpolate.
- std::function< ActsVector< DIM_POS >const Vector3 &)> m_transformPos
Geometric transformation applied to global 3D positions.
-
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)¶
-
inline MaterialMapper(std::function<ActsVector<DIM_POS>(const Vector3&)> transformPos, Grid_t grid)¶
-
template<typename Mapper_t>