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/definitions/algebra.hpp"
0013 #include "detray/definitions/units.hpp"
0014 #include "detray/propagator/propagator.hpp"
0015 
0016 // Detray test include(s)
0017 #include "detray/test/framework/test_configuration.hpp"
0018 #include "detray/test/framework/types.hpp"
0019 
0020 // GTest include(s)
0021 #include <gtest/gtest.h>
0022 
0023 // System include(s)
0024 #include <limits>
0025 #include <ostream>
0026 #include <string>
0027 
0028 namespace detray::test {
0029 
0030 /// Base type for test fixtures with google test
0031 template <typename scope = ::testing::Test>
0032 class fixture_base : public scope {
0033  public:
0034   /// Linear algebra typedefs
0035   /// @{
0036   using algebra_t = test::algebra;
0037   using index = test::index;
0038   using scalar = test::scalar;
0039   using point2 = test::point2;
0040   using point3 = test::point3;
0041   using vector2 = test::vector2;
0042   using vector3 = test::vector3;
0043   using transform3 = test::transform3;
0044   template <index ROW, index COL>
0045   using matrix = test::matrix<ROW, COL>;
0046   /// @}
0047 
0048   using configuration = detray::test::configuration<scalar>;
0049 
0050   /// Constructor
0051   explicit fixture_base(const configuration& cfg = {})
0052       : m_tolerance{cfg.tol()},
0053         m_inf{cfg.inf},
0054         m_epsilon{cfg.epsilon},
0055         m_path_limit{cfg.propagation().stepping.path_limit},
0056         m_overstep_tolerance{
0057             cfg.propagation().navigation.intersection.overstep_tolerance},
0058         m_step_constraint{cfg.propagation().stepping.step_constraint} {}
0059 
0060   /// Default destructor
0061   ~fixture_base() override = default;
0062 
0063   /// @returns the benchmark name
0064   std::string name() const { return "detray_test"; };
0065 
0066  protected:
0067   static void SetUpTestSuite() { /* Do nothing */ }
0068   static void TearDownTestSuite() { /* Do nothing */ }
0069   void SetUp() override { /* Do nothing */ }
0070   void TearDown() override { /* Do nothing */ }
0071 
0072   /// Getters
0073   /// @{
0074   scalar tolerance() const { return m_tolerance; }
0075   scalar inf() const { return m_inf; }
0076   scalar epsilon() const { return m_epsilon; }
0077   scalar path_limit() const { return m_path_limit; }
0078   scalar overstep_tolerance() const { return m_overstep_tolerance; }
0079   scalar step_constraint() const { return m_step_constraint; }
0080   /// @}
0081 
0082  private:
0083   scalar m_tolerance{};
0084   scalar m_inf{};
0085   scalar m_epsilon{};
0086   scalar m_path_limit{};
0087   scalar m_overstep_tolerance{};
0088   scalar m_step_constraint{};
0089 };
0090 
0091 }  // namespace detray::test