File indexing completed on 2025-01-18 09:12:39
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 namespace Acts::Test {
0025
0026 GeometryContext tgContext = GeometryContext();
0027 }
0028
0029 namespace Acts::Test::Layers {
0030
0031 BOOST_AUTO_TEST_SUITE(Layers)
0032
0033
0034 BOOST_AUTO_TEST_CASE(NavigationLayerConstruction) {
0035
0036 std::shared_ptr<const Surface> pSurface = Surface::makeShared<SurfaceStub>();
0037 auto pNavigationLayer = NavigationLayer::create(std::move(pSurface));
0038 BOOST_CHECK_EQUAL(pNavigationLayer->layerType(), LayerType::navigation);
0039
0040 const double thickness = 0.1;
0041 auto pSurface2 = Surface::makeShared<SurfaceStub>();
0042 auto pThickNavigationLayer =
0043 NavigationLayer::create(std::move(pSurface2), thickness);
0044 BOOST_CHECK_EQUAL(pThickNavigationLayer->layerType(), LayerType::navigation);
0045 }
0046
0047
0048 BOOST_AUTO_TEST_CASE(NavigationLayerProperties) {
0049 const double thickness = 0.1;
0050 std::shared_ptr<const Surface> pSurface = Surface::makeShared<SurfaceStub>();
0051 auto rawSurfacePtr = pSurface.get();
0052 auto pNavigationLayer =
0053 NavigationLayer::create(std::move(pSurface), thickness);
0054 AxisDirection b{AxisDirection::AxisZ};
0055 Vector3 origin{0., 0., 0.};
0056
0057 BOOST_CHECK_EQUAL(pNavigationLayer->referencePosition(tgContext, b), origin);
0058
0059 BOOST_CHECK_EQUAL(rawSurfacePtr,
0060 &(pNavigationLayer->surfaceRepresentation()));
0061
0062 BOOST_CHECK(pNavigationLayer->isOnLayer(tgContext, origin,
0063 BoundaryTolerance::None()));
0064
0065 Vector3 crazyPosition{1000., 10000., std::nan("")};
0066
0067 BOOST_CHECK(pNavigationLayer->isOnLayer(tgContext, crazyPosition,
0068 BoundaryTolerance::None()));
0069
0070 BOOST_CHECK(!pNavigationLayer->resolve(true, true, true));
0071 }
0072
0073 BOOST_AUTO_TEST_SUITE_END()
0074
0075 }