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