File indexing completed on 2025-01-18 09:12:38
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/DiscLayer.hpp"
0014 #include "Acts/Geometry/GenericApproachDescriptor.hpp"
0015 #include "Acts/Geometry/Layer.hpp"
0016 #include "Acts/Surfaces/DiscSurface.hpp"
0017 #include "Acts/Surfaces/PlaneSurface.hpp"
0018 #include "Acts/Surfaces/RadialBounds.hpp"
0019 #include "Acts/Surfaces/RectangleBounds.hpp"
0020 #include "Acts/Surfaces/Surface.hpp"
0021 #include "Acts/Surfaces/SurfaceArray.hpp"
0022
0023 #include <memory>
0024 #include <string>
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(DiscLayerConstruction) {
0034
0035
0036
0037 Translation3 translation{0., 1., 2.};
0038 auto pTransform = Transform3(translation);
0039 const double minRad(5.), maxRad(10.);
0040 auto pDisc = std::make_shared<const RadialBounds>(minRad, maxRad);
0041 auto pDiscLayer = DiscLayer::create(pTransform, pDisc, nullptr, 1.);
0042 BOOST_CHECK_EQUAL(pDiscLayer->layerType(), LayerType::passive);
0043
0044
0045 auto rBounds = std::make_shared<const RectangleBounds>(1., 1.);
0046
0047 const std::vector<std::shared_ptr<const Surface>> aSurfaces{
0048 Surface::makeShared<PlaneSurface>(Transform3::Identity(), rBounds),
0049 Surface::makeShared<PlaneSurface>(Transform3::Identity(), rBounds)};
0050 const double thickness(1.0);
0051 auto pDiscLayerFromSurfaces =
0052 DiscLayer::create(pTransform, pDisc, nullptr, 1.);
0053 BOOST_CHECK_EQUAL(pDiscLayerFromSurfaces->layerType(), LayerType::passive);
0054
0055 auto pDiscLayerWithThickness =
0056 DiscLayer::create(pTransform, pDisc, nullptr, thickness);
0057 BOOST_CHECK_EQUAL(pDiscLayerWithThickness->thickness(), thickness);
0058
0059 std::unique_ptr<ApproachDescriptor> ad(
0060 new GenericApproachDescriptor(aSurfaces));
0061 auto adPtr = ad.get();
0062 auto pDiscLayerWithApproachDescriptor =
0063 DiscLayer::create(pTransform, pDisc, nullptr, thickness, std::move(ad));
0064 BOOST_CHECK_EQUAL(pDiscLayerWithApproachDescriptor->approachDescriptor(),
0065 adPtr);
0066
0067 auto pDiscLayerWithLayerType = DiscLayer::create(
0068 pTransform, pDisc, nullptr, thickness, std::move(ad), LayerType::passive);
0069 BOOST_CHECK_EQUAL(pDiscLayerWithLayerType->layerType(), LayerType::passive);
0070 }
0071
0072
0073 BOOST_AUTO_TEST_CASE(DiscLayerProperties) {
0074 Translation3 translation{0., 1., 2.};
0075 auto pTransform = Transform3(translation);
0076 const double minRad(5.), maxRad(10.);
0077 auto pDisc = std::make_shared<const RadialBounds>(minRad, maxRad);
0078 auto pDiscLayer = DiscLayer::create(pTransform, pDisc, nullptr, 1.);
0079
0080 BOOST_CHECK_EQUAL(pDiscLayer->surfaceRepresentation().name(),
0081 std::string("Acts::DiscSurface"));
0082 }
0083
0084 BOOST_AUTO_TEST_SUITE_END()
0085
0086 }