EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PropagationCompareEigenStraightLine.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PropagationCompareEigenStraightLine.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
11 
18 
19 #include <limits>
20 
21 #include "PropagationDatasets.hpp"
22 #include "PropagationTests.hpp"
23 
24 namespace {
25 
26 namespace ds = ActsTests::PropagationDatasets;
27 using namespace Acts::UnitLiterals;
28 
29 using MagneticField = Acts::ConstantBField;
32 using StraightLineStepper = Acts::StraightLineStepper;
34 
35 // absolute parameter tolerances for position, direction, and absolute momentum
36 constexpr auto epsPos = 1_um;
37 constexpr auto epsDir = 0.125_mrad;
38 constexpr auto epsMom = 1_eV;
39 // relative covariance tolerance
40 constexpr auto epsCov = 0.00125;
41 
42 constexpr auto bz = 2_T;
43 
46 const MagneticField magFieldZero(Acts::Vector3D::Zero());
47 const MagneticField magFieldNonZero(Acts::Vector3D::UnitZ() * bz);
48 const EigenPropagator eigenPropagatorZero{EigenStepper(magFieldZero)};
49 const EigenPropagator eigenPropagatorNonZero{EigenStepper(magFieldNonZero)};
50 const StraightLinePropagator straightPropagator{StraightLineStepper()};
51 
52 } // namespace
53 
54 BOOST_AUTO_TEST_SUITE(PropagationCompareEigenStraightLine)
55 
56 // TODO both the eigen stepper and the straight line stepper do not seem to
57 // handle the neutral parameters correctly. the results contain inf/nan.
58 // fix the propagators and re-enable the tests.
59 
60 // BOOST_DATA_TEST_CASE(NeutralZeroMagneticField,
61 // ds::phi* ds::theta* ds::absMomentum* ds::pathLength,
62 // phi, theta, p, s) {
63 // runFreePropagationComparisonTest(
64 // eigenPropagatorZero, straightPropagator, geoCtx, magCtx,
65 // makeParametersCurvilinearNeutral(phi, theta, p), s, epsPos, epsDir,
66 // epsMom, epsCov);
67 // }
68 
69 // BOOST_DATA_TEST_CASE(NeutralNonZeroMagneticField,
70 // ds::phi* ds::theta* ds::absMomentum* ds::pathLength,
71 // phi, theta, p, s) {
72 // runFreePropagationComparisonTest(
73 // eigenPropagatorNonZero, straightPropagator, geoCtx, magCtx,
74 // makeParametersCurvilinearNeutral(phi, theta, p), s, epsPos, epsDir,
75 // epsMom, epsCov);
76 // }
77 
79  ChargedZeroMagneticField,
80  ds::phi* ds::theta* ds::absMomentum* ds::chargeNonZero* ds::pathLength, phi,
81  theta, p, q, s) {
82  runForwardComparisonTest(eigenPropagatorZero, straightPropagator, geoCtx,
83  magCtx, makeParametersCurvilinear(phi, theta, p, q),
84  s, epsPos, epsDir, epsMom, epsCov);
85 }
86 
87 // TODO add comparison tests between the straight line and eigen propagator for
88 // a charged particle w/ infinite momentum in a non-zero magnetic field.
89 // these should be identical. requires proper handling of q/p=0 in the
90 // track parameters.
91 
92 BOOST_AUTO_TEST_SUITE_END()