ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
perigee_extrapolator.hpp
1// This file is part of the ACTS project.
2//
3// Copyright (C) 2016 CERN for the benefit of the ACTS project
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
15
16#pragma once
17
18// Project include(s).
19#include "detray/definitions/detail/macros.hpp"
20#include "detray/definitions/detail/qualifiers.hpp"
21#include "detray/geometry/shapes/line.hpp"
22#include "detray/material/material_rod.hpp"
23#include "detray/navigation/direct_navigator.hpp"
24#include "detray/navigation/external_surface.hpp"
25#include "detray/propagator/actor_chain.hpp"
26#include "detray/propagator/concepts.hpp"
27#include "detray/propagator/propagation_config.hpp"
28#include "detray/propagator/propagator.hpp"
29#include "detray/tracks/tracks.hpp"
30#include "detray/utils/curvilinear_frame.hpp"
31#include "detray/utils/logging.hpp"
32#include "detray/utils/ranges.hpp"
33#include "detray/utils/ranges/single.hpp"
34
35namespace detray {
36
42template <typename detector_t, typename stepper_t,
45 using nav_link_t = typename detector_t::surface_type::navigation_link;
46
47 public:
49 using detector_type = detector_t;
51 using algebra_type = typename detector_type::algebra_type;
54
58 nav_link_t>;
61 direct_navigator<detector_t,
65
67 using stepper_type = stepper_t;
70 typename stepper_t::free_track_parameters_type;
73 typename stepper_t::bound_track_parameters_type;
74
76 using actor_chain_type = actor_chain_t;
77
81
83 using state = typename propagator_type::state;
84
87 DETRAY_HOST_DEVICE
88 explicit constexpr perigee_extrapolator(const propagation::config &cfg)
89 : m_propagator{cfg} {}
90
97 template <typename track_t>
98 DETRAY_HOST_DEVICE state create_state(const track_t &track,
99 const detector_t &det) const {
100 return state{
101 track, det,
103 m_propagator.m_cfg.context};
104 }
105
111 DETRAY_HOST_DEVICE bool finished(const state &propagation) const {
112 return m_propagator.finished(propagation);
113 }
114
122 DETRAY_HOST_DEVICE auto extrapolate(
123 state &propagation,
124 typename actor_chain_type::state_ref_tuple actor_state_refs =
125 typename actor_chain_type::state_ref_tuple{}) const {
126 propagation.navigation().set_direction(navigation::direction::e_backward);
127 m_propagator.propagate(propagation, actor_state_refs);
128
129 assert(finished(propagation));
130 assert(!propagation.stepping()().is_invalid());
131
132 return detail::free_to_bound_vector<line2D<algebra_type>>(
133 m_perigee_surface.transform(), propagation.stepping()());
134 }
135
139 DETRAY_HOST_DEVICE auto extrapolate(state &propagation) {
140 // Run propagation
141 propagation.navigation().set_direction(navigation::direction::e_backward);
142 m_propagator.propagate(propagation);
143
144 assert(finished(propagation));
145 assert(!propagation.stepping()().is_invalid());
146
147 return detail::free_to_bound_vector<line2D<algebra_type>>(
148 m_perigee_surface.transform(), propagation.stepping()());
149 }
150
151 private:
153 static constexpr typename perigee_surface::material_type perigee_material{
154 detray::vacuum<scalar_type>{}, std::numeric_limits<scalar_type>::max()};
156 static constexpr typename perigee_surface::mask_type perigee_mask{
157 0u, std::numeric_limits<scalar_type>::max(),
158 std::numeric_limits<scalar_type>::max()};
160 perigee_surface m_perigee_surface{dtransform3D<algebra_type>{}, perigee_mask,
161 perigee_material, 0u,
162 surface_id::e_passive};
164 propagator_type m_propagator{};
165};
166
167} // namespace detray
Empty actor chain (placeholder).
Definition actor_chain.hpp:135
Navigator that visits an externally supplied sequence of surfaces in order.
Definition direct_navigator.hpp:38
intersection2D< surface_type, algebra_t, !intersection::contains_pos > intersection_type
Definition direct_navigator.hpp:63
Surface descriptor used for geometry supplied outside the detector store.
Definition external_surface.hpp:32
constexpr auto transform() const -> const transform3_type &
Definition external_surface.hpp:143
detray::mask< line_circular, algebra_type, nav_link_t > mask_type
Definition external_surface.hpp:37
material_rod< scalar_type > material_type
Definition external_surface.hpp:39
propagator< stepper_type, navigator_type, actor_chain_type > propagator_type
Propagator type combining the stepper, navigator, and actor chain.
Definition perigee_extrapolator.hpp:79
typename detector_type::algebra_type algebra_type
Algebra backend used by detector and stepper.
Definition perigee_extrapolator.hpp:51
dscalar< algebra_type > scalar_type
Scalar type for propagation calculations.
Definition perigee_extrapolator.hpp:53
typename stepper_t::bound_track_parameters_type bound_track_parameters_type
Bound track parameter representation used by the stepper.
Definition perigee_extrapolator.hpp:72
stepper_t stepper_type
Stepper used to transport the track.
Definition perigee_extrapolator.hpp:67
bool finished(const state &propagation) const
Return whether or not the propagation completed successfully.
Definition perigee_extrapolator.hpp:111
typename stepper_t::free_track_parameters_type free_track_parameters_type
Free track parameter representation used by the stepper.
Definition perigee_extrapolator.hpp:69
auto extrapolate(state &propagation)
Overload for empty actor chain.
Definition perigee_extrapolator.hpp:139
state create_state(const track_t &track, const detector_t &det) const
Create the propagation state for the extrapolator.
Definition perigee_extrapolator.hpp:98
auto extrapolate(state &propagation, typename actor_chain_type::state_ref_tuple actor_state_refs=typename actor_chain_type::state_ref_tuple{}) const
Propagate method: Coordinates the calls of the stepper, navigator and all registered actors.
Definition perigee_extrapolator.hpp:122
typename navigator_type::intersection_type intersection_type
Intersection result type produced by the navigator.
Definition perigee_extrapolator.hpp:64
actor_chain_t actor_chain_type
Actor chain run by the propagator.
Definition perigee_extrapolator.hpp:76
direct_navigator< detector_t, detray::ranges::single_view< perigee_surface > > navigator_type
Navigator configured to intersect the perigee surface.
Definition perigee_extrapolator.hpp:60
constexpr perigee_extrapolator(const propagation::config &cfg)
Construct from a propagator configuration.
Definition perigee_extrapolator.hpp:88
detector_t detector_type
Detector type used for geometry and navigation.
Definition perigee_extrapolator.hpp:49
typename propagator_type::state state
Propagation state returned by this extrapolator.
Definition perigee_extrapolator.hpp:83
external_surface< algebra_type, line_circular, material_rod< scalar_type >, nav_link_t > perigee_surface
External line surface representing the perigee target.
Definition perigee_extrapolator.hpp:56
Struct that implements a view on a single element.
Definition single.hpp:29
Concept for the actor chain that is being run in the propagator.
Definition concepts.hpp:38
constexpr double u
atomic mass unit u
Definition Units.hpp:155
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_transform3D_t< A, T > dtransform3D
Three-dimensional transform type for algebra A and value type T.
Definition algebra.hpp:84
Configuration of the propagation.
Definition propagation_config.hpp:23
Templated propagator class, using a stepper and a navigator object in succession.
Definition propagator.hpp:35
state_base< false > state
Definition propagator.hpp:284
bool propagate(state_base< is_owning > &propagation, actor_states_t actor_state_refs=dtuple<>{}) const
Propagate method: Coordinates the calls of the stepper, navigator and all registered actors.
Definition propagator.hpp:324
Elements Declaration.
Definition predefined_materials.hpp:34