12#include "detray/definitions/algebra.hpp"
13#include "detray/definitions/detail/qualifiers.hpp"
14#include "detray/definitions/math.hpp"
15#include "detray/definitions/units.hpp"
16#include "detray/geometry/coordinates/line2D.hpp"
17#include "detray/navigation/intersection/intersection.hpp"
18#include "detray/tracks/ray.hpp"
25template <
typename frame_t, concepts::algebra algebra_t,
bool resolve_pos>
29template <detray::concepts::aos algebra_t,
bool resolve_pos>
39 template <
typename surface_descr_t>
44 template <
typename other_algebra_t>
66 const vector3_t &rd = ray.dir();
67 const point3_t &ro = ray.pos();
70 const vector3_t &_z = trf.z();
72 const point3_t &_t = trf.translation();
75 const scalar_t zd{vector::dot(_z, rd)};
77 const scalar_t denom{1.f - (zd * zd)};
80 if (denom < 1e-5f) [[unlikely]] {
85 const point3_t t2l = _t - ro;
88 const scalar_t t2l_on_line{vector::dot(t2l, _z)};
91 const scalar_t t2l_on_track{vector::dot(t2l, rd)};
94 const scalar_t s{1.f / denom * (t2l_on_track - t2l_on_line * zd)};
95 const point3_t glob_pos = ro + s * rd;
describes a straight-line trajectory
Definition ray.hpp:22
This class holds the intersection information.
Definition intersection.hpp:212
Detray include(s).
Definition array_operators.hpp:18
get_scalar_t< A, T > dscalar
Scalar type for algebra A and value type T.
Definition algebra.hpp:64
get_vector3D_t< A, T > dvector3D
Three-dimensional vector type for algebra A and value type T.
Definition algebra.hpp:80
get_transform3D_t< A, T > dtransform3D
Three-dimensional transform type for algebra A and value type T.
Definition algebra.hpp:84
get_point3D_t< A, T > dpoint3D
Three-dimensional point type for algebra A and value type T.
Definition algebra.hpp:72
Result of intersector: Point of intersection on a surface.
Definition intersection.hpp:43
Projection into a line coordinate frame.
Definition line2D.hpp:20
algebra_t algebra_type
Algebra policy used by the geometric calculation.
Definition ray_line_intersector.hpp:32
static constexpr std::uint8_t n_solutions
Maximum number of solutions this intersector can produce.
Definition ray_line_intersector.hpp:48
dpoint3D< algebra_t > point_type
Three-dimensional point type used for the closest-approach result.
Definition ray_line_intersector.hpp:36
line2D< algebra_t > frame_type
Coordinate frame of the line mask.
Definition ray_line_intersector.hpp:34
constexpr result_type point_of_intersection(const trajectory_type< algebra_t > &ray, const dtransform3D< algebra_t > &trf, const dscalar< algebra_t >=0.f) const
Operator function to find intersections between ray and line mask.
Definition ray_line_intersector.hpp:59
detail::ray< other_algebra_t > trajectory_type
Ray trajectory type accepted by this intersector.
Definition ray_line_intersector.hpp:45
intersection2D< surface_descr_t, algebra_t, resolve_pos > intersection_type
Intersection result type associated with a surface descriptor.
Definition ray_line_intersector.hpp:40
intersection_point< algebra_t, point_type, intersection::contains_pos > result_type
Result containing the path and closest-approach point.
Definition ray_line_intersector.hpp:51
Intersection implementation for detector surfaces using a ray trajectory.
Definition ray_intersector.hpp:31