File indexing completed on 2025-08-05 08:09:36
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Geometry/DiscLayer.hpp"
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/BoundarySurfaceFace.hpp"
0013 #include "Acts/Geometry/BoundarySurfaceT.hpp"
0014 #include "Acts/Geometry/CylinderVolumeBounds.hpp"
0015 #include "Acts/Geometry/GenericApproachDescriptor.hpp"
0016 #include "Acts/Geometry/Layer.hpp"
0017 #include "Acts/Geometry/Volume.hpp"
0018 #include "Acts/Surfaces/RadialBounds.hpp"
0019 #include "Acts/Surfaces/Surface.hpp"
0020
0021 #include <vector>
0022
0023 using Acts::VectorHelpers::perp;
0024 using Acts::VectorHelpers::phi;
0025
0026 Acts::DiscLayer::DiscLayer(const Transform3& transform,
0027 const std::shared_ptr<const DiscBounds>& dbounds,
0028 std::unique_ptr<SurfaceArray> surfaceArray,
0029 double thickness,
0030 std::unique_ptr<ApproachDescriptor> ades,
0031 LayerType laytyp)
0032 : DiscSurface(transform, dbounds),
0033 Layer(std::move(surfaceArray), thickness, std::move(ades), laytyp) {
0034
0035 const RadialBounds* rBounds =
0036 dynamic_cast<const RadialBounds*>(DiscSurface::m_bounds.get());
0037 if (rBounds != nullptr) {
0038
0039 auto rVolumeBounds =
0040 std::make_shared<CylinderVolumeBounds>(*rBounds, thickness);
0041
0042 m_representingVolume = std::make_unique<Volume>(m_transform, rVolumeBounds);
0043 }
0044
0045 DiscSurface::associateLayer(*this);
0046
0047 if (!m_approachDescriptor && m_surfaceArray) {
0048 buildApproachDescriptor();
0049 }
0050
0051 if (m_approachDescriptor) {
0052 approachDescriptor()->registerLayer(*this);
0053 }
0054 }
0055
0056 const Acts::DiscSurface& Acts::DiscLayer::surfaceRepresentation() const {
0057 return (*this);
0058 }
0059
0060 Acts::DiscSurface& Acts::DiscLayer::surfaceRepresentation() {
0061 return (*this);
0062 }
0063
0064 void Acts::DiscLayer::buildApproachDescriptor() {
0065
0066 m_approachDescriptor.reset(nullptr);
0067
0068 if (m_representingVolume != nullptr) {
0069
0070 std::vector<OrientedSurface> bSurfaces =
0071 m_representingVolume->volumeBounds().orientedSurfaces(
0072 m_representingVolume->transform());
0073
0074 std::vector<std::shared_ptr<const Surface>> aSurfaces;
0075 aSurfaces.push_back(bSurfaces.at(negativeFaceXY).surface);
0076 aSurfaces.push_back(bSurfaces.at(positiveFaceXY).surface);
0077 aSurfaces.push_back(bSurfaces.at(tubeInnerCover).surface);
0078 aSurfaces.push_back(bSurfaces.at(tubeOuterCover).surface);
0079
0080 m_approachDescriptor =
0081 std::make_unique<const GenericApproachDescriptor>(std::move(aSurfaces));
0082 }
0083
0084
0085 for (auto& sfPtr : (m_approachDescriptor->containedSurfaces())) {
0086 if (sfPtr != nullptr) {
0087 auto& mutableSf = *(const_cast<Surface*>(sfPtr));
0088 mutableSf.associateLayer(*this);
0089 }
0090 }
0091 }