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/EigenStepper.hpp"
0016 #include "Acts/Propagator/EigenStepperDenseExtension.hpp"
0017 #include "Acts/Propagator/Navigator.hpp"
0018 #include "Acts/Propagator/Propagator.hpp"
0019 #include "Acts/Propagator/RiddersPropagator.hpp"
0020 
0021 #include "PropagationDatasets.hpp"
0022 #include "PropagationTests.hpp"
0023 
0024 namespace {
0025 
0026 namespace ds = ActsTests::PropagationDatasets;
0027 using namespace Acts::UnitLiterals;
0028 
0029 using MagneticField = Acts::ConstantBField;
0030 using Stepper = Acts::EigenStepper<Acts::EigenStepperDenseExtension>;
0031 using Propagator = Acts::Propagator<Stepper, Acts::Navigator>;
0032 using RiddersPropagator = Acts::RiddersPropagator<Propagator>;
0033 
0034 // absolute parameter tolerances for position, direction, and absolute momentum
0035 constexpr auto epsPos = 10_um;
0036 constexpr auto epsDir = 1_mrad;
0037 constexpr auto epsMom = 5_MeV;
0038 
0039 const Acts::GeometryContext geoCtx;
0040 const Acts::MagneticFieldContext magCtx;
0041 
0042 inline Propagator makePropagator(double bz) {
0043   auto magField = std::make_shared<MagneticField>(Acts::Vector3(0.0, 0.0, bz));
0044   Stepper stepper(std::move(magField));
0045   return Propagator(std::move(stepper),
0046                     Acts::Navigator({createDenseBlock(geoCtx)}));
0047 }
0048 
0049 }  // namespace
0050 
0051 BOOST_AUTO_TEST_SUITE(PropagationEigenDenseConstant)
0052 
0053 // check that the propagation is reversible and self-consistent
0054 
0055 BOOST_DATA_TEST_CASE(ForwardBackward,
0056                      ds::phi* ds::thetaWithoutBeam* ds::absMomentum*
0057                          ds::chargeNonZero* ds::pathLength* ds::magneticField,
0058                      phi, theta, p, q, s, bz) {
0059   runForwardBackwardTest<Propagator>(
0060       makePropagator(bz), geoCtx, magCtx,
0061       makeParametersCurvilinear(phi, theta, p, q), s, epsPos, epsDir, epsMom);
0062 }
0063 
0064 BOOST_AUTO_TEST_SUITE_END()