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/Definitions/Algebra.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 #include "Acts/MagneticField/ConstantBField.hpp"
0015 #include "Acts/MagneticField/MagneticFieldContext.hpp"
0016 #include "Acts/Propagator/Navigator.hpp"
0017 #include "Acts/Propagator/Propagator.hpp"
0018 #include "Acts/Propagator/RiddersPropagator.hpp"
0019 #include "Acts/Propagator/SympyStepper.hpp"
0020 #include "ActsTests/CommonHelpers/PredefinedMaterials.hpp"
0021 
0022 #include <utility>
0023 
0024 #include "PropagationDatasets.hpp"
0025 #include "PropagationTests.hpp"
0026 
0027 namespace {
0028 
0029 namespace ds = ActsTests::PropagationDatasets;
0030 
0031 using namespace Acts;
0032 using namespace UnitLiterals;
0033 
0034 using MagneticField = ConstantBField;
0035 using Stepper = SympyStepper;
0036 using TestPropagator = Propagator<Stepper, Navigator>;
0037 using RiddersPropagator = RiddersPropagator<TestPropagator>;
0038 
0039 // absolute parameter tolerances for position, direction, and absolute momentum
0040 constexpr auto epsPos = 10_um;
0041 constexpr auto epsDir = 1_mrad;
0042 constexpr auto epsMom = 5_MeV;
0043 
0044 const GeometryContext geoCtx;
0045 const MagneticFieldContext magCtx;
0046 
0047 inline TestPropagator makePropagator(
0048     double bz, std::shared_ptr<const TrackingGeometry> geo) {
0049   auto magField = std::make_shared<MagneticField>(Vector3(0.0, 0.0, bz));
0050   Stepper stepper(std::move(magField));
0051   return TestPropagator(std::move(stepper), Navigator({std::move(geo)}));
0052 }
0053 
0054 }  // namespace
0055 
0056 BOOST_AUTO_TEST_SUITE(PropagationSympyDenseConstant)
0057 
0058 // check that the propagation is reversible and self-consistent
0059 
0060 BOOST_DATA_TEST_CASE(ForwardBackward,
0061                      ds::phi* ds::thetaWithoutBeam* ds::absMomentum*
0062                          ds::chargeNonZero* ds::pathLength* ds::magneticField,
0063                      phi, theta, p, q, s, bz) {
0064   runForwardBackwardTest(makePropagator(bz, createDenseBlock(geoCtx)), geoCtx,
0065                          magCtx, makeParametersCurvilinear(phi, theta, p, q), s,
0066                          epsPos, epsDir, epsMom);
0067 }
0068 
0069 // check effects on the parameter covariance
0070 
0071 BOOST_DATA_TEST_CASE(DenseTelescopeCovariance,
0072                      ds::absMomentum* ds::chargeNonZero, p, q) {
0073   const double bz = 0_T;
0074   const Material material = ActsTests::makeLiquidArgon();
0075   const double thickness = 1_m;
0076 
0077   auto [geo, surfaces] = createDenseTelescope(geoCtx, material, thickness);
0078 
0079   auto propagator = makePropagator(bz, std::move(geo));
0080 
0081   runDenseForwardTest(propagator, geoCtx, magCtx, p, q, *surfaces.back(),
0082                       material, thickness);
0083 }
0084 
0085 BOOST_AUTO_TEST_SUITE_END()