Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PropagationCompareAtlasAutodiffConstant.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PropagationCompareAtlasAutodiffConstant.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 
20 
21 #include <limits>
22 #include <utility>
23 
24 #include "../PropagationDatasets.hpp"
25 #include "../PropagationTests.hpp"
26 
27 namespace {
28 
29 namespace ds = ActsTests::PropagationDatasets;
30 using namespace Acts::UnitLiterals;
31 
33 using AtlasStepper = Acts::AtlasStepper;
34 using AtlasPropagator = Acts::Propagator<AtlasStepper>;
35 
36 using Extension =
38 using AutodiffStepper =
40 using AutodiffPropagator = Acts::Propagator<AutodiffStepper>;
41 
42 // absolute parameter tolerances for position, direction, and absolute momentum
43 constexpr auto epsPos = 1_um;
44 constexpr auto epsDir = 0.125_mrad;
45 constexpr auto epsMom = 1_eV;
46 // relative covariance tolerance
47 constexpr auto epsCov = 0.0125;
48 
51 
52 inline std::pair<AtlasPropagator, AutodiffPropagator> makePropagators(
53  double bz) {
54  auto field = std::make_shared<MagneticField>(Acts::Vector3(0.0, 0.0, bz));
55  return {AtlasPropagator(AtlasStepper(field)),
56  AutodiffPropagator(AutodiffStepper(field))};
57 }
58 
59 } // namespace
60 
61 BOOST_AUTO_TEST_SUITE(PropagationCompareAtlasEigenConstant)
62 
64  ds::phi* ds::theta* ds::absMomentum* ds::chargeNonZero*
65  ds::pathLength* ds::magneticField,
66  phi, theta, p, q, s, bz) {
67  auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
68  runForwardComparisonTest(atlasPropagator, eigenPropagator, geoCtx, magCtx,
69  makeParametersCurvilinear(phi, theta, p, q), s,
70  epsPos, epsDir, epsMom, epsCov);
71 }
72 
73 BOOST_DATA_TEST_CASE(ToCylinderAlongZ,
76  phi, theta, p, q, s, bz) {
77  auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
78  runToSurfaceComparisonTest(atlasPropagator, eigenPropagator, geoCtx, magCtx,
80  ZCylinderSurfaceBuilder(), epsPos, epsDir, epsMom,
81  epsCov);
82 }
83 
87  phi, theta, p, q, s, bz) {
88  auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
89  runToSurfaceComparisonTest(atlasPropagator, eigenPropagator, geoCtx, magCtx,
91  DiscSurfaceBuilder(), epsPos, epsDir, epsMom,
92  epsCov);
93 }
94 
98  phi, theta, p, q, s, bz) {
99  auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
100  runToSurfaceComparisonTest(atlasPropagator, eigenPropagator, geoCtx, magCtx,
102  PlaneSurfaceBuilder(), epsPos, epsDir, epsMom,
103  epsCov);
104 }
105 
106 BOOST_DATA_TEST_CASE(ToStrawAlongZ,
109  phi, theta, p, q, s, bz) {
110  auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
111  runToSurfaceComparisonTest(atlasPropagator, eigenPropagator, geoCtx, magCtx,
113  ZStrawSurfaceBuilder(), epsPos, epsDir, epsMom,
114  epsCov);
115 }
116 
117 BOOST_AUTO_TEST_SUITE_END()