12#include "detray/definitions/algebra.hpp"
13#include "detray/definitions/detail/qualifiers.hpp"
14#include "detray/definitions/math.hpp"
15#include "detray/material/material.hpp"
16#include "detray/material/predefined_materials.hpp"
25template <concepts::scalar scalar_t>
32 constexpr material_rod() =
default;
48 constexpr bool operator==(
const material_rod<scalar_type>& rhs)
const {
55 constexpr explicit operator bool()
const {
56 if (m_radius <= std::numeric_limits<scalar_type>::epsilon() ||
58 m_material.mass_density() == 0) {
87 if (math::fabs(approach) > m_radius) {
91 const scalar_type sin_inc_angle_2{1.f - cos_inc_angle * cos_inc_angle};
93 return 2.f * math::sqrt((m_radius * m_radius - approach * approach) /
104 return this->
path_segment(cos_inc_angle, approach) / m_material.X0();
114 return this->
path_segment(cos_inc_angle, approach) / m_material.L0();
119 friend std::ostream&
operator<<(std::ostream& os,
const material_rod& mat) {
122 os <<
" | radius = " << mat.
radius() <<
"mm";
129 scalar_type m_radius = std::numeric_limits<scalar_type>::epsilon();
130 scalar_type m_radius_in_X0 = std::numeric_limits<scalar_type>::epsilon();
131 scalar_type m_radius_in_L0 = std::numeric_limits<scalar_type>::epsilon();
Detray include(s).
Definition array_operators.hpp:18
friend std::ostream & operator<<(std::ostream &os, const material_rod &mat)
Definition material_rod.hpp:119
constexpr scalar_type radius() const
Return the rod radius.
Definition material_rod.hpp:72
constexpr scalar_type path_segment_in_L0(const scalar_type cos_inc_angle, const scalar_type approach) const
Compute the path length through the rod for a track crossing.
Definition material_rod.hpp:112
constexpr material_rod(const material_type &material, scalar_type radius)
Construct a rod from a material and its radius.
Definition material_rod.hpp:37
constexpr scalar_type path_segment(const scalar_type cos_inc_angle, const scalar_type approach) const
Compute the path length through the rod for a track crossing.
Definition material_rod.hpp:84
constexpr scalar_type path_segment_in_X0(const scalar_type cos_inc_angle, const scalar_type approach) const
Compute the path length through the rod for a track crossing.
Definition material_rod.hpp:102
constexpr const material_type & get_material() const
Access the (average) material parameters.
Definition material_rod.hpp:67
material< scalar_t > material_type
Bulk material type represented by this rod.
Definition material_rod.hpp:30
constexpr scalar_type thickness() const
Return the rod radius.
Definition material_rod.hpp:77
constexpr bool operator==(const material_rod< scalar_type > &rhs) const
Equality operator.
Definition material_rod.hpp:48
scalar_t scalar_type
Scalar type used for rod dimensions and material properties.
Definition material_rod.hpp:28
Material composition properties and density data used by interactions.
Definition material.hpp:36
constexpr scalar_type Z() const
Definition material.hpp:127
Elements Declaration.
Definition predefined_materials.hpp:34