File indexing completed on 2026-07-26 08:22:20
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010
0011 #include "traccc/definitions/math.hpp"
0012 #include "traccc/definitions/qualifiers.hpp"
0013
0014
0015 #include <cmath>
0016
0017 namespace traccc {
0018
0019 template <typename scalar_t>
0020 TRACCC_HOST_DEVICE inline scalar_t eta_to_theta(const scalar_t eta) {
0021 return 2.f * math::atan(std::exp(-eta));
0022 }
0023
0024 template <typename scalar_t>
0025 TRACCC_HOST_DEVICE inline scalar_t theta_to_eta(const scalar_t theta) {
0026 return -math::log(math::tan(theta * 0.5f));
0027 }
0028
0029 template <typename range_t>
0030 TRACCC_HOST_DEVICE inline range_t eta_to_theta_range(const range_t& eta_range) {
0031
0032
0033 return {eta_to_theta(eta_range[1]), eta_to_theta(eta_range[0])};
0034 }
0035
0036 template <typename range_t>
0037 TRACCC_HOST_DEVICE inline range_t theta_to_eta_range(
0038 const range_t& theta_range) {
0039
0040
0041 return {theta_to_eta(theta_range[1]), theta_to_eta(theta_range[0])};
0042 }
0043
0044 }