File indexing completed on 2025-08-05 08:09:37
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Geometry/PlaneLayer.hpp"
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/GenericApproachDescriptor.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 #include "Acts/Surfaces/RegularSurface.hpp"
0015 #include "Acts/Surfaces/Surface.hpp"
0016
0017 #include <algorithm>
0018 #include <vector>
0019
0020 Acts::PlaneLayer::PlaneLayer(const Transform3& transform,
0021 std::shared_ptr<const PlanarBounds>& pbounds,
0022 std::unique_ptr<SurfaceArray> surfaceArray,
0023 double thickness,
0024 std::unique_ptr<ApproachDescriptor> ades,
0025 LayerType laytyp)
0026 : PlaneSurface(transform, pbounds),
0027 Layer(std::move(surfaceArray), thickness, std::move(ades), laytyp) {
0028
0029
0030 Acts::PlaneSurface::associateLayer(*this);
0031
0032 if (!m_approachDescriptor && m_surfaceArray) {
0033 buildApproachDescriptor();
0034 }
0035
0036 if (m_approachDescriptor) {
0037 approachDescriptor()->registerLayer(*this);
0038 }
0039 }
0040
0041 const Acts::PlaneSurface& Acts::PlaneLayer::surfaceRepresentation() const {
0042 return (*this);
0043 }
0044
0045 Acts::PlaneSurface& Acts::PlaneLayer::surfaceRepresentation() {
0046 return (*this);
0047 }
0048
0049 void Acts::PlaneLayer::buildApproachDescriptor() {
0050
0051 m_approachDescriptor.reset(nullptr);
0052
0053 std::vector<std::shared_ptr<const Acts::Surface>> aSurfaces;
0054
0055
0056
0057 const Transform3& lTransform = transform(GeometryContext());
0058 RotationMatrix3 lRotation = lTransform.rotation();
0059 const Vector3& lCenter = center(GeometryContext());
0060 const Vector3& lVector = normal(GeometryContext(), lCenter);
0061
0062 const Transform3 apnTransform = Transform3(
0063 Translation3(lCenter - 0.5 * Layer::m_layerThickness * lVector) *
0064 lRotation);
0065 const Transform3 appTransform = Transform3(
0066 Translation3(lCenter + 0.5 * Layer::m_layerThickness * lVector) *
0067 lRotation);
0068
0069 aSurfaces.push_back(Surface::makeShared<Acts::PlaneSurface>(
0070 apnTransform, PlaneSurface::m_bounds));
0071 aSurfaces.push_back(Surface::makeShared<Acts::PlaneSurface>(
0072 appTransform, PlaneSurface::m_bounds));
0073
0074 for (auto& sfPtr : aSurfaces) {
0075 auto mutableSf = const_cast<Surface*>(sfPtr.get());
0076 mutableSf->associateLayer(*this);
0077 }
0078
0079 m_approachDescriptor =
0080 std::make_unique<const GenericApproachDescriptor>(std::move(aSurfaces));
0081 }