File indexing completed on 2025-10-13 08:18:50
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/Geometry/GeometryContext.hpp"
0013 #include "Acts/Geometry/Layer.hpp"
0014 #include "Acts/Geometry/NavigationLayer.hpp"
0015 #include "Acts/Surfaces/Surface.hpp"
0016 #include "Acts/Utilities/BinningType.hpp"
0017
0018 #include <cmath>
0019 #include <memory>
0020 #include <utility>
0021
0022 #include "../Surfaces/SurfaceStub.hpp"
0023
0024 using namespace Acts;
0025
0026 GeometryContext tgContext = GeometryContext();
0027
0028 namespace ActsTests {
0029
0030 BOOST_AUTO_TEST_SUITE(GeometrySuite)
0031
0032
0033 BOOST_AUTO_TEST_CASE(NavigationLayerConstruction) {
0034
0035 std::shared_ptr<const Surface> pSurface = Surface::makeShared<SurfaceStub>();
0036 auto pNavigationLayer = NavigationLayer::create(std::move(pSurface));
0037 BOOST_CHECK_EQUAL(pNavigationLayer->layerType(), LayerType::navigation);
0038
0039 const double thickness = 0.1;
0040 auto pSurface2 = Surface::makeShared<SurfaceStub>();
0041 auto pThickNavigationLayer =
0042 NavigationLayer::create(std::move(pSurface2), thickness);
0043 BOOST_CHECK_EQUAL(pThickNavigationLayer->layerType(), LayerType::navigation);
0044 }
0045
0046
0047 BOOST_AUTO_TEST_CASE(NavigationLayerProperties) {
0048 const double thickness = 0.1;
0049 std::shared_ptr<const Surface> pSurface = Surface::makeShared<SurfaceStub>();
0050 auto rawSurfacePtr = pSurface.get();
0051 auto pNavigationLayer =
0052 NavigationLayer::create(std::move(pSurface), thickness);
0053 AxisDirection b{AxisDirection::AxisZ};
0054 Vector3 origin{0., 0., 0.};
0055
0056 BOOST_CHECK_EQUAL(pNavigationLayer->referencePosition(tgContext, b), origin);
0057
0058 BOOST_CHECK_EQUAL(rawSurfacePtr,
0059 &(pNavigationLayer->surfaceRepresentation()));
0060
0061 BOOST_CHECK(pNavigationLayer->isOnLayer(tgContext, origin,
0062 BoundaryTolerance::None()));
0063
0064 Vector3 crazyPosition{1000., 10000., std::nan("")};
0065
0066 BOOST_CHECK(pNavigationLayer->isOnLayer(tgContext, crazyPosition,
0067 BoundaryTolerance::None()));
0068
0069 BOOST_CHECK(!pNavigationLayer->resolve(true, true, true));
0070 }
0071
0072 BOOST_AUTO_TEST_SUITE_END()
0073
0074 }