File indexing completed on 2025-01-18 09:12:36
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/ApproachDescriptor.hpp"
0013 #include "Acts/Geometry/ConeLayer.hpp"
0014 #include "Acts/Geometry/GenericApproachDescriptor.hpp"
0015 #include "Acts/Geometry/Layer.hpp"
0016 #include "Acts/Surfaces/ConeBounds.hpp"
0017 #include "Acts/Surfaces/PlaneSurface.hpp"
0018 #include "Acts/Surfaces/RectangleBounds.hpp"
0019 #include "Acts/Surfaces/Surface.hpp"
0020 #include "Acts/Surfaces/SurfaceArray.hpp"
0021
0022 #include <cmath>
0023 #include <memory>
0024 #include <numbers>
0025 #include <utility>
0026 #include <vector>
0027
0028 namespace Acts::Test::Layers {
0029
0030 BOOST_AUTO_TEST_SUITE(Layers)
0031
0032
0033 BOOST_AUTO_TEST_CASE(ConeLayerConstruction) {
0034
0035
0036
0037 Translation3 translation{0., 1., 2.};
0038 auto pTransform = Transform3(translation);
0039 const double alpha = std::numbers::pi / 8.;
0040 const bool symmetric = false;
0041 auto pCone = std::make_shared<const ConeBounds>(alpha, symmetric);
0042
0043
0044
0045
0046
0047 auto rBounds = std::make_shared<const RectangleBounds>(1., 1.);
0048
0049 const std::vector<std::shared_ptr<const Surface>> aSurfaces{
0050 Surface::makeShared<PlaneSurface>(Transform3::Identity(), rBounds),
0051 Surface::makeShared<PlaneSurface>(Transform3::Identity(), rBounds)};
0052 const double thickness = 1.;
0053 auto pConeLayerFromSurfaces = ConeLayer::create(pTransform, pCone, nullptr);
0054 BOOST_CHECK_EQUAL(pConeLayerFromSurfaces->layerType(), LayerType::active);
0055
0056 auto pConeLayerWithThickness =
0057 ConeLayer::create(pTransform, pCone, nullptr, thickness);
0058 BOOST_CHECK_EQUAL(pConeLayerWithThickness->thickness(), thickness);
0059
0060 std::unique_ptr<ApproachDescriptor> ad(
0061 new GenericApproachDescriptor(aSurfaces));
0062 auto adPtr = ad.get();
0063 auto pConeLayerWithApproachDescriptor =
0064 ConeLayer::create(pTransform, pCone, nullptr, thickness, std::move(ad));
0065 BOOST_CHECK_EQUAL(pConeLayerWithApproachDescriptor->approachDescriptor(),
0066 adPtr);
0067
0068 auto pConeLayerWithLayerType = ConeLayer::create(
0069 pTransform, pCone, nullptr, thickness, std::move(ad), LayerType::passive);
0070 BOOST_CHECK_EQUAL(pConeLayerWithLayerType->layerType(), LayerType::passive);
0071 }
0072
0073 BOOST_AUTO_TEST_SUITE_END()
0074
0075 }