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/cylindrical2D.hpp"
17#include "detray/navigation/intersection/intersection.hpp"
18#include "detray/tracks/ray.hpp"
19#include "detray/utils/invalid_values.hpp"
20#include "detray/utils/quadratic_equation.hpp"
27template <
typename frame_t, concepts::algebra algebra_t,
bool resolve_pos>
31template <detray::concepts::aos algebra_t,
bool resolve_pos>
41 template <
typename surface_descr_t>
46 template <
typename other_algebra_t>
64 template <
typename mask_t>
74 switch (qe.solutions()) {
76 results[1].path = qe.larger();
77 results[1].point = ray.pos() + qe.larger() * ray.dir();
84 results[0].path = qe.smaller();
85 results[0].point = ray.pos() + qe.smaller() * ray.dir();
88 [[unlikely]]
default: {
103 template <
typename mask_t>
111 const scalar_t r{
mask[mask_t::shape::e_r]};
112 const vector3_t &sz = trf.z();
113 const vector3_t &sc = trf.translation();
115 const point3_t &ro = ray.pos();
116 const vector3_t &rd = ray.dir();
118 const auto pc_cross_sz = vector::cross(ro - sc, sz);
119 const auto rd_cross_sz = vector::cross(rd, sz);
120 const scalar_t a{vector::dot(rd_cross_sz, rd_cross_sz)};
121 const scalar_t b{2.f * vector::dot(rd_cross_sz, pc_cross_sz)};
122 const scalar_t c{vector::dot(pc_cross_sz, pc_cross_sz) - (r * r)};
Definition quadratic_equation.hpp:24
describes a straight-line trajectory
Definition ray.hpp:22
This class holds the intersection information.
Definition intersection.hpp:212
Mask a region on a surface and link it to a volume.
Definition mask.hpp:46
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
std::array< value_t, kDIM > darray
Fixed-size array container.
Definition containers.hpp:30
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
Projection into a 2D cylindrical coordinate frame.
Definition cylindrical2D.hpp:20
Result of intersector: Point of intersection on a surface.
Definition intersection.hpp:43
algebra_t algebra_type
Algebra policy used by this intersector.
Definition ray_cylinder_intersector.hpp:34
constexpr result_type point_of_intersection(const trajectory_type< algebra_t > &ray, const dtransform3D< algebra_t > &trf, const mask_t &mask, const dscalar< algebra_t >=0.f) const
Operator function to find intersections between ray and planar mask.
Definition ray_cylinder_intersector.hpp:65
intersection2D< surface_descr_t, algebra_t, resolve_pos > intersection_type
Intersection result type associated with a surface descriptor.
Definition ray_cylinder_intersector.hpp:42
detail::quadratic_equation< dscalar< algebra_t > > solve_intersection(const trajectory_type< algebra_t > &ray, const mask_t &mask, const dtransform3D< algebra_t > &trf) const
Calculates the distance to the (two) intersection points on the cylinder in global coordinates.
Definition ray_cylinder_intersector.hpp:105
static constexpr std::uint8_t n_solutions
Maximum number of solutions produced by this intersector.
Definition ray_cylinder_intersector.hpp:51
detail::ray< other_algebra_t > trajectory_type
Trajectory representation accepted by this intersector.
Definition ray_cylinder_intersector.hpp:47
dpoint3D< algebra_t > point_type
Point type used for the intersection result.
Definition ray_cylinder_intersector.hpp:38
darray< intersection_point< algebra_t, point_type, intersection::contains_pos >, n_solutions > result_type
Result type returned by the geometric intersection calculation.
Definition ray_cylinder_intersector.hpp:54
cylindrical2D< algebra_t > frame_type
Coordinate frame of the intersected surface.
Definition ray_cylinder_intersector.hpp:36
Intersection implementation for detector surfaces using a ray trajectory.
Definition ray_intersector.hpp:31