12#include "detray/definitions/algebra.hpp"
13#include "detray/definitions/detail/qualifiers.hpp"
14#include "detray/material/material.hpp"
15#include "detray/material/predefined_materials.hpp"
24template <concepts::scalar scalar_t>
31 constexpr material_slab() =
default;
47 constexpr bool operator==(
const material_slab& rhs)
const {
54 constexpr explicit operator bool()
const {
55 if (m_thickness <= std::numeric_limits<scalar_type>::epsilon() ||
56 m_thickness == std::numeric_limits<scalar_type>::max() ||
58 m_material.
mass_density() == 0.f || m_material.molar_density() == 0.f) {
88 return m_thickness / cos_inc_angle;
98 return m_thickness_in_X0 / cos_inc_angle;
108 return m_thickness_in_L0 / cos_inc_angle;
113 friend std::ostream&
operator<<(std::ostream& os,
const material_slab& mat) {
116 os <<
" | thickness = " << mat.
thickness() <<
" mm";
123 scalar_type m_thickness = std::numeric_limits<scalar_type>::epsilon();
124 scalar_type m_thickness_in_X0 = std::numeric_limits<scalar_type>::epsilon();
125 scalar_type m_thickness_in_L0 = std::numeric_limits<scalar_type>::epsilon();
Detray include(s).
Definition array_operators.hpp:18
constexpr bool operator==(const material_slab &rhs) const
Equality operator.
Definition material_slab.hpp:47
constexpr scalar_type path_segment_in_X0(const scalar_type cos_inc_angle, const scalar_type=0.f) const
Compute the path length through the slab at an incidence angle.
Definition material_slab.hpp:95
scalar_t scalar_type
Definition material_slab.hpp:27
material< scalar_t > material_type
Definition material_slab.hpp:29
constexpr material_slab(const material_type &material, scalar_type thickness)
Constructor.
Definition material_slab.hpp:36
constexpr scalar_type thickness_in_X0() const
Return the radiation length fraction.
Definition material_slab.hpp:75
constexpr scalar_type path_segment_in_L0(const scalar_type cos_inc_angle, const scalar_type=0.f) const
Compute the path length through the slab at an incidence angle.
Definition material_slab.hpp:105
friend std::ostream & operator<<(std::ostream &os, const material_slab &mat)
Definition material_slab.hpp:113
constexpr scalar_type thickness() const
Definition material_slab.hpp:71
constexpr const material_type & get_material() const
Access the (average) material parameters.
Definition material_slab.hpp:67
constexpr scalar_type thickness_in_L0() const
Return the nuclear interaction length fraction.
Definition material_slab.hpp:79
constexpr scalar_type path_segment(const scalar_type cos_inc_angle, const scalar_type=0.f) const
Compute the path length through the slab at an incidence angle.
Definition material_slab.hpp:85
Material composition properties and density data used by interactions.
Definition material.hpp:36
constexpr scalar_type mass_density() const
Definition material.hpp:130
Elements Declaration.
Definition predefined_materials.hpp:34