Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-13 07:49:34

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 #include <boost/test/data/test_case.hpp>
0010 #include <boost/test/unit_test.hpp>
0011 
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/MagneticField/ConstantBField.hpp"
0014 #include "Acts/MagneticField/MagneticFieldContext.hpp"
0015 #include "Acts/Propagator/EigenStepper.hpp"
0016 #include "Acts/Propagator/Propagator.hpp"
0017 #include "Acts/Propagator/StraightLineStepper.hpp"
0018 
0019 #include "PropagationDatasets.hpp"
0020 #include "PropagationTests.hpp"
0021 
0022 namespace {
0023 
0024 namespace ds = ActsTests::PropagationDatasets;
0025 
0026 using namespace Acts;
0027 using namespace UnitLiterals;
0028 
0029 using MagneticField = ConstantBField;
0030 using EigenStepper = EigenStepper<>;
0031 using EigenPropagator = Propagator<EigenStepper>;
0032 using StraightLineStepper = StraightLineStepper;
0033 using StraightLinePropagator = Propagator<StraightLineStepper>;
0034 
0035 // absolute parameter tolerances for position, direction, and absolute momentum
0036 constexpr auto epsPos = 1_um;
0037 constexpr auto epsTime = 1_um;
0038 constexpr auto epsDir = 0.125_mrad;
0039 constexpr auto epsMom = 1_eV;
0040 // relative covariance tolerance
0041 constexpr auto epsCov = 0.00125;
0042 
0043 const auto geoCtx = GeometryContext::dangerouslyDefaultConstruct();
0044 const MagneticFieldContext magCtx;
0045 
0046 constexpr auto bz = 2_T;
0047 
0048 const auto magFieldZero = std::make_shared<MagneticField>(Vector3::Zero());
0049 const auto magFieldNonZero =
0050     std::make_shared<MagneticField>(Vector3::UnitZ() * bz);
0051 const EigenPropagator eigenPropagatorZero{EigenStepper(magFieldZero)};
0052 const EigenPropagator eigenPropagatorNonZero{EigenStepper(magFieldNonZero)};
0053 const StraightLinePropagator straightPropagator{StraightLineStepper()};
0054 
0055 }  // namespace
0056 
0057 BOOST_AUTO_TEST_SUITE(PropagationCompareEigenStraightLine)
0058 
0059 BOOST_DATA_TEST_CASE(NeutralZeroMagneticField,
0060                      ds::phi* ds::thetaCentral* ds::absMomentum* ds::pathLength,
0061                      phi, theta, p, s) {
0062   runForwardComparisonTest(eigenPropagatorZero, straightPropagator, geoCtx,
0063                            magCtx,
0064                            makeParametersCurvilinearNeutral(phi, theta, p), s,
0065                            epsPos, epsTime, epsDir, epsMom, epsCov);
0066 }
0067 
0068 // TODO https://github.com/acts-project/acts/issues/4375
0069 //
0070 // BOOST_DATA_TEST_CASE(NeutralNonZeroMagneticField,
0071 //                      ds::phi* ds::thetaCentral* ds::absMomentum*
0072 //                      ds::pathLength, phi, theta, p, s) {
0073 //   runForwardComparisonTest(
0074 //       eigenPropagatorNonZero, straightPropagator, geoCtx, magCtx,
0075 //       makeParametersCurvilinearNeutral(phi, theta, p), s, epsPos, epsTime,
0076 //       epsDir, epsMom, epsCov, CovarianceCheck::Full);
0077 // }
0078 
0079 BOOST_DATA_TEST_CASE(ChargedZeroMagneticField,
0080                      ds::phi* ds::thetaCentral* ds::absMomentum*
0081                          ds::chargeNonZero* ds::pathLength,
0082                      phi, theta, p, q, s) {
0083   runForwardComparisonTest(eigenPropagatorZero, straightPropagator, geoCtx,
0084                            magCtx, makeParametersCurvilinear(phi, theta, p, q),
0085                            s, epsPos, epsTime, epsDir, epsMom, epsCov);
0086 }
0087 
0088 // TODO add comparison tests between the straight line and eigen propagator for
0089 //      a charged particle w/ infinite momentum in a non-zero magnetic field.
0090 //      these should be identical. requires proper handling of q/p=0 in the
0091 //      track parameters.
0092 
0093 BOOST_AUTO_TEST_SUITE_END()