Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-16 08:03:58

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 epsDir = 0.125_mrad;
0038 constexpr auto epsMom = 1_eV;
0039 // relative covariance tolerance
0040 constexpr auto epsCov = 0.00125;
0041 
0042 const GeometryContext geoCtx;
0043 const MagneticFieldContext magCtx;
0044 
0045 constexpr auto bz = 2_T;
0046 
0047 const auto magFieldZero = std::make_shared<MagneticField>(Vector3::Zero());
0048 const auto magFieldNonZero =
0049     std::make_shared<MagneticField>(Vector3::UnitZ() * bz);
0050 const EigenPropagator eigenPropagatorZero{EigenStepper(magFieldZero)};
0051 const EigenPropagator eigenPropagatorNonZero{EigenStepper(magFieldNonZero)};
0052 const StraightLinePropagator straightPropagator{StraightLineStepper()};
0053 
0054 }  // namespace
0055 
0056 BOOST_AUTO_TEST_SUITE(PropagationCompareEigenStraightLine)
0057 
0058 BOOST_DATA_TEST_CASE(NeutralZeroMagneticField,
0059                      ds::phi* ds::thetaCentral* ds::absMomentum* ds::pathLength,
0060                      phi, theta, p, s) {
0061   runForwardComparisonTest(eigenPropagatorZero, straightPropagator, geoCtx,
0062                            magCtx,
0063                            makeParametersCurvilinearNeutral(phi, theta, p), s,
0064                            epsPos, epsDir, epsMom, epsCov);
0065 }
0066 
0067 // TODO https://github.com/acts-project/acts/issues/4375
0068 //
0069 // BOOST_DATA_TEST_CASE(NeutralNonZeroMagneticField,
0070 //                      ds::phi* ds::thetaCentral* ds::absMomentum*
0071 //                      ds::pathLength, phi, theta, p, s) {
0072 //   runForwardComparisonTest(
0073 //       eigenPropagatorNonZero, straightPropagator, geoCtx, magCtx,
0074 //       makeParametersCurvilinearNeutral(phi, theta, p), s, epsPos, epsDir,
0075 //       epsMom, epsCov, CovarianceCheck::Full);
0076 // }
0077 
0078 BOOST_DATA_TEST_CASE(ChargedZeroMagneticField,
0079                      ds::phi* ds::thetaCentral* ds::absMomentum*
0080                          ds::chargeNonZero* ds::pathLength,
0081                      phi, theta, p, q, s) {
0082   runForwardComparisonTest(eigenPropagatorZero, straightPropagator, geoCtx,
0083                            magCtx, makeParametersCurvilinear(phi, theta, p, q),
0084                            s, epsPos, epsDir, epsMom, epsCov);
0085 }
0086 
0087 // TODO add comparison tests between the straight line and eigen propagator for
0088 //      a charged particle w/ infinite momentum in a non-zero magnetic field.
0089 //      these should be identical. requires proper handling of q/p=0 in the
0090 //      track parameters.
0091 
0092 BOOST_AUTO_TEST_SUITE_END()