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/CylinderLayer.hpp"
0015 #include "Acts/Geometry/GenericApproachDescriptor.hpp"
0016 #include "Acts/Geometry/Layer.hpp"
0017 #include "Acts/Surfaces/CylinderBounds.hpp"
0018 #include "Acts/Surfaces/CylinderSurface.hpp"
0019 #include "Acts/Surfaces/PlaneSurface.hpp"
0020 #include "Acts/Surfaces/RectangleBounds.hpp"
0021 #include "Acts/Surfaces/Surface.hpp"
0022 #include "Acts/Surfaces/SurfaceArray.hpp"
0023 #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp"
0024
0025 #include <memory>
0026 #include <string>
0027 #include <utility>
0028 #include <vector>
0029
0030 namespace Acts {
0031 namespace Test {
0032 namespace Layers {
0033 BOOST_AUTO_TEST_SUITE(Layers)
0034
0035
0036 BOOST_AUTO_TEST_CASE(CylinderLayerConstruction) {
0037
0038
0039
0040 Translation3 translation{0., 1., 2.};
0041 auto pTransform = Transform3(translation);
0042 double radius(0.5), halfz(10.);
0043 auto pCylinder = std::make_shared<const CylinderBounds>(radius, halfz);
0044 auto pCylinderLayer =
0045 CylinderLayer::create(pTransform, pCylinder, nullptr, 1.);
0046 BOOST_CHECK_EQUAL(pCylinderLayer->layerType(), LayerType::passive);
0047
0048
0049 auto rBounds = std::make_shared<const RectangleBounds>(1., 1.);
0050
0051 const std::vector<std::shared_ptr<const Surface>> aSurfaces{
0052 Surface::makeShared<PlaneSurface>(Transform3::Identity(), rBounds),
0053 Surface::makeShared<PlaneSurface>(Transform3::Identity(), rBounds)};
0054 const double thickness(1.0);
0055 auto pCylinderLayerFromSurfaces =
0056 CylinderLayer::create(pTransform, pCylinder, nullptr, thickness);
0057 BOOST_CHECK_EQUAL(pCylinderLayerFromSurfaces->layerType(),
0058 LayerType::passive);
0059
0060 auto pCylinderLayerWithThickness =
0061 CylinderLayer::create(pTransform, pCylinder, nullptr, thickness);
0062 CHECK_CLOSE_REL(pCylinderLayerWithThickness->thickness(), thickness, 1e-6);
0063
0064 std::unique_ptr<ApproachDescriptor> ad(
0065 new GenericApproachDescriptor(aSurfaces));
0066 auto adPtr = ad.get();
0067 auto pCylinderLayerWithApproachDescriptor = CylinderLayer::create(
0068 pTransform, pCylinder, nullptr, thickness, std::move(ad));
0069 BOOST_CHECK_EQUAL(pCylinderLayerWithApproachDescriptor->approachDescriptor(),
0070 adPtr);
0071
0072 auto pCylinderLayerWithLayerType =
0073 CylinderLayer::create(pTransform, pCylinder, nullptr, thickness,
0074 std::move(ad), LayerType::passive);
0075 BOOST_CHECK_EQUAL(pCylinderLayerWithLayerType->layerType(),
0076 LayerType::passive);
0077 }
0078
0079
0080 BOOST_AUTO_TEST_CASE(CylinderLayerProperties) {
0081 Translation3 translation{0., 1., 2.};
0082 auto pTransform = Transform3(translation);
0083 double radius(0.5), halfz(10.);
0084 auto pCylinder = std::make_shared<const CylinderBounds>(radius, halfz);
0085 auto pCylinderLayer =
0086 CylinderLayer::create(pTransform, pCylinder, nullptr, 1.);
0087
0088 BOOST_CHECK_EQUAL(pCylinderLayer->surfaceRepresentation().name(),
0089 std::string("Acts::CylinderSurface"));
0090 }
0091
0092 BOOST_AUTO_TEST_SUITE_END()
0093 }
0094 }
0095 }