File indexing completed on 2025-01-18 09:11:20
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/BoundarySurfaceT.hpp"
0014 #include "Acts/Geometry/CylinderVolumeBounds.hpp"
0015 #include "Acts/Geometry/GenericApproachDescriptor.hpp"
0016 #include "Acts/Geometry/Volume.hpp"
0017 #include "Acts/Geometry/VolumeBounds.hpp"
0018 #include "Acts/Surfaces/Surface.hpp"
0019
0020 #include <cstddef>
0021 #include <vector>
0022
0023 namespace Acts {
0024 class CylinderBounds;
0025 }
0026
0027 using Acts::VectorHelpers::phi;
0028
0029 Acts::CylinderLayer::CylinderLayer(
0030 const Transform3& transform,
0031 const std::shared_ptr<const CylinderBounds>& cBounds,
0032 std::unique_ptr<SurfaceArray> surfaceArray, double thickness,
0033 std::unique_ptr<ApproachDescriptor> ades, LayerType laytyp)
0034 : CylinderSurface(transform, cBounds),
0035 Layer(std::move(surfaceArray), thickness, std::move(ades), laytyp) {
0036
0037 auto cVolumeBounds = std::make_shared<CylinderVolumeBounds>(
0038 *CylinderSurface::m_bounds, thickness);
0039
0040 m_representingVolume = std::make_unique<Volume>(*m_transform, cVolumeBounds);
0041
0042
0043 CylinderSurface::associateLayer(*this);
0044
0045 if (!m_approachDescriptor && m_surfaceArray) {
0046 buildApproachDescriptor();
0047 }
0048
0049 if (m_approachDescriptor) {
0050 approachDescriptor()->registerLayer(*this);
0051 }
0052 }
0053
0054 const Acts::CylinderSurface& Acts::CylinderLayer::surfaceRepresentation()
0055 const {
0056 return (*this);
0057 }
0058
0059 Acts::CylinderSurface& Acts::CylinderLayer::surfaceRepresentation() {
0060 return (*this);
0061 }
0062
0063 void Acts::CylinderLayer::buildApproachDescriptor() {
0064
0065 m_approachDescriptor.reset(nullptr);
0066
0067
0068 if (m_representingVolume != nullptr) {
0069
0070 std::vector<OrientedSurface> bSurfaces =
0071 m_representingVolume->volumeBounds().orientedSurfaces(
0072 m_representingVolume->transform());
0073
0074
0075 std::vector<std::shared_ptr<const Surface>> aSurfaces;
0076 if (bSurfaces.size() > static_cast<std::size_t>(tubeInnerCover)) {
0077 aSurfaces.push_back(bSurfaces.at(tubeInnerCover).surface);
0078 }
0079 aSurfaces.push_back(bSurfaces.at(tubeOuterCover).surface);
0080
0081 m_approachDescriptor =
0082 std::make_unique<const GenericApproachDescriptor>(std::move(aSurfaces));
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 }