9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
21 namespace tt = boost::test_tools;
22 using boost::test_tools::output_test_stream;
23 namespace utf = boost::unit_test;
32 BOOST_AUTO_TEST_SUITE(PlaneSurfaces)
37 auto rBounds = std::make_shared<const RectangleBounds>(3., 4.);
41 auto pTransform = std::make_shared<const Transform3D>(translation);
42 std::shared_ptr<const Transform3D> pNullTransform{};
45 Surface::makeShared<PlaneSurface>(pNullTransform, rBounds)->type(),
49 Surface::makeShared<PlaneSurface>(pTransform, rBounds)->type(),
52 auto planeSurfaceObject =
53 Surface::makeShared<PlaneSurface>(pTransform, rBounds);
54 auto copiedPlaneSurface =
55 Surface::makeShared<PlaneSurface>(*planeSurfaceObject);
57 BOOST_CHECK(*copiedPlaneSurface == *planeSurfaceObject);
60 auto copiedTransformedPlaneSurface = Surface::makeShared<PlaneSurface>(
61 tgContext, *planeSurfaceObject, *pTransform);
62 BOOST_CHECK_EQUAL(copiedTransformedPlaneSurface->type(),
Surface::Plane);
67 auto nullBounds = Surface::makeShared<PlaneSurface>(
nullptr, detElem),
74 auto rBounds = std::make_shared<const RectangleBounds>(3., 4.);
77 auto pTransform = std::make_shared<const Transform3D>(translation);
78 auto planeSurfaceObject =
79 Surface::makeShared<PlaneSurface>(pTransform, rBounds);
82 auto pTransform2 = std::make_shared<const Transform3D>(translation2);
83 auto planeSurfaceObject2 =
84 Surface::makeShared<PlaneSurface>(pTransform2, rBounds);
89 Vector3D binningPosition{0., 1., 2.};
95 Vector3D globalPosition{2.0, 2.0, 0.0};
98 expectedFrame << 1., 0., 0., 0., 1., 0., 0., 0., 1.;
102 expectedFrame, 1
e-6, 1e-9);
106 BOOST_CHECK_EQUAL(planeSurfaceObject->normal(
tgContext), normal3D);
109 BOOST_CHECK_EQUAL(planeSurfaceObject->bounds().type(),
118 Vector3D expectedPosition{1.5 + translation.x(), 1.7 + translation.y(),
126 Vector2D expectedLocalPosition{1.5, 1.7};
132 BOOST_CHECK(planeSurfaceObject->isOnSurface(
tgContext, globalPosition,
139 auto intersect = planeSurfaceObject->intersectionEstimate(
142 Intersection::Status::reachable};
143 BOOST_CHECK(
bool(intersect));
144 BOOST_CHECK_EQUAL(intersect.position, expectedIntersect.position);
145 BOOST_CHECK_EQUAL(intersect.pathLength, expectedIntersect.pathLength);
154 BOOST_CHECK_EQUAL(planeSurfaceObject->name(),
155 std::string(
"Acts::PlaneSurface"));
174 auto rBounds = std::make_shared<const RectangleBounds>(3., 4.);
176 auto pTransform = std::make_shared<const Transform3D>(translation);
177 auto planeSurfaceObject =
178 Surface::makeShared<PlaneSurface>(pTransform, rBounds);
179 auto planeSurfaceObject2 =
180 Surface::makeShared<PlaneSurface>(pTransform, rBounds);
183 BOOST_CHECK(*planeSurfaceObject == *planeSurfaceObject2);
185 BOOST_TEST_CHECKPOINT(
186 "Create and then assign a PlaneSurface object to the existing one");
188 auto assignedPlaneSurface =
189 Surface::makeShared<PlaneSurface>(
nullptr,
nullptr);
190 *assignedPlaneSurface = *planeSurfaceObject;
192 BOOST_CHECK(*assignedPlaneSurface == *planeSurfaceObject);
195 BOOST_AUTO_TEST_SUITE_END()