Function Acts::materialMapperXYZ¶
Defined in File MaterialMapUtils.hpp
Function Documentation¶
-
MaterialMapper<detail::Grid<Material::ParametersVector, detail::EquidistantAxis, detail::EquidistantAxis, detail::EquidistantAxis>>
Acts
::
materialMapperXYZ
(const std::function<size_t(std::array<size_t, 3> binsXYZ, std::array<size_t, 3> nBinsXYZ)> &materialVectorToGridMapper, std::vector<double> xPos, std::vector<double> yPos, std::vector<double> zPos, std::vector<Material> material, double lengthUnit = UnitConstants::mm, )¶ Method to setup the MaterialMapper.
e.g.: we have small grid with the values: x={2,3}, y={3,4}, z ={4,5}, the corresponding indices are i (belonging to x), j (belonging to y) and k (belonging to z), the globalIndex is M (belonging to the values of the Material) and the map is:
In this case the function would look like:
[](std::array<size_t, 3> binsXYZ, std::array<size_t, 3> nBinsXYZ) { return (binsXYZ.at(0) * (nBinsXYZ.at(1) * nBinsXYZ.at(2)) + binsXYZ.at(1) * nBinsXYZ.at(2) + binsXYZ.at(2)); }
- Note
The values do not need to be sorted or unique (this will be done inside the function)
- Note
The values do not need to be sorted or unique (this will be done inside the function)
- Note
The values do not need to be sorted or unique (this will be done inside the function)
- Note
The function localToGlobalBin determines how the material was stored in the vector in respect to the grid values
- Parameters
[in] materialVectorToGridMapper
: Function mapping the vector of material to the map of material values
- Parameters
[in] xPos
: Values of the grid points in x
- Parameters
[in] yPos
: Values of the grid points in y
- Parameters
[in] zPos
: Values of the grid points in z
- Parameters
[in] material
: The material classification values in x, y and z for all given grid points stored in a vector
- Parameters
[in] lengthUnit
: The unit of the grid points