File indexing completed on 2025-01-18 09:11:22
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 =
0043 std::make_unique<Volume>(*m_transform, rVolumeBounds);
0044 }
0045
0046 DiscSurface::associateLayer(*this);
0047
0048 if (!m_approachDescriptor && m_surfaceArray) {
0049 buildApproachDescriptor();
0050 }
0051
0052 if (m_approachDescriptor) {
0053 approachDescriptor()->registerLayer(*this);
0054 }
0055 }
0056
0057 const Acts::DiscSurface& Acts::DiscLayer::surfaceRepresentation() const {
0058 return (*this);
0059 }
0060
0061 Acts::DiscSurface& Acts::DiscLayer::surfaceRepresentation() {
0062 return (*this);
0063 }
0064
0065 void Acts::DiscLayer::buildApproachDescriptor() {
0066
0067 m_approachDescriptor.reset(nullptr);
0068
0069 if (m_representingVolume != nullptr) {
0070
0071 std::vector<OrientedSurface> bSurfaces =
0072 m_representingVolume->volumeBounds().orientedSurfaces(
0073 m_representingVolume->transform());
0074
0075 std::vector<std::shared_ptr<const Surface>> aSurfaces;
0076 aSurfaces.push_back(bSurfaces.at(negativeFaceXY).surface);
0077 aSurfaces.push_back(bSurfaces.at(positiveFaceXY).surface);
0078 aSurfaces.push_back(bSurfaces.at(tubeInnerCover).surface);
0079 aSurfaces.push_back(bSurfaces.at(tubeOuterCover).surface);
0080
0081 m_approachDescriptor =
0082 std::make_unique<const GenericApproachDescriptor>(std::move(aSurfaces));
0083 }
0084
0085
0086 for (auto& sfPtr : (m_approachDescriptor->containedSurfaces())) {
0087 if (sfPtr != nullptr) {
0088 auto& mutableSf = *(const_cast<Surface*>(sfPtr));
0089 mutableSf.associateLayer(*this);
0090 }
0091 }
0092 }