Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-12 07:52:59

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