Analysis Software
Documentation for sPHENIX simulation 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 
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 auto magFieldZero =
47  std::make_shared<MagneticField>(Acts::Vector3::Zero());
48 const auto magFieldNonZero =
49  std::make_shared<MagneticField>(Acts::Vector3::UnitZ() * bz);
50 const EigenPropagator eigenPropagatorZero{EigenStepper(magFieldZero)};
51 const EigenPropagator eigenPropagatorNonZero{EigenStepper(magFieldNonZero)};
52 const StraightLinePropagator straightPropagator{StraightLineStepper()};
53 
54 } // namespace
55 
56 BOOST_AUTO_TEST_SUITE(PropagationCompareEigenStraightLine)
57 
58 // TODO both the eigen stepper and the straight line stepper do not seem to
59 // handle the neutral parameters correctly. the results contain inf/nan.
60 // fix the propagators and re-enable the tests.
61 
62 // BOOST_DATA_TEST_CASE(NeutralZeroMagneticField,
63 // ds::phi* ds::theta* ds::absMomentum* ds::pathLength,
64 // phi, theta, p, s) {
65 // runFreePropagationComparisonTest(
66 // eigenPropagatorZero, straightPropagator, geoCtx, magCtx,
67 // makeParametersCurvilinearNeutral(phi, theta, p), s, epsPos, epsDir,
68 // epsMom, epsCov);
69 // }
70 
71 // BOOST_DATA_TEST_CASE(NeutralNonZeroMagneticField,
72 // ds::phi* ds::theta* ds::absMomentum* ds::pathLength,
73 // phi, theta, p, s) {
74 // runFreePropagationComparisonTest(
75 // eigenPropagatorNonZero, straightPropagator, geoCtx, magCtx,
76 // makeParametersCurvilinearNeutral(phi, theta, p), s, epsPos, epsDir,
77 // epsMom, epsCov);
78 // }
79 
81  ChargedZeroMagneticField,
82  ds::phi* ds::theta* ds::absMomentum* ds::chargeNonZero* ds::pathLength, phi,
83  theta, p, q, s) {
84  runForwardComparisonTest(eigenPropagatorZero, straightPropagator, geoCtx,
85  magCtx, makeParametersCurvilinear(phi, theta, p, q),
86  s, epsPos, epsDir, epsMom, epsCov);
87 }
88 
89 // TODO add comparison tests between the straight line and eigen propagator for
90 // a charged particle w/ infinite momentum in a non-zero magnetic field.
91 // these should be identical. requires proper handling of q/p=0 in the
92 // track parameters.
93 
94 BOOST_AUTO_TEST_SUITE_END()