9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
28 using boost::test_tools::output_test_stream;
29 namespace utf = boost::unit_test;
38 BOOST_AUTO_TEST_SUITE(StrawSurfaces)
44 double radius(1.0), halfZ(10.);
48 Surface::makeShared<StrawSurface>(Transform3::Identity(), radius, halfZ)
52 Surface::makeShared<StrawSurface>(pTransform, radius, halfZ)->
type(),
56 auto pLineBounds = std::make_shared<const LineBounds>(radius, halfZ);
58 Surface::makeShared<StrawSurface>(pTransform, pLineBounds)->
type(),
62 std::shared_ptr<const Acts::PlanarBounds>
p =
63 std::make_shared<const RectangleBounds>(1., 10.);
66 Surface::makeShared<StrawSurface>(pLineBounds, detElement)->
type(),
70 auto strawSurfaceObject =
71 Surface::makeShared<StrawSurface>(pTransform, radius, halfZ);
72 auto copiedStrawSurface =
73 Surface::makeShared<StrawSurface>(*strawSurfaceObject);
75 BOOST_CHECK(*copiedStrawSurface == *strawSurfaceObject);
78 auto copiedTransformedStrawSurface = Surface::makeShared<StrawSurface>(
79 tgContext, *strawSurfaceObject, pTransform);
80 BOOST_CHECK_EQUAL(copiedTransformedStrawSurface->type(),
Surface::Straw);
86 double radius(1.0), halfZ(10.);
89 auto strawSurfaceObject =
90 Surface::makeShared<StrawSurface>(pTransform, radius, halfZ);
96 BOOST_CHECK_EQUAL(strawSurfaceObject->name(),
100 boost::test_tools::output_test_stream dumpOuput;
101 strawSurfaceObject->toStream(
tgContext, dumpOuput);
103 dumpOuput.is_equal(
"Acts::StrawSurface\n\
104 Center position (x, y, z) = (0.0000, 1.0000, 2.0000)\n\
105 Rotation: colX = (1.000000, 0.000000, 0.000000)\n\
106 colY = (0.000000, 1.000000, 0.000000)\n\
107 colZ = (0.000000, 0.000000, 1.000000)\n\
108 Bounds : Acts::LineBounds: (radius, halflengthInZ) = (1.0000000, 10.0000000)"));
112 double radius(1.0), halfZ(10.);
115 auto strawSurfaceObject =
116 Surface::makeShared<StrawSurface>(pTransform, radius, halfZ);
118 auto strawSurfaceObject2 =
119 Surface::makeShared<StrawSurface>(pTransform, radius, halfZ);
122 BOOST_CHECK(*strawSurfaceObject == *strawSurfaceObject2);
124 BOOST_TEST_CHECKPOINT(
125 "Create and then assign a StrawSurface object to the existing one");
127 auto assignedStrawSurface =
128 Surface::makeShared<StrawSurface>(Transform3::Identity(), 6.6, 33.33);
129 *assignedStrawSurface = *strawSurfaceObject;
131 BOOST_CHECK(*assignedStrawSurface == *strawSurfaceObject);
134 BOOST_AUTO_TEST_SUITE_END()