12#include "detray/definitions/algebra.hpp"
13#include "detray/definitions/detail/qualifiers.hpp"
14#include "detray/definitions/units.hpp"
17#include "detray/test/common/event_generator/random_numbers.hpp"
27template <concepts::scalar scalar_t>
37 std::numeric_limits<scalar_t>::epsilon()};
88 assert(min_phi <= max_phi);
95 template <
typename o_scalar_t>
98 phi_range(
static_cast<o_scalar_t
>(r[0]),
static_cast<o_scalar_t
>(r[1]));
105 scalar_t low, scalar_t high) {
106 auto min_theta{std::clamp(low, scalar_t{0.f},
k_max_pi)};
107 auto max_theta{std::clamp(high, scalar_t{0.f},
k_max_pi)};
109 assert(min_theta <= max_theta);
117 template <
typename o_scalar_t>
120 theta_range(
static_cast<o_scalar_t
>(r[0]),
static_cast<o_scalar_t
>(r[1]));
129 constexpr auto num_max{0.001f * std::numeric_limits<scalar_t>::max()};
130 auto min_eta{low > -num_max ? low : -num_max};
131 auto max_eta{high < num_max ? high : num_max};
133 assert(min_eta <= max_eta);
141 template <
typename o_scalar_t>
144 eta_range(
static_cast<o_scalar_t
>(r[0]),
static_cast<o_scalar_t
>(r[1]));
189 template <concepts::po
int3D po
int3_t>
191 const point3_t& ori) {
192 return origin(ori[0], ori[1], ori[2]);
236 DETRAY_HOST_DEVICE
constexpr std::size_t
n_tracks()
const {
256 DETRAY_HOST_DEVICE
constexpr std::size_t
phi_steps()
const {
264 DETRAY_HOST_DEVICE
constexpr std::size_t
eta_steps()
const {
280 DETRAY_HOST_DEVICE
constexpr scalar_t
time()
const {
return m_time; }
292 const auto& ori = cfg.
origin();
296 out <<
"\nUniform track generator\n"
297 <<
"----------------------------\n"
298 <<
" Random seed : " << cfg.
seed() <<
"\n"
299 <<
" No. tracks : " << cfg.
n_tracks() <<
"\n"
300 <<
" -> phi steps : " << cfg.
phi_steps() <<
"\n"
301 <<
" -> theta/eta steps : " << cfg.
theta_steps() <<
"\n"
304 <<
" Rand. charge : " << std::boolalpha
309 out <<
" Transverse mom. : "
312 out <<
" Momentum : "
317 out <<
" Phi range : ["
322 out <<
" Eta range : [" <<
eta_range[0] <<
", "
326 out <<
" Theta range : ["
Detray include(s).
Definition array_operators.hpp:18
std::array< value_t, kDIM > darray
Fixed-size array container.
Definition containers.hpp:30
static constexpr scalar_t pi
π
Definition units.hpp:136
static constexpr seed_type default_seed()
Get the default seed of the engine.
Definition random_numbers.hpp:102
static constexpr scalar_t mm
Native length unit, the millimetre.
Definition units.hpp:27
static constexpr scalar_t GeV
Native energy unit, the gigaelectronvolt.
Definition units.hpp:81
static constexpr scalar_t e
Charge, native unit e (elementary charge).
Definition units.hpp:105
static constexpr scalar_t rad
Native angular unit, the radian.
Definition units.hpp:115
static constexpr scalar_t us
Microsecond expressed in the internal length-equivalent time unit.
Definition units.hpp:64