EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PropagationStraightLine.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PropagationStraightLine.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 
17 
18 #include <limits>
19 
20 #include "PropagationDatasets.hpp"
21 #include "PropagationTests.hpp"
22 
23 namespace {
24 
25 namespace ds = ActsTests::PropagationDatasets;
26 using namespace Acts::UnitLiterals;
27 
30 using RiddersPropagator = Acts::RiddersPropagator<Propagator>;
31 
32 // absolute parameter tolerances for position, direction, and absolute momentum
33 constexpr auto epsPos = 1_um;
34 constexpr auto epsDir = 0.125_mrad;
35 constexpr auto epsMom = 1_eV;
36 // relative covariance tolerance
37 constexpr auto epsCov = 0.0125;
38 
41 const Stepper stepper;
42 const Propagator propagator(stepper);
43 const RiddersPropagator riddersPropagator(stepper);
44 
45 } // namespace
46 
47 BOOST_AUTO_TEST_SUITE(PropagationStraightLine)
48 
49 // check that the propagation is reversible and self-consistent
50 
52  ForwardBackward,
53  ds::phi* ds::theta* ds::absMomentum* ds::chargeNonZero* ds::pathLength, phi,
54  theta, p, q, s) {
56  makeParametersCurvilinear(phi, theta, p, q), s, epsPos,
57  epsDir, epsMom);
58 }
59 
60 // check that reachable surfaces are correctly reached
61 
62 // True forward/backward tracks do not work with z cylinders
63 BOOST_DATA_TEST_CASE(ToCylinderAlongZ,
66  phi, theta, p, q, s) {
67  runToSurfaceTest(propagator, geoCtx, magCtx,
69  ZCylinderSurfaceBuilder(), epsPos, epsDir, epsMom);
70 }
71 
73  ToDisc,
75  theta, p, q, s) {
76  runToSurfaceTest(propagator, geoCtx, magCtx,
78  DiscSurfaceBuilder(), epsPos, epsDir, epsMom);
79 }
80 
82  ToPlane,
84  theta, p, q, s) {
85  runToSurfaceTest(propagator, geoCtx, magCtx,
87  PlaneSurfaceBuilder(), epsPos, epsDir, epsMom);
88 }
89 
90 // True forward/backward tracks do not work with z straws
91 BOOST_DATA_TEST_CASE(ToStrawAlongZ,
94  phi, theta, p, q, s) {
95  runToSurfaceTest(propagator, geoCtx, magCtx,
97  ZStrawSurfaceBuilder(), epsPos, epsDir, epsMom);
98 }
99 
100 // check covariance transport using the ridders propagator for comparison
101 
103  CovarianceCurvilinear,
105  theta, p, q, s) {
107  propagator, riddersPropagator, geoCtx, magCtx,
109  epsDir, epsMom, epsCov);
110 }
111 
112 BOOST_DATA_TEST_CASE(CovarianceToCylinderAlongZ,
115  phi, theta, p, q, s) {
117  propagator, riddersPropagator, geoCtx, magCtx,
119  ZCylinderSurfaceBuilder(), epsPos, epsDir, epsMom, epsCov);
120 }
121 
122 BOOST_DATA_TEST_CASE(CovarianceToDisc,
125  phi, theta, p, q, s) {
127  propagator, riddersPropagator, geoCtx, magCtx,
129  DiscSurfaceBuilder(), epsPos, epsDir, epsMom, epsCov);
130 }
131 
133  CovarianceToPlane,
135  theta, p, q, s) {
137  propagator, riddersPropagator, geoCtx, magCtx,
139  PlaneSurfaceBuilder(), epsPos, epsDir, epsMom, epsCov);
140 }
141 
142 BOOST_DATA_TEST_CASE(CovarianceToStrawAlongZ,
145  phi, theta, p, q, s) {
146  // the numerical covariance transport to straw surfaces does not seem to be
147  // stable. use a higher tolerance for now.
149  propagator, riddersPropagator, geoCtx, magCtx,
151  ZStrawSurfaceBuilder(), epsPos, epsDir, epsMom, 0.125);
152 }
153 
154 BOOST_AUTO_TEST_SUITE_END()