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