9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
20 namespace tt = boost::test_tools;
21 using boost::test_tools::output_test_stream;
22 namespace utf = boost::unit_test;
31 BOOST_AUTO_TEST_SUITE(ConeSurfaces)
38 double alpha{
M_PI / 8.}, halfPhiSector{
M_PI / 16.}, zMin{1.0}, zMax{10.};
39 bool symmetric(
false);
41 auto pTransform = std::make_shared<const Transform3D>(translation);
42 std::shared_ptr<const Transform3D> pNullTransform{};
44 Surface::makeShared<ConeSurface>(pNullTransform,
alpha, symmetric)
48 Surface::makeShared<ConeSurface>(pTransform,
alpha, symmetric)->type(),
52 BOOST_CHECK_EQUAL(Surface::makeShared<ConeSurface>(pTransform,
alpha, zMin,
62 std::make_shared<const ConeBounds>(
alpha, zMin, zMax, halfPhiSector, 0.);
64 Surface::makeShared<ConeSurface>(pTransform, pConeBounds)->type(),
69 auto coneSurfaceObject =
70 Surface::makeShared<ConeSurface>(pTransform,
alpha, symmetric);
71 auto copiedConeSurface = Surface::makeShared<ConeSurface>(*coneSurfaceObject);
73 BOOST_CHECK(*copiedConeSurface == *coneSurfaceObject);
76 auto copiedTransformedConeSurface = Surface::makeShared<ConeSurface>(
77 tgContext, *coneSurfaceObject, *pTransform);
78 BOOST_CHECK_EQUAL(copiedTransformedConeSurface->type(),
Surface::Cone);
82 auto nullBounds = Surface::makeShared<ConeSurface>(
nullptr,
nullptr),
90 bool symmetric(
false);
92 auto pTransform = std::make_shared<const Transform3D>(translation);
93 auto coneSurfaceObject =
94 Surface::makeShared<ConeSurface>(pTransform,
alpha, symmetric);
100 Vector3D binningPosition{0., 1., 2.};
103 binningPosition, 1
e-6);
106 Vector3D globalPosition{2.0, 2.0, 2.0};
108 double rootHalf = std::sqrt(0.5);
110 expectedFrame << -rootHalf, 0., rootHalf, rootHalf, 0., rootHalf, 0., 1., 0.;
113 expectedFrame, 1
e-6, 1e-9);
122 Vector3D normalAtPiBy2{0.0312768, 0.92335, -0.382683};
125 normalAtPiBy2, 1e-2, 1e-9);
140 Vector3D expectedPosition{0.0220268, 1.65027, 3.5708};
154 BOOST_CHECK(coneSurfaceObject->isOnSurface(
tgContext, globalPosition,
162 0.40218866453252877, 0.01);
165 BOOST_CHECK_EQUAL(coneSurfaceObject->name(),
166 std::string(
"Acts::ConeSurface"));
185 bool symmetric(
false);
187 auto pTransform = std::make_shared<const Transform3D>(translation);
188 auto coneSurfaceObject =
189 Surface::makeShared<ConeSurface>(pTransform,
alpha, symmetric);
191 auto coneSurfaceObject2 =
192 Surface::makeShared<ConeSurface>(pTransform,
alpha, symmetric);
195 BOOST_CHECK(*coneSurfaceObject == *coneSurfaceObject2);
197 BOOST_TEST_CHECKPOINT(
198 "Create and then assign a ConeSurface object to the existing one");
200 auto assignedConeSurface =
201 Surface::makeShared<ConeSurface>(
nullptr, 0.1,
true);
202 *assignedConeSurface = *coneSurfaceObject;
204 BOOST_CHECK(*assignedConeSurface == *coneSurfaceObject);
207 BOOST_AUTO_TEST_SUITE_END()