9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
23 namespace utf = boost::unit_test;
34 BOOST_AUTO_TEST_SUITE(Surfaces)
43 const double radius{2.0}, halfz{20.};
48 auto pLineBounds = std::make_shared<const LineBounds>(2., 10.0);
68 "All LineSurface constructors are callable without problem");
76 Vector3D referencePosition{0., 1., 2.};
81 auto pLineBounds = std::make_shared<const LineBounds>(2., 10.0);
85 BOOST_CHECK_EQUAL(bounds,
LineBounds(2., 10.0));
91 const Vector2D expectedResult{0, -2};
95 const Vector3D direction{0., 1., 2.};
99 BOOST_CHECK(
bool(sfIntersection));
100 Vector3D expectedIntersection(0, 1., 2.);
101 CHECK_CLOSE_ABS(sfIntersection.intersection.position, expectedIntersection,
103 BOOST_CHECK_EQUAL(sfIntersection.object, &line);
106 const Vector3D insidePosition{0., 2.5, 0.};
109 const Vector3D outsidePosition{100., 100., 200.};
113 Vector3D returnedGlobalPosition{0., 0., 0.};
116 returnedGlobalPosition =
118 const Vector3D expectedGlobalPosition{0, 1, 0};
122 Vector3D globalPosition{0., 0., 0.};
123 auto returnedRotationMatrix =
125 double v0 =
std::cos(std::atan(2. / 3.));
126 double v1 = std::sin(std::atan(2. / 3.));
128 expectedRotationMatrix << -
v1, 0., v0, v0, 0.,
v1, 0., 1., -0.;
135 boost::test_tools::output_test_stream output;
136 output << line.
name();
137 BOOST_CHECK(output.is_equal(
"Acts::LineSurface"));
144 auto any3DVector = normalVector;
154 BOOST_CHECK(assignedLine != originalLine);
155 assignedLine = originalLine;
156 BOOST_CHECK(assignedLine == originalLine);
165 const auto& rotation = transform.rotation();
167 const Vector3D localZAxis = rotation.col(2);
178 const auto& [rotToLocalXAxis, rotToLocalYAxis, rotToLocalZAxis] =
183 tgContext, rotToLocalZAxis, globalPosition, direction);
186 const double value = std::sqrt(3) / 2;
193 const auto& loc3DToLocBound =
197 LocalCartesianToBoundLocalMatrix::Zero();
198 expLoc3DToLocBound << 1 / std::sqrt(2), 1 / std::sqrt(2), 0, 0, 0, 1;
202 BOOST_AUTO_TEST_SUITE_END()