File indexing completed on 2025-08-06 08:11:20
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/data/test_case.hpp>
0010 #include <boost/test/unit_test.hpp>
0011
0012 #include "Acts/Definitions/Algebra.hpp"
0013 #include "Acts/Geometry/ApproachDescriptor.hpp"
0014 #include "Acts/Geometry/DiscLayer.hpp"
0015 #include "Acts/Geometry/GenericApproachDescriptor.hpp"
0016 #include "Acts/Geometry/Layer.hpp"
0017 #include "Acts/Surfaces/DiscSurface.hpp"
0018 #include "Acts/Surfaces/PlaneSurface.hpp"
0019 #include "Acts/Surfaces/RadialBounds.hpp"
0020 #include "Acts/Surfaces/RectangleBounds.hpp"
0021 #include "Acts/Surfaces/Surface.hpp"
0022 #include "Acts/Surfaces/SurfaceArray.hpp"
0023
0024 #include <memory>
0025 #include <string>
0026 #include <utility>
0027 #include <vector>
0028
0029 namespace Acts {
0030 namespace Test {
0031 namespace Layers {
0032 BOOST_AUTO_TEST_SUITE(Layers)
0033
0034
0035 BOOST_AUTO_TEST_CASE(DiscLayerConstruction) {
0036
0037
0038
0039 Translation3 translation{0., 1., 2.};
0040 auto pTransform = Transform3(translation);
0041 const double minRad(5.), maxRad(10.);
0042 auto pDisc = std::make_shared<const RadialBounds>(minRad, maxRad);
0043 auto pDiscLayer = DiscLayer::create(pTransform, pDisc, nullptr, 1.);
0044 BOOST_CHECK_EQUAL(pDiscLayer->layerType(), LayerType::passive);
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.0);
0053 auto pDiscLayerFromSurfaces =
0054 DiscLayer::create(pTransform, pDisc, nullptr, 1.);
0055 BOOST_CHECK_EQUAL(pDiscLayerFromSurfaces->layerType(), LayerType::passive);
0056
0057 auto pDiscLayerWithThickness =
0058 DiscLayer::create(pTransform, pDisc, nullptr, thickness);
0059 BOOST_CHECK_EQUAL(pDiscLayerWithThickness->thickness(), thickness);
0060
0061 std::unique_ptr<ApproachDescriptor> ad(
0062 new GenericApproachDescriptor(aSurfaces));
0063 auto adPtr = ad.get();
0064 auto pDiscLayerWithApproachDescriptor =
0065 DiscLayer::create(pTransform, pDisc, nullptr, thickness, std::move(ad));
0066 BOOST_CHECK_EQUAL(pDiscLayerWithApproachDescriptor->approachDescriptor(),
0067 adPtr);
0068
0069 auto pDiscLayerWithLayerType = DiscLayer::create(
0070 pTransform, pDisc, nullptr, thickness, std::move(ad), LayerType::passive);
0071 BOOST_CHECK_EQUAL(pDiscLayerWithLayerType->layerType(), LayerType::passive);
0072 }
0073
0074
0075 BOOST_AUTO_TEST_CASE(DiscLayerProperties) {
0076 Translation3 translation{0., 1., 2.};
0077 auto pTransform = Transform3(translation);
0078 const double minRad(5.), maxRad(10.);
0079 auto pDisc = std::make_shared<const RadialBounds>(minRad, maxRad);
0080 auto pDiscLayer = DiscLayer::create(pTransform, pDisc, nullptr, 1.);
0081
0082 BOOST_CHECK_EQUAL(pDiscLayer->surfaceRepresentation().name(),
0083 std::string("Acts::DiscSurface"));
0084 }
0085
0086 BOOST_AUTO_TEST_SUITE_END()
0087 }
0088 }
0089 }