Back to home page

EIC code displayed by LXR

 
 

    


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

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/detail/qualifiers.hpp"
0013 #include "detray/definitions/units.hpp"
0014 
0015 // System include(s).
0016 #include <limits>
0017 #include <ostream>
0018 
0019 namespace detray::stepping {
0020 
0021 enum class id {
0022   // False for non-charged tracks
0023   e_linear = 0,
0024   // True for charged tracks
0025   e_rk = 1,
0026 };
0027 
0028 struct config {
0029   /// Minimum step size
0030   float min_stepsize{1e-4f * unit<float>::mm};
0031   /// Runge-Kutta numeric error tolerance
0032   float rk_error_tol{1e-4f * unit<float>::mm};
0033   /// Step size constraint
0034   float step_constraint{std::numeric_limits<float>::max()};
0035   /// Maximal path length of track
0036   float path_limit{5.f * unit<float>::m};
0037   /// Maximum number of Runge-Kutta step trials
0038   std::size_t max_rk_updates{10000u};
0039   /// Use mean energy loss (Bethe)
0040   /// if false, most probable energy loss (Landau) will be used
0041   bool use_mean_loss{true};
0042   /// Use eloss gradient in error propagation
0043   bool use_eloss_gradient{false};
0044   /// Use b field gradient in error propagation
0045   bool use_field_gradient{false};
0046   /// Do covariance transport
0047   bool do_covariance_transport{true};
0048 
0049   /// Print the stepping configuration
0050   DETRAY_HOST
0051   friend std::ostream& operator<<(std::ostream& out, const config& cfg) {
0052     out << "  Min. Stepsize         : "
0053         << cfg.min_stepsize / detray::unit<float>::mm << " [mm]\n"
0054         << "  Runge-Kutta tolerance : "
0055         << cfg.rk_error_tol / detray::unit<float>::mm << " [mm]\n"
0056         << "  Max. step updates     : " << cfg.max_rk_updates << "\n"
0057         << "  Stepsize  constraint  : "
0058         << cfg.step_constraint / detray::unit<float>::mm << " [mm]\n"
0059         << "  Path limit            : "
0060         << cfg.path_limit / detray::unit<float>::m << " [m]\n"
0061         << std::boolalpha << "  Use Bethe energy loss : " << cfg.use_mean_loss
0062         << "\n"
0063         << "  Do cov. transport     : " << cfg.do_covariance_transport << "\n";
0064 
0065     if (cfg.do_covariance_transport) {
0066       out << std::boolalpha
0067           << "  Use eloss gradient    : " << cfg.use_eloss_gradient << "\n"
0068           << "  Use B-field gradient  : " << cfg.use_field_gradient << "\n";
0069     }
0070     // Reset state
0071     out << std::noboolalpha;
0072 
0073     return out;
0074   }
0075 };
0076 
0077 }  // namespace detray::stepping