File indexing completed on 2025-01-18 09:12:29
0001
0002
0003
0004
0005
0006
0007
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/AtlasStepper.hpp"
0016 #include "Acts/Propagator/EigenStepper.hpp"
0017 #include "Acts/Propagator/Propagator.hpp"
0018
0019 #include <limits>
0020 #include <utility>
0021
0022 #include "PropagationDatasets.hpp"
0023 #include "PropagationTests.hpp"
0024
0025 namespace {
0026
0027 namespace ds = ActsTests::PropagationDatasets;
0028 using namespace Acts::UnitLiterals;
0029
0030 using MagneticField = Acts::ConstantBField;
0031 using AtlasStepper = Acts::AtlasStepper;
0032 using AtlasPropagator = Acts::Propagator<AtlasStepper>;
0033 using EigenStepper = Acts::EigenStepper<>;
0034 using EigenPropagator = Acts::Propagator<EigenStepper>;
0035
0036
0037 constexpr auto epsPos = 1_um;
0038 constexpr auto epsDir = 0.125_mrad;
0039 constexpr auto epsMom = 1_eV;
0040
0041 constexpr auto epsCov = 0.1;
0042
0043 const Acts::GeometryContext geoCtx;
0044 const Acts::MagneticFieldContext magCtx;
0045
0046 inline std::pair<AtlasPropagator, EigenPropagator> makePropagators(double bz) {
0047 auto field = std::make_shared<MagneticField>(Acts::Vector3(0.0, 0.0, bz));
0048 return {AtlasPropagator(AtlasStepper(field)),
0049 EigenPropagator(EigenStepper(field))};
0050 }
0051
0052 }
0053
0054 BOOST_AUTO_TEST_SUITE(PropagationCompareAtlasEigenConstant)
0055
0056 BOOST_DATA_TEST_CASE(Forward,
0057 ds::phi*(ds::thetaWithoutBeam)*ds::absMomentum*
0058 ds::chargeNonZero* ds::pathLength* ds::magneticField,
0059 phi, theta, p, q, s, bz) {
0060 auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
0061 runForwardComparisonTest(
0062 atlasPropagator, eigenPropagator, geoCtx, magCtx,
0063 makeParametersCurvilinearWithCovariance(phi, theta, p, q), s, epsPos,
0064 epsDir, epsMom, epsCov);
0065 }
0066
0067 BOOST_DATA_TEST_CASE(ToCylinderAlongZ,
0068 ds::phi* ds::thetaWithoutBeam* ds::absMomentum*
0069 ds::chargeNonZero* ds::pathLength* ds::magneticField,
0070 phi, theta, p, q, s, bz) {
0071 auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
0072 runToSurfaceComparisonTest(
0073 atlasPropagator, eigenPropagator, geoCtx, magCtx,
0074 makeParametersCurvilinearWithCovariance(phi, theta, p, q), s,
0075 ZCylinderSurfaceBuilder(), epsPos, epsDir, epsMom, epsCov);
0076 }
0077
0078 BOOST_DATA_TEST_CASE(
0079 ToDisc,
0080 ds::phiWithoutAmbiguity* ds::thetaWithoutBeam* ds::absMomentum*
0081 ds::chargeNonZero* ds::pathLength* ds::magneticField,
0082 phi, theta, p, q, s, bz) {
0083 auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
0084 runToSurfaceComparisonTest(
0085 atlasPropagator, eigenPropagator, geoCtx, magCtx,
0086 makeParametersCurvilinearWithCovariance(phi, theta, p, q), s,
0087 DiscSurfaceBuilder(), epsPos, epsDir, epsMom, epsCov);
0088 }
0089
0090 BOOST_DATA_TEST_CASE(ToPlane,
0091 ds::phi* ds::thetaWithoutBeam* ds::absMomentum*
0092 ds::chargeNonZero* ds::pathLength* ds::magneticField,
0093 phi, theta, p, q, s, bz) {
0094 auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
0095 runToSurfaceComparisonTest(
0096 atlasPropagator, eigenPropagator, geoCtx, magCtx,
0097 makeParametersCurvilinearWithCovariance(phi, theta, p, q), s,
0098 PlaneSurfaceBuilder(), epsPos, epsDir, epsMom, epsCov);
0099 }
0100
0101 BOOST_DATA_TEST_CASE(ToStrawAlongZ,
0102 ds::phi* ds::thetaWithoutBeam* ds::absMomentum*
0103 ds::chargeNonZero* ds::pathLength* ds::magneticField,
0104 phi, theta, p, q, s, bz) {
0105 auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
0106 runToSurfaceComparisonTest(
0107 atlasPropagator, eigenPropagator, geoCtx, magCtx,
0108 makeParametersCurvilinearWithCovariance(phi, theta, p, q), s,
0109 ZStrawSurfaceBuilder(), epsPos, epsDir, epsMom, epsCov);
0110 }
0111
0112 BOOST_AUTO_TEST_SUITE_END()