Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:24:41

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/Propagator.hpp"
0016 #include "Acts/Propagator/RiddersPropagator.hpp"
0017 #include "Acts/Propagator/SympyStepper.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 Stepper = SympyStepper;
0031 using TestPropagator = Propagator<Stepper>;
0032 using RiddersPropagator = RiddersPropagator<TestPropagator>;
0033 
0034 // absolute parameter tolerances for position, direction, and absolute momentum
0035 constexpr auto epsPos = 1_um;
0036 constexpr auto epsDir = 0.125_mrad;
0037 constexpr auto epsMom = 1_eV;
0038 
0039 const GeometryContext geoCtx;
0040 const MagneticFieldContext magCtx;
0041 
0042 inline TestPropagator makePropagator(double bz) {
0043   auto magField = std::make_shared<MagneticField>(Vector3(0.0, 0.0, bz));
0044   Stepper stepper(std::move(magField));
0045   return TestPropagator(std::move(stepper));
0046 }
0047 
0048 }  // namespace
0049 
0050 BOOST_AUTO_TEST_SUITE(PropagationSympyConstant)
0051 
0052 // check that the propagation is reversible and self-consistent
0053 
0054 BOOST_DATA_TEST_CASE(ForwardBackward,
0055                      ds::phi* ds::thetaWithoutBeam* ds::absMomentum*
0056                          ds::chargeNonZero* ds::pathLength* ds::magneticField,
0057                      phi, theta, p, q, s, bz) {
0058   runForwardBackwardTest(makePropagator(bz), geoCtx, magCtx,
0059                          makeParametersCurvilinear(phi, theta, p, q), s, epsPos,
0060                          epsDir, epsMom);
0061 }
0062 
0063 // TODO implement jacobian/covariance tests. right now covariance comparisons
0064 // with RiddersPropagator fail because of numerical imprecisions
0065 
0066 BOOST_AUTO_TEST_SUITE_END()