Back to home page

EIC code displayed by LXR

 
 

    


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

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/propagator/propagation_config.hpp"
0013 
0014 // System include(s)
0015 #include <limits>
0016 #include <ostream>
0017 
0018 namespace detray::test {
0019 
0020 /// Test configuration type
0021 template <concepts::scalar scalar_t>
0022 struct configuration {
0023   /// General testing
0024   /// @{
0025   /// Tolerance to compare two floating point values
0026   scalar_t m_tolerance{1e-5f};
0027   /// Shorthand for infinity
0028   scalar_t inf{std::numeric_limits<scalar_t>::infinity()};
0029   /// Shorthand for the floating point epsilon
0030   scalar_t epsilon{std::numeric_limits<scalar_t>::epsilon()};
0031   /// @}
0032 
0033   /// Propagation
0034   /// @{
0035   propagation::config m_prop_cfg{};
0036   /// @}
0037 
0038   /// Setters
0039   /// @{
0040   configuration& tol(scalar_t t) {
0041     m_tolerance = t;
0042     return *this;
0043   }
0044   /// @}
0045 
0046   /// Getters
0047   /// @{
0048   scalar_t tol() const { return m_tolerance; }
0049   propagation::config& propagation() { return m_prop_cfg; }
0050   const propagation::config& propagation() const { return m_prop_cfg; }
0051   /// @}
0052 
0053  private:
0054   /// Print configuration
0055   friend std::ostream& operator<<(std::ostream& out, const configuration& cfg) {
0056     out << "Test Configuration\n"
0057         << "----------------------------\n"
0058         << "  test tolerance        : " << cfg.tol() << "\n\n";
0059     out << cfg.propagation();
0060 
0061     return out;
0062   }
0063 };
0064 
0065 }  // namespace detray::test