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