9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
41 namespace ActsFatras {
43 std::vector<std::array<std::ofstream, 3>>
out;
45 BOOST_AUTO_TEST_SUITE(Digitization)
48 auto rectangleBounds = std::make_shared<Acts::RectangleBounds>(2., 3.5);
49 auto planeSurface = Acts::Surface::makeShared<Acts::PlaneSurface>(
50 Acts::Transform3::Identity(), rectangleBounds);
57 auto clipped = psm.apply(*planeSurface, segment).value();
66 clipped = psm.apply(*planeSurface, segment).value();
75 clipped = psm.apply(*planeSurface, segment).value();
85 std::make_shared<Acts::RadialBounds>(2., 7.5, M_PI_4, M_PI_2);
86 auto discSurface = Acts::Surface::makeShared<Acts::DiscSurface>(
87 Acts::Transform3::Identity(), discRadial);
94 auto clipped = psm.apply(*discSurface, segment).value();
103 clipped = psm.apply(*discSurface, segment).value();
112 clipped = psm.apply(*discSurface, segment).value();
119 clipped = psm.apply(*discSurface, segment).value();
125 clipped = psm.apply(*discSurface, segment).value();
135 bdata::random(0., 1.) ^ bdata::random(0., 1.) ^
136 bdata::random(0., 1.) ^ bdata::random(0., 1.) ^
138 startR0, startR1, endR0, endR1,
index) {
146 auto testBeds = pstd(1.1);
151 for (
const auto& tb : testBeds) {
152 const auto&
name = std::get<0>(tb);
153 const auto*
surface = (std::get<1>(tb)).get();
154 const auto& randomizer = std::get<3>(tb);
158 const Acts::Vector2 centerXY = surface->center(geoCtx).segment<2>(0);
161 shape.open(
"PlanarSurfaceMask" +
name +
"Borders.csv");
163 const auto* pBounds =
165 csvHelper.
writePolygon(shape, pBounds->vertices(1), -centerXY);
167 const auto* dBounds =
169 csvHelper.
writePolygon(shape, dBounds->vertices(72), -centerXY);
178 auto start = randomizer(startR0, startR1);
179 auto end = randomizer(endR0, endR1);
182 auto clippedTest = psm.
apply(*surface, segment);
183 if (clippedTest.ok()) {
184 auto clipped = clippedTest.value();
185 if (segment == clipped) {
204 BOOST_AUTO_TEST_SUITE_END()