File indexing completed on 2025-12-08 09:28:07
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010 #include <boost/test/unit_test_log_formatter.hpp>
0011
0012 #include "Acts/Definitions/Algebra.hpp"
0013 #include "Acts/Definitions/TrackParametrization.hpp"
0014 #include "Acts/Definitions/Units.hpp"
0015 #include "Acts/EventData/TransformationHelpers.hpp"
0016 #include "Acts/Geometry/GeometryContext.hpp"
0017 #include "Acts/MagneticField/ConstantBField.hpp"
0018 #include "Acts/MagneticField/MagneticFieldContext.hpp"
0019 #include "Acts/Propagator/EigenStepper.hpp"
0020 #include "Acts/Propagator/Propagator.hpp"
0021 #include "Acts/Propagator/StraightLineStepper.hpp"
0022 #include "Acts/Propagator/VoidNavigator.hpp"
0023 #include "Acts/Propagator/detail/JacobianEngine.hpp"
0024 #include "Acts/Surfaces/DiscSurface.hpp"
0025 #include "Acts/Surfaces/PlaneSurface.hpp"
0026
0027 #include <cmath>
0028 #include <cstdlib>
0029 #include <iostream>
0030 #include <typeinfo>
0031
0032 using namespace Acts;
0033 using namespace Acts::UnitLiterals;
0034
0035 bool isDebugOutputEnabled() {
0036 std::array<boost::unit_test::output_format, 1> formats{
0037 boost::unit_test::OF_CLF};
0038 for (auto a_format : formats) {
0039 auto formatter = ::boost::unit_test::unit_test_log.get_formatter(a_format);
0040 if (formatter != nullptr) {
0041 return formatter->get_log_level() < boost::unit_test::log_test_units;
0042 }
0043 }
0044 return false;
0045 }
0046
0047 #define MSG_DEBUG(a) \
0048 if (isDebugOutputEnabled()) { \
0049 std::stringstream msg; \
0050 msg << a; \
0051 BOOST_TEST_MESSAGE(msg.str()); \
0052 } \
0053 do { \
0054 } while (0)
0055
0056 namespace {
0057
0058
0059
0060
0061 template <class T_ParticleHypothesis>
0062 double computeDtDs(const T_ParticleHypothesis &hypothesis, double qop) {
0063 return std::hypot(1., hypothesis.mass() / hypothesis.extractMomentum(qop));
0064 }
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074 template <class T_ParticleHypothesis>
0075 FreeToPathMatrix computeFreeToPathDerivatives(
0076 const Vector3 &direction, double qop, const Vector3 &bfield,
0077 const T_ParticleHypothesis &particle_hypothis) {
0078 FreeToPathMatrix path_length_deriv;
0079 #if defined(EIGEN_HAS_CONSTEXPR) && EIGEN_VERSION_AT_LEAST(3, 4, 0)
0080 static_assert(path_length_deriv.cols() ==
0081 8);
0082 #endif
0083 path_length_deriv.segment<3>(eFreePos0) = direction;
0084 path_length_deriv(0, eFreeTime) = computeDtDs(particle_hypothis, qop);
0085 path_length_deriv.segment<3>(eFreeDir0) =
0086 (qop * direction.cross(bfield)).transpose();
0087 path_length_deriv(0, eFreeQOverP) = 0.;
0088 return path_length_deriv;
0089 }
0090 template <typename T, std::size_t Rows, std::size_t Cols>
0091 constexpr Eigen::Matrix<T, Rows, Cols> makeMatrix(
0092 std::initializer_list<double> elements) {
0093
0094 if (!(elements.size() == Rows * Cols)) {
0095
0096
0097 std::abort();
0098 }
0099 Eigen::Matrix<T, Rows, Cols> matrix;
0100 auto iter = elements.begin();
0101 for (unsigned int row_i = 0; row_i < matrix.rows(); ++row_i) {
0102 for (unsigned int col_i = 0; col_i < matrix.cols(); ++col_i) {
0103 matrix(row_i, col_i) = *iter;
0104 ++iter;
0105 }
0106 }
0107 return matrix;
0108 }
0109 template <typename T, std::size_t Rows>
0110 constexpr Eigen::Matrix<T, Rows, 1> makeVector(
0111 std::initializer_list<double> elements) {
0112 return makeMatrix<T, Rows, 1>(elements);
0113 }
0114
0115 template <typename T_Matrix>
0116 T_Matrix matrixRatio(const T_Matrix &a, const T_Matrix &b) {
0117 if (a.rows() != b.rows() || a.cols() != b.cols()) {
0118 std::abort();
0119 }
0120 T_Matrix ret;
0121 for (unsigned int row_i = 0; row_i < a.rows(); ++row_i) {
0122 for (unsigned int col_i = 0; col_i < a.cols(); ++col_i) {
0123 if (b(row_i, col_i) == 0.) {
0124 ret(row_i, col_i) = a(row_i, col_i) - b(row_i, col_i);
0125 } else {
0126 ret(row_i, col_i) = a(row_i, col_i) / b(row_i, col_i);
0127 }
0128 }
0129 }
0130 return ret;
0131 }
0132
0133 }
0134
0135 namespace ActsTests {
0136
0137 struct TestData {
0138 enum ESurfaceType { kPlane, kPolarDisk, kCylinder };
0139 TestData(Vector3 &&a_surface_center, SquareMatrix3 &&a_surface_rot,
0140 ESurfaceType a_surface_type, BoundVector &&a_param_vec,
0141 BoundSquareMatrix &&a_param_cov, Vector3 &&a_bfield)
0142 : surface_center(std::move(a_surface_center)),
0143 surface_rot(std::move(a_surface_rot)),
0144 surface_type(a_surface_type),
0145 param_vec(std::move(a_param_vec)),
0146 param_cov(std::move(a_param_cov)),
0147 bfield(std::move(a_bfield)) {}
0148
0149 Vector3 surface_center;
0150 SquareMatrix3 surface_rot;
0151 ESurfaceType surface_type;
0152 BoundVector param_vec;
0153 BoundSquareMatrix param_cov;
0154 Vector3 bfield;
0155 };
0156
0157 template <typename T_StepperCreator>
0158 void test_bound_to_curvilinear(const std::vector<TestData> &test_data_list,
0159 const T_StepperCreator &stepper_creator) {
0160 GeometryContext geoCtx;
0161 MagneticFieldContext magFieldContext;
0162
0163 for (const auto &test_data : test_data_list) {
0164
0165 std::shared_ptr<MagneticFieldProvider> bField =
0166 std::dynamic_pointer_cast<MagneticFieldProvider>(
0167 std::make_shared<ConstantBField>(test_data.bfield));
0168
0169
0170 const Vector3 &surface_center = test_data.surface_center;
0171 const SquareMatrix3 &surface_rot = test_data.surface_rot;
0172 const BoundVector ¶m_vec = test_data.param_vec;
0173 const BoundSquareMatrix &cov = test_data.param_cov;
0174
0175 AngleAxis3 surface_transform0;
0176 surface_transform0 = surface_rot;
0177
0178 std::shared_ptr<Surface> surface;
0179 switch (test_data.surface_type) {
0180 case TestData::kPlane: {
0181 surface = std::dynamic_pointer_cast<Surface>(
0182 Surface::makeShared<PlaneSurface>(Translation3(surface_center) *
0183 surface_transform0));
0184 break;
0185 }
0186 case TestData::kPolarDisk: {
0187 surface =
0188 std::dynamic_pointer_cast<Surface>(Surface::makeShared<DiscSurface>(
0189 Translation3(surface_center) * surface_transform0));
0190 break;
0191 }
0192 default: {
0193 throw std::runtime_error("Unhandled surface type.");
0194 std::abort();
0195 }
0196 }
0197
0198 Vector3 direction{std::cos(param_vec[2]) * std::sin(param_vec[3]),
0199 std::sin(param_vec[2]) * std::sin(param_vec[3]),
0200 std::cos(param_vec[3])};
0201 Vector3 position(surface->localToGlobal(
0202 geoCtx, Vector2{param_vec[0], param_vec[1]}, direction));
0203 BoundTrackParameters params(surface, param_vec,
0204 std::optional<BoundSquareMatrix>(cov),
0205 ParticleHypothesis::pion());
0206
0207
0208
0209
0210 for (unsigned int i = 0; i < 4; ++i) {
0211 MagneticFieldProvider::Cache cache = bField->makeCache(magFieldContext);
0212
0213 Result<Vector3> local_bfield = bField->getField(position, cache);
0214 assert(local_bfield.ok());
0215
0216 auto path_length_derivatives = computeFreeToPathDerivatives(
0217 direction, params.parameters()[eBoundQOverP], local_bfield.value(),
0218 ParticleHypothesis::pion());
0219 MSG_DEBUG("derivatives : " << path_length_derivatives);
0220
0221
0222 BoundMatrix b2c;
0223 FreeToBoundMatrix freeToBoundJacobian;
0224 detail::boundToCurvilinearTransportJacobian(
0225 direction, surface->boundToFreeJacobian(geoCtx, position, direction),
0226 FreeMatrix::Identity(), freeToBoundJacobian,
0227 computeFreeToPathDerivatives(
0228 direction, params.parameters()[eBoundQOverP],
0229 local_bfield.value(), ParticleHypothesis::pion()),
0230 b2c);
0231
0232 auto curvi_cov_alt = b2c * cov * b2c.transpose();
0233
0234 MSG_DEBUG("curvilinear covariance alt.:" << std::endl << curvi_cov_alt);
0235
0236 auto stepper = stepper_creator(bField);
0237 MSG_DEBUG("Stepper type " << typeid(stepper).name());
0238
0239 using Stepper = decltype(stepper);
0240 using Propagator = Propagator<Stepper>;
0241 using PropagatorOptions = typename Propagator::template Options<>;
0242
0243
0244 PropagatorOptions null_propagation_options(geoCtx, magFieldContext);
0245
0246 null_propagation_options.pathLimit =
0247 i == 0 ? 0 : 1e-12 * 1_m * std::pow(10, i - 1);
0248 if (null_propagation_options.pathLimit > 0 && i > 1) {
0249 null_propagation_options.stepping.stepTolerance =
0250 null_propagation_options.pathLimit * .99;
0251 null_propagation_options.surfaceTolerance =
0252 null_propagation_options.pathLimit * .99;
0253 }
0254
0255 auto log_level =
0256 (isDebugOutputEnabled() ? Logging::VERBOSE : Logging::INFO);
0257
0258
0259
0260 Propagator propagator(std::move(stepper), VoidNavigator(),
0261 getDefaultLogger("Propagator", log_level));
0262 auto result =
0263 propagator.propagate(params, null_propagation_options, true);
0264 {
0265 const auto &curvilinear_parameters = result.value().endParameters;
0266 if (curvilinear_parameters.has_value() &&
0267 curvilinear_parameters.value().covariance().has_value()) {
0268 MSG_DEBUG(i << " | "
0269 << "limit: " << null_propagation_options.pathLimit
0270 << " tolerance: "
0271 << null_propagation_options.stepping.stepTolerance
0272 << std::endl);
0273
0274 BoundSquareMatrix curvi_cov =
0275 curvilinear_parameters.value().covariance().value();
0276 MSG_DEBUG("curvilinear covariance:" << std::endl
0277 << curvi_cov << std::endl);
0278 if (isDebugOutputEnabled()) {
0279 BoundSquareMatrix b(curvi_cov_alt);
0280 auto ratio = matrixRatio(curvi_cov, b);
0281 MSG_DEBUG("ratio:" << std::endl << ratio << std::endl);
0282 }
0283
0284
0285 BOOST_CHECK(curvi_cov_alt.isApprox(curvi_cov));
0286 }
0287 }
0288 }
0289 }
0290 }
0291
0292 std::vector<TestData> make_test_data(double mag_field_scale = 1.) {
0293 std::vector<TestData> test_data_list{
0294 TestData(
0295 makeVector<double, 3>(
0296 {-442.883, -624.094, 857.272}),
0297 makeMatrix<double, 3, 3>({0.677197, 0.0176111, -0.735591, -0.735342,
0298 -0.0191232, -0.677426, -0.0259971, 0.999662,
0299 -2.22045e-16}),
0300 TestData::kPlane,
0301 makeVector<double, eBoundSize>({46.5758, 4.5564, -2.38067, 0.72974,
0302 0.73159, 1163.57}),
0303 makeMatrix<double, eBoundSize, eBoundSize>(
0304 {0.00025406, 0.00334274, 2.9713e-06, -6.40317e-06,
0305 2.52229e-05, 0.00291208, 0.00334274, 9.77017,
0306 0.00109081, -0.0106064, -0.00340842, 7.25206,
0307 2.9713e-06, 0.00109081, 4.86984e-07, -1.68459e-06,
0308 2.0707e-06, 0.000848693, -6.40317e-06, -0.0106064,
0309 -1.68459e-06, 1.58516e-05, 4.40043e-06, -0.00786289,
0310 2.52229e-05, -0.00340842, 2.0707e-06, 4.40043e-06,
0311 2.786e-05, -0.00210611, 0.00291208, 7.25206,
0312 0.000848693, -0.00786289, -0.00210611, 89880.9}),
0313 makeVector<double, 3>({-2.64634e-05 * 1000_T, -4.38183e-05 * 1000_T,
0314 0.00197353 * 1000_T})),
0315
0316 TestData(
0317 makeVector<double, 3>(
0318 {-215.895, 979.521, 808.928}),
0319 makeMatrix<double, 3, 3>(
0320 {-0.999319, -0.0259882, -0.0261772, -0.0261683, -0.00068053,
0321 0.999657, -0.0259971, 0.999662, -2.22045e-16}),
0322 TestData::kPlane,
0323 makeVector<double, eBoundSize>({-47.2414, -20.7881, 1.46297, 0.926114,
0324 0.723167, 1318.63}),
0325 makeMatrix<double, eBoundSize, eBoundSize>(
0326 {0.000299382, -0.00331811, -9.93116e-06,
0327 4.79934e-06, 9.50183e-06, -0.00184948,
0328 -0.00331811, 0.212531, -3.5517e-05,
0329 -0.00030374, 3.77471e-05, 0.129021,
0330 -9.93116e-06, -3.5517e-05, 1.26087e-06,
0331 2.63359e-08, -1.11054e-06, -4.07474e-05,
0332 4.79934e-06, -0.00030374, 2.63359e-08,
0333 2.42802e-06, 1.77196e-07, -0.000180912,
0334 9.50183e-06, 3.77471e-05, -1.11054e-06,
0335 1.77196e-07, 2.13352e-05, 0.000394159,
0336 -0.00184948, 0.129021, -4.07474e-05,
0337 -0.000180912, 0.000394159, 89875.6}),
0338 makeVector<double, 3>({-7.28154e-06 * 1000_T, 4.91679e-05 * 1000_T,
0339 0.00200021 * 1000_T})),
0340
0341 TestData(
0342 makeVector<double, 3>({-100.1, 9.9476e-14, 2623}),
0343 makeMatrix<double, 3, 3>({-9.4369e-16, -1, -2.22045e-16, -1,
0344 9.4369e-16, 2.09541e-31, 0, 2.22045e-16,
0345 -1}),
0346 TestData::kPlane,
0347 makeVector<double, eBoundSize>({5.1223, 16.6267, -3.08166, 0.0439704,
0348 -0.0358564, 2625.58}),
0349 makeMatrix<double, eBoundSize, eBoundSize>(
0350 {0.00017846, 6.32301e-09, 1.31319e-05,
0351 3.28335e-08, -1.37002e-07, 6.412e-07,
0352 6.32301e-09, 0.000178573, -7.46352e-07,
0353 5.77821e-07, 1.22545e-08, 7.82577e-06,
0354 1.31319e-05, -7.46352e-07, 4.27034e-05,
0355 -2.44549e-13, -2.98712e-09, 5.95667e-09,
0356 3.28335e-08, 5.77821e-07, -2.44549e-13,
0357 8.26179e-08, 8.02087e-11, 2.53174e-08,
0358 -1.37002e-07, 1.22545e-08, -2.98712e-09,
0359 8.02087e-11, 1.36315e-06, -1.7853e-06,
0360 6.412e-07, 7.82577e-06, 5.95667e-09,
0361 2.53174e-08, -1.7853e-06, 89875.5}),
0362 makeVector<double, 3>({-5.04066e-05 * 1000_T, -1.84572e-06 * 1000_T,
0363 0.00107321 * 1000_T})),
0364
0365 TestData(
0366 makeVector<double, 3>(
0367 {-2.79072, 18.1615, 1962.71}),
0368 makeMatrix<double, 3, 3>(
0369 {-0.986831, -0.161755, -2.38917e-17, -0.161755, 0.986831,
0370 -2.35312e-18, 2.39577e-17, 1.54245e-18, -1}),
0371 TestData::kPolarDisk,
0372 makeVector<double, eBoundSize>({874.522, -0.0199525, -2.87012,
0373 0.412785, -0.218474,
0374 2144.77}),
0375 makeMatrix<double, eBoundSize, eBoundSize>(
0376 {0.268052, 6.23529e-06, -2.89316e-05,
0377 0.000334472, 6.69436e-06, 0.107219,
0378 6.23529e-06, 4.51554e-10, -5.00139e-09,
0379 7.5944e-09, 1.32896e-09, 2.47693e-06,
0380 -2.89316e-05, -5.00139e-09, 1.10493e-06,
0381 -8.28542e-08, -1.11202e-07, -1.05201e-05,
0382 0.000334472, 7.5944e-09, -8.28542e-08,
0383 7.43596e-07, 3.40043e-08, 0.00013338,
0384 6.69436e-06, 1.32896e-09, -1.11202e-07,
0385 3.40043e-08, 2.28008e-06, -1.3933e-05,
0386 0.107219, 2.47693e-06, -1.05201e-05,
0387 0.00013338, -1.3933e-05, 89875.6}),
0388 makeVector<double, 3>({-0.000238594 * 1000_T, -3.95897e-05 * 1000_T,
0389 0.00170904 * 1000_T})),
0390
0391 TestData(
0392 makeVector<double, 3>(
0393 {-1.04461, -18.345, -2232.72}),
0394 makeMatrix<double, 3, 3>(
0395 {-0.997764, 0.0668313, 1.22465e-16, 0.0668313, 0.997764,
0396 1.22465e-16, -1.14006e-16, 1.30375e-16, -1}),
0397 TestData::kPolarDisk,
0398 makeVector<double, eBoundSize>({919.923, -0.0334805, 3.06771, 2.75516,
0399 0.106936, 2410.21}),
0400 makeMatrix<double, eBoundSize, eBoundSize>(
0401 {0.249495, -5.22193e-06, -3.13362e-06,
0402 -0.000237539, -8.44559e-08, 0.0938443,
0403 -5.22193e-06, 4.17316e-10, -3.62456e-09,
0404 4.90101e-09, 2.09791e-10, -1.95858e-06,
0405 -3.13362e-06, -3.62456e-09, 9.69964e-07,
0406 -1.38253e-08, -2.38732e-08, -1.43246e-06,
0407 -0.000237539, 4.90101e-09, -1.38253e-08,
0408 4.54156e-07, 3.99992e-09, -8.93313e-05,
0409 -8.44559e-08, 2.09791e-10, -2.38732e-08,
0410 3.99992e-09, 5.6852e-07, 4.62431e-06,
0411 0.0938443, -1.95858e-06, -1.43246e-06,
0412 -8.93313e-05, 4.62431e-06, 89875.6}),
0413 makeVector<double, 3>({0.00036598 * 1000_T, -5.73626e-06 * 1000_T,
0414 0.0015599 * 1000_T})),
0415
0416 TestData(
0417 makeVector<double, 3>({2.25897, 16.0914, 1962.71}),
0418 makeMatrix<double, 3, 3>({-0.99163, 0.129111, 2.38917e-17, 0.129111,
0419 0.99163, -2.35312e-18, -2.39955e-17,
0420 7.51254e-19, -1}),
0421 TestData::kPolarDisk,
0422 makeVector<double, eBoundSize>({855.523, -0.00206235, 2.78002,
0423 0.430255, 0.430811,
0424 2164.93}),
0425 makeMatrix<double, eBoundSize, eBoundSize>(
0426 {0.46359, 9.75743e-06, 0.000448092,
0427 0.000688107, -0.000233571, 0.188268,
0428 9.75743e-06, 6.10067e-10, -4.97007e-10,
0429 1.52396e-08, 3.93299e-09, 4.13675e-06,
0430 0.000448092, -4.97007e-10, 4.44146e-06,
0431 8.69542e-07, -2.28873e-06, 0.00014712,
0432 0.000688107, 1.52396e-08, 8.69542e-07,
0433 2.0094e-06, -8.25987e-07, 0.000271189,
0434 -0.000233571, 3.93299e-09, -2.28873e-06,
0435 -8.25987e-07, 4.58208e-05, 0.000645024,
0436 0.188268, 4.13675e-06, 0.00014712,
0437 0.000271189, 0.000645024, 89875.6}),
0438 makeVector<double, 3>({-0.000235096 * 1000_T, 3.37809e-05 * 1000_T,
0439 0.00170337 * 1000_T})),
0440
0441 TestData(
0442 makeVector<double, 3>(
0443 {-956.977, -300.445, -563.272}),
0444 makeMatrix<double, 3, 3>({0.113165, 0.00294296, -0.993572, -0.993236,
0445 -0.02583, -0.113203, -0.0259971, 0.999662,
0446 -9.95799e-17}),
0447 TestData::kPlane,
0448 makeVector<double, eBoundSize>({43.1027, -20.0508, -2.58378, 2.04794,
0449 -0.61896, 1281.4}),
0450 makeMatrix<double, eBoundSize, eBoundSize>(
0451 {0.000415869, -0.00624916, 4.30188e-06,
0452 1.11988e-05, -8.34103e-07, 0.00297658,
0453 -0.00624916, 0.287414, 0.000262654,
0454 -0.000530088, -1.45312e-05, -0.131126,
0455 4.30188e-06, 0.000262654, 2.57536e-06,
0456 -4.80124e-07, -2.45959e-07, -0.000110478,
0457 1.11988e-05, -0.000530088, -4.80124e-07,
0458 3.87906e-06, 6.73799e-08, 0.0002415,
0459 -8.34103e-07, -1.45312e-05, -2.45959e-07,
0460 6.73799e-08, 4.23156e-06, -4.9642e-05,
0461 0.00297658, -0.131126, -0.000110478,
0462 0.0002415, -4.9642e-05, 89875.6}),
0463 makeVector<double, 3>({3.50239e-05 * 1000_T, 1.16125e-05 * 1000_T,
0464 0.00201393 * 1000_T})),
0465
0466 TestData(
0467 makeVector<double, 3>(
0468 {-14.6729, -11.0605, 2860.72}),
0469 makeMatrix<double, 3, 3>(
0470 {0.609896, -0.792481, -1.01826e-16, -0.792481, -0.609896,
0471 -1.90502e-16, 8.88665e-17, 1.96882e-16, -1}),
0472 TestData::kPolarDisk,
0473 makeVector<double, eBoundSize>({878.179, 0.0377489, -0.917117,
0474 0.298851, -0.155266,
0475 2993.62}),
0476 makeMatrix<double, eBoundSize, eBoundSize>(
0477 {0.247492, 5.75149e-06, -7.25055e-06,
0478 0.000186384, 2.26831e-05, 0.0724092,
0479 5.75149e-06, 4.34292e-10, -3.3005e-09,
0480 4.28514e-09, 1.10915e-10, 1.68264e-06,
0481 -7.25055e-06, -3.3005e-09, 5.13085e-07,
0482 -2.15014e-08, 1.38502e-07, -3.13833e-06,
0483 0.000186384, 4.28514e-09, -2.15014e-08,
0484 2.64484e-07, 4.58027e-08, 5.43642e-05,
0485 2.26831e-05, 1.10915e-10, 1.38502e-07,
0486 4.58027e-08, 5.0017e-06, -3.05689e-05,
0487 0.0724092, 1.68264e-06, -3.13833e-06,
0488 5.43642e-05, -3.05689e-05, 89875.5}),
0489 makeVector<double, 3>({0.000246188 * 1000_T, -0.000361053 * 1000_T,
0490 0.000756348 * 1000_T})),
0491
0492 TestData(
0493 makeVector<double, 3>({-748.018, 127.04, 1249.27}),
0494 makeMatrix<double, 3, 3>({-0.368695, 0.00958824, -0.929501, -0.929187,
0495 0.0241643, 0.36882, 0.0259971, 0.999662,
0496 -2.22045e-16}),
0497 TestData::kPlane,
0498 makeVector<double, eBoundSize>({-12.7967, -0.0111021, 2.81269,
0499 0.548845, 0.365828,
0500 1466.51}),
0501 makeMatrix<double, eBoundSize, eBoundSize>(
0502 {0.000407068, 0.00585003, -5.06759e-06, -1.4351e-06, 3.49367e-07,
0503 0.00501982, 0.00585003, 0.220933, -5.8514e-05, 7.21617e-06,
0504 3.69039e-05, 0.189194, -5.06759e-06, -5.8514e-05, 6.93556e-07,
0505 3.87361e-07, 2.09743e-07, -4.8068e-05, -1.4351e-06, 7.21617e-06,
0506 3.87361e-07, 1.61864e-06, -3.89113e-08, 5.41601e-06, 3.49367e-07,
0507 3.69039e-05, 2.09743e-07, -3.89113e-08, 3.38809e-06, 6.8792e-05,
0508 0.00501982, 0.189194, -4.8068e-05, 5.41601e-06, 6.8792e-05,
0509 89875.7}),
0510 makeVector<double, 3>({-8.32767e-05 * 1000_T, 1.42907e-05 * 1000_T,
0511 0.00191073 * 1000_T})),
0512
0513 TestData(
0514 makeVector<double, 3>(
0515 {-522.319, -215.962, 1139.19}),
0516 makeMatrix<double, 3, 3>({0.182174, 0.00473759, -0.983255, -0.982923,
0517 -0.0255617, -0.182236, -0.0259971, 0.999662,
0518 -2.22045e-16}),
0519 TestData::kPlane,
0520 makeVector<double, eBoundSize>({-15.9238, -9.71785, -2.58798,
0521 0.458544, -0.490701,
0522 1263.01}),
0523 makeMatrix<double, eBoundSize, eBoundSize>(
0524 {0.000388298, -0.00663415, -4.45582e-06, -2.98583e-06,
0525 -1.79271e-07, -0.00594178, -0.00663415, 0.28281,
0526 0.000192569, 3.50465e-05, 4.73666e-05, 0.253947,
0527 -4.45582e-06, 0.000192569, 4.58913e-07, -3.91615e-07,
0528 3.05147e-07, 0.000170095, -2.98583e-06, 3.50465e-05,
0529 -3.91615e-07, 9.06356e-07, 1.00807e-08, 3.10251e-05,
0530 -1.79271e-07, 4.73666e-05, 3.05147e-07, 1.00807e-08,
0531 3.51684e-06, 4.83158e-06, -0.00594178, 0.253947,
0532 0.000170095, 3.10251e-05, 4.83158e-06, 89875.7}),
0533 makeVector<double, 3>({-5.25166e-05 * 1000_T, -2.12894e-05 * 1000_T,
0534 0.00191577 * 1000_T})),
0535
0536 TestData(
0537 makeVector<double, 3>({889.91, 463.263, 269.272}),
0538 makeMatrix<double, 3, 3>({-0.28392, -0.00738357, 0.95882, 0.958496,
0539 0.0249265, 0.284016, -0.0259971, 0.999662,
0540 -2.22045e-16}),
0541 TestData::kPlane,
0542 makeVector<double, eBoundSize>({-31.3391, 22.7156, 0.668348, 1.23223,
0543 -0.672912, 887.012}),
0544 makeMatrix<double, eBoundSize, eBoundSize>(
0545 {0.000401596, -0.00580898, 3.84845e-06,
0546 1.07378e-05, -7.00551e-06, -0.00176611,
0547 -0.00580898, 0.260857, 0.000203293,
0548 -0.000491391, 1.75445e-05, 0.0869615,
0549 3.84845e-06, 0.000203293, 2.13361e-06,
0550 -3.99989e-07, -1.30627e-06, 8.83175e-05,
0551 1.07378e-05, -0.000491391, -3.99989e-07,
0552 3.41664e-06, 1.46081e-07, -0.000166376,
0553 -7.00551e-06, 1.75445e-05, -1.30627e-06,
0554 1.46081e-07, 2.06909e-05, -0.000261632,
0555 -0.00176611, 0.0869615, 8.83175e-05,
0556 -0.000166376, -0.000261632, 89875.6}),
0557 makeVector<double, 3>({1.43009e-05 * 1000_T, 7.04031e-06 * 1000_T,
0558 0.00202663 * 1000_T}))
0559
0560 };
0561 if (mag_field_scale != 1.) {
0562 for (TestData &test_data : test_data_list) {
0563 test_data.bfield *= mag_field_scale;
0564 }
0565 }
0566 return test_data_list;
0567 }
0568
0569 BOOST_AUTO_TEST_SUITE(PropagatorSuite)
0570
0571 BOOST_AUTO_TEST_CASE(BoundToCurvilinearEigenStepper) {
0572
0573
0574 std::vector<TestData> test_data_list(make_test_data());
0575 test_bound_to_curvilinear(
0576 test_data_list, [](const std::shared_ptr<MagneticFieldProvider> &bField) {
0577 return EigenStepper<>(bField);
0578 });
0579 }
0580
0581 BOOST_AUTO_TEST_CASE(BoundToCurvilinearStraightLineStepper) {
0582
0583
0584 std::vector<TestData> test_data_list(
0585 make_test_data(0.));
0586 test_bound_to_curvilinear(
0587 test_data_list,
0588 []([[maybe_unused]] const std::shared_ptr<MagneticFieldProvider>
0589 &bField) { return StraightLineStepper(); });
0590 }
0591
0592 BOOST_AUTO_TEST_SUITE_END()
0593
0594 }