9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/old/interface.hpp>
11 #include <boost/test/tools/output_test_stream.hpp>
12 #include <boost/test/unit_test.hpp>
47 namespace utf = boost::unit_test;
50 class AssertionFailureException;
59 BOOST_AUTO_TEST_SUITE(Surfaces)
69 const double radius{2.0}, halfz{20.};
70 BOOST_CHECK(
LineSurfaceStub(pTransform, radius, halfz).constructedOk());
74 auto pLineBounds = std::make_shared<const LineBounds>(2., 10.0);
94 "All LineSurface constructors are callable without problem");
103 Vector3 referencePosition{0., 1., 2.};
108 auto pLineBounds = std::make_shared<const LineBounds>(2., 10.0);
112 BOOST_CHECK_EQUAL(bounds,
LineBounds(2., 10.0));
116 const Vector3 mom{20., 0., 0.};
119 const Vector2 expectedResult{0, -2};
123 const Vector3 direction{0., 1., 2.};
125 auto sfIntersection =
128 BOOST_CHECK(sfIntersection);
129 Vector3 expectedIntersection(0, 1., 2.);
132 BOOST_CHECK_EQUAL(sfIntersection.object(), &
line);
135 const Vector3 insidePosition{0., 2.5, 0.};
138 const Vector3 outsidePosition{100., 100., 200.};
142 Vector3 returnedGlobalPosition{0., 0., 0.};
145 returnedGlobalPosition =
147 const Vector3 expectedGlobalPosition{0, 1, 0};
151 Vector3 globalPosition{0., 0., 0.};
152 auto returnedRotationMatrix =
154 double v0 = std::cos(std::atan(2. / 3.));
155 double v1 = std::sin(std::atan(2. / 3.));
157 expectedRotationMatrix << -
v1, 0., v0, v0, 0.,
v1, 0., 1., -0.;
164 boost::test_tools::output_test_stream
output;
165 output << line.
name();
166 BOOST_CHECK(output.is_equal(
"Acts::LineSurface"));
183 BOOST_CHECK(assignedLine != originalLine);
184 assignedLine = originalLine;
185 BOOST_CHECK(assignedLine == originalLine);
194 const auto& rotation = transform.rotation();
196 const Vector3 localZAxis = rotation.col(2);
201 Vector3 globalPosition{1, 2, 4};
206 parameters.head<3>() = globalPosition;
207 parameters.segment<3>(
eFreeDir0) = direction;
214 const double value = std::sqrt(3) / 2;
221 const auto& loc3DToLocBound =
225 expLoc3DToLocBound << 1 / std::sqrt(2), 1 / std::sqrt(2), 0, 0, 0, 1;
234 Vector3 global = intersection.position();
241 Vector3 pos = {-0.02801, 0.00475611, 0.285106};
242 Vector3 dir =
Vector3(-0.03951, -0.221457, -0.564298).normalized();
244 auto [global, local, global2] = roundTrip(pos, dir);
250 Vector3 pos = {-64.2892, 65.2697, -0.839014};
251 Vector3 dir =
Vector3(-0.236602, -0.157616, 0.956786).normalized();
253 auto [global, local, global2] = roundTrip(pos, dir);
263 const std::vector<double>
etas = {0, 1, 2, 3, 4, 5};
265 for (
double eta : etas) {
272 Vector3 global = intersection.position();
282 using namespace Acts::UnitLiterals;
290 double pathLimit = 1_cm;
292 auto surface = std::make_shared<LineSurfaceStub>(Transform3::Identity());
300 Vector4::Zero(), Vector3::Zero(), 1, std::nullopt,
307 auto result = propagator.propagate(initialParams,
options);
308 BOOST_CHECK(result.ok());
309 BOOST_CHECK(result.value().endParameters);
311 displacedParameters = result.value().endParameters.value();
317 displacedParameters.direction())
328 auto result = propagator.propagate(displacedParameters, *
surface,
options);
329 BOOST_CHECK(result.ok());
330 BOOST_CHECK(result.value().endParameters);
332 endParameters = result.value().endParameters.value();
338 BOOST_AUTO_TEST_SUITE_END()