Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-27 07:24:05

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 // Project include(s)
0012 #include "detray/definitions/algebra.hpp"
0013 #include "detray/definitions/detail/qualifiers.hpp"
0014 #include "detray/geometry/coordinates/cartesian2D.hpp"
0015 #include "detray/geometry/mask.hpp"
0016 #include "detray/geometry/shapes/rectangle2D.hpp"
0017 #include "detray/propagator/detail/jacobian_engine.hpp"
0018 #include "detray/tracks/bound_track_parameters.hpp"
0019 #include "detray/utils/unit_vectors.hpp"
0020 
0021 namespace detray {
0022 
0023 template <concepts::algebra algebra_t>
0024 struct curvilinear_frame {
0025   using transform3_type = dtransform3D<algebra_t>;
0026   using vector3 = typename transform3_type::vector3;
0027   using unit_vectors_type = unit_vectors<vector3>;
0028   using bound_to_free_matrix_type = bound_to_free_matrix<algebra_t>;
0029   using bound_vector_type = bound_parameters_vector<algebra_t>;
0030   using jacobian_engine_type = detail::jacobian_engine<algebra_t>;
0031   using free_track_parameters_type = free_track_parameters<algebra_t>;
0032 
0033   DETRAY_HOST_DEVICE
0034   explicit curvilinear_frame(const free_track_parameters_type& free_params) {
0035     assert(!free_params.is_invalid());
0036 
0037     const vector3 t = free_params.pos();
0038     const vector3 z = free_params.dir();
0039     const vector3 x = unit_vectors_type().make_curvilinear_unit_u(z);
0040 
0041     m_trf = transform3_type(t, z, x);
0042     m_bound_vec = detail::free_to_bound_vector<cartesian2D<algebra_t>>(
0043         m_trf, free_params);
0044   }
0045 
0046   DETRAY_HOST_DEVICE
0047   bound_to_free_matrix_type bound_to_free_jacobian() const {
0048     return jacobian_engine_type()
0049         .template bound_to_free_jacobian<cartesian2D<algebra_t>>(
0050             m_trf, mask<rectangle2D, algebra_t>{}, m_bound_vec);
0051   }
0052 
0053   transform3_type m_trf{};
0054   bound_vector_type m_bound_vec{};
0055 
0056 };  // curvilinear frame
0057 
0058 }  // namespace detray