File indexing completed on 2025-01-18 09:12:34
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Detector/detail/ReferenceGenerators.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 #include "Acts/Surfaces/PlaneSurface.hpp"
0015 #include "Acts/Surfaces/RectangleBounds.hpp"
0016 #include "Acts/Surfaces/Surface.hpp"
0017 #include "Acts/Utilities/BinningType.hpp"
0018
0019 #include <memory>
0020 #include <utility>
0021 #include <vector>
0022
0023 using namespace Acts::Experimental::detail;
0024
0025 Acts::GeometryContext tContext;
0026
0027 auto rBounds = std::make_shared<Acts::RectangleBounds>(10, 20);
0028 auto sTransform = Acts::Transform3::Identity();
0029 auto pSurface = Acts::Surface::makeShared<Acts::PlaneSurface>(
0030 sTransform.pretranslate(Acts::Vector3(20., 20., 100.)), std::move(rBounds));
0031
0032 BOOST_AUTO_TEST_SUITE(Detector)
0033
0034 BOOST_AUTO_TEST_CASE(CenterReference) {
0035
0036 auto center = CenterReferenceGenerator{}.references(tContext, *pSurface);
0037 BOOST_CHECK_EQUAL(center.size(), 1u);
0038 BOOST_CHECK(center.front().isApprox(Acts::Vector3(20., 20., 100.)));
0039 }
0040
0041 BOOST_AUTO_TEST_CASE(BinningPositionReference) {
0042
0043
0044 auto referencePosition =
0045 AxisDirectionReferenceGenerator<Acts::AxisDirection::AxisZ>{}.references(
0046 tContext, *pSurface);
0047 BOOST_CHECK_EQUAL(referencePosition.size(), 1u);
0048 }
0049
0050 BOOST_AUTO_TEST_CASE(PolyhedronReference) {
0051
0052
0053 auto referencePositions =
0054 PolyhedronReferenceGenerator<>{}.references(tContext, *pSurface);
0055
0056 BOOST_CHECK_EQUAL(referencePositions.size(), 5u);
0057 }
0058
0059 BOOST_AUTO_TEST_SUITE_END()