9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
22 using boost::test_tools::output_test_stream;
23 namespace utf = boost::unit_test;
32 BOOST_AUTO_TEST_SUITE(StrawSurfaces)
38 double radius(1.0), halfZ(10.);
40 auto pTransform = std::make_shared<const Transform3D>(translation);
41 std::shared_ptr<const Transform3D> pNullTransform{};
43 Surface::makeShared<StrawSurface>(pNullTransform,
radius, halfZ)->type(),
46 Surface::makeShared<StrawSurface>(pTransform,
radius, halfZ)->type(),
50 auto pLineBounds = std::make_shared<const LineBounds>(
radius, halfZ);
52 Surface::makeShared<StrawSurface>(pTransform, pLineBounds)->type(),
56 std::shared_ptr<const Acts::PlanarBounds>
p =
57 std::make_shared<const RectangleBounds>(1., 10.);
60 Surface::makeShared<StrawSurface>(pLineBounds, detElement)->type(),
64 auto strawSurfaceObject =
65 Surface::makeShared<StrawSurface>(pTransform,
radius, halfZ);
66 auto copiedStrawSurface =
67 Surface::makeShared<StrawSurface>(*strawSurfaceObject);
69 BOOST_CHECK(*copiedStrawSurface == *strawSurfaceObject);
72 auto copiedTransformedStrawSurface = Surface::makeShared<StrawSurface>(
73 tgContext, *strawSurfaceObject, *pTransform);
74 BOOST_CHECK_EQUAL(copiedTransformedStrawSurface->type(),
Surface::Straw);
80 double radius(1.0), halfZ(10.);
82 auto pTransform = std::make_shared<const Transform3D>(translation);
83 auto strawSurfaceObject =
84 Surface::makeShared<StrawSurface>(pTransform,
radius, halfZ);
90 BOOST_CHECK_EQUAL(strawSurfaceObject->name(),
91 std::string(
"Acts::StrawSurface"));
94 boost::test_tools::output_test_stream dumpOuput;
95 strawSurfaceObject->toStream(
tgContext, dumpOuput);
97 dumpOuput.is_equal(
"Acts::StrawSurface\n\
98 Center position (x, y, z) = (0.0000, 1.0000, 2.0000)\n\
99 Rotation: colX = (1.000000, 0.000000, 0.000000)\n\
100 colY = (0.000000, 1.000000, 0.000000)\n\
101 colZ = (0.000000, 0.000000, 1.000000)\n\
102 Bounds : Acts::LineBounds: (radius, halflengthInZ) = (1.0000000, 10.0000000)"));
106 double radius(1.0), halfZ(10.);
108 auto pTransform = std::make_shared<const Transform3D>(translation);
109 auto strawSurfaceObject =
110 Surface::makeShared<StrawSurface>(pTransform,
radius, halfZ);
112 auto strawSurfaceObject2 =
113 Surface::makeShared<StrawSurface>(pTransform,
radius, halfZ);
116 BOOST_CHECK(*strawSurfaceObject == *strawSurfaceObject2);
118 BOOST_TEST_CHECKPOINT(
119 "Create and then assign a StrawSurface object to the existing one");
121 auto assignedStrawSurface =
122 Surface::makeShared<StrawSurface>(
nullptr, 6.6, 33.33);
123 *assignedStrawSurface = *strawSurfaceObject;
125 BOOST_CHECK(*assignedStrawSurface == *strawSurfaceObject);
128 BOOST_AUTO_TEST_SUITE_END()