diff --git a/Core/include/Acts/Geometry/CutoutCylinderVolumeBounds.hpp b/Core/include/Acts/Geometry/CutoutCylinderVolumeBounds.hpp index fb9d6ca15a7..5d7278219da 100644 --- a/Core/include/Acts/Geometry/CutoutCylinderVolumeBounds.hpp +++ b/Core/include/Acts/Geometry/CutoutCylinderVolumeBounds.hpp @@ -15,7 +15,6 @@ #include #include #include -#include #include namespace Acts { @@ -47,8 +46,6 @@ class CutoutCylinderVolumeBounds : public VolumeBounds { eSize }; - CutoutCylinderVolumeBounds() = delete; - /// Constructor from defining parameters /// /// @param rmin Minimum radius at the "choke points" @@ -73,8 +70,6 @@ class CutoutCylinderVolumeBounds : public VolumeBounds { buildSurfaceBounds(); } - ~CutoutCylinderVolumeBounds() override = default; - VolumeBounds::BoundsType type() const final { return VolumeBounds::eCutoutCylinder; } @@ -151,24 +146,4 @@ class CutoutCylinderVolumeBounds : public VolumeBounds { void checkConsistency() noexcept(false); }; -inline std::vector CutoutCylinderVolumeBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; -} - -inline void CutoutCylinderVolumeBounds::checkConsistency() noexcept(false) { - if (get(eMinR) < 0. || get(eMedR) <= 0. || get(eMaxR) <= 0. || - get(eMinR) >= get(eMedR) || get(eMinR) >= get(eMaxR) || - get(eMedR) >= get(eMaxR)) { - throw std::invalid_argument( - "CutoutCylinderVolumeBounds: invalid radial input."); - } - if (get(eHalfLengthZ) <= 0 || get(eHalfLengthZcutout) <= 0. || - get(eHalfLengthZcutout) > get(eHalfLengthZ)) { - throw std::invalid_argument( - "CutoutCylinderVolumeBounds: invalid longitudinal input."); - } -} - } // namespace Acts diff --git a/Core/include/Acts/Surfaces/AnnulusBounds.hpp b/Core/include/Acts/Surfaces/AnnulusBounds.hpp index 7e60434f02b..b4add490313 100644 --- a/Core/include/Acts/Surfaces/AnnulusBounds.hpp +++ b/Core/include/Acts/Surfaces/AnnulusBounds.hpp @@ -70,9 +70,7 @@ class AnnulusBounds : public DiscBounds { AnnulusBounds(const AnnulusBounds& source) = default; - SurfaceBounds::BoundsType type() const final { - return SurfaceBounds::eAnnulus; - } + BoundsType type() const final { return SurfaceBounds::eAnnulus; } /// Return the bound values as dynamically sized vector /// diff --git a/Core/include/Acts/Surfaces/ConeBounds.hpp b/Core/include/Acts/Surfaces/ConeBounds.hpp index df926d49945..7d852f2df87 100644 --- a/Core/include/Acts/Surfaces/ConeBounds.hpp +++ b/Core/include/Acts/Surfaces/ConeBounds.hpp @@ -116,6 +116,8 @@ class ConeBounds : public SurfaceBounds { /// Private helper function to shift a local 2D position /// + /// Shift r-phi coordinate to be centered around the average phi. + /// /// @param lposition The original local position Vector2 shifted(const Vector2& lposition) const; }; diff --git a/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp b/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp index 03e8228d97e..afb5bb406f9 100644 --- a/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp +++ b/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp @@ -95,7 +95,7 @@ class ConvexPolygonBounds : public ConvexPolygonBoundsBase { /// @param values The values to build up the vertices ConvexPolygonBounds(const value_array& values) noexcept(false); - BoundsType type() const final; + BoundsType type() const final { return SurfaceBounds::eConvexPolygon; } /// Return whether a local 2D point lies inside of the bounds defined by this /// object. @@ -146,7 +146,7 @@ class ConvexPolygonBounds : public ConvexPolygonBoundsBase { /// Return the bounds type of this bounds object. /// @return The bounds type - BoundsType type() const final; + BoundsType type() const final { return SurfaceBounds::eConvexPolygon; } /// Return whether a local 2D point lies inside of the bounds defined by this /// object. diff --git a/Core/include/Acts/Surfaces/ConvexPolygonBounds.ipp b/Core/include/Acts/Surfaces/ConvexPolygonBounds.ipp index 47f385061bd..8201a9dedd6 100644 --- a/Core/include/Acts/Surfaces/ConvexPolygonBounds.ipp +++ b/Core/include/Acts/Surfaces/ConvexPolygonBounds.ipp @@ -92,11 +92,6 @@ Acts::ConvexPolygonBounds::ConvexPolygonBounds( checkConsistency(); } -template -Acts::SurfaceBounds::BoundsType Acts::ConvexPolygonBounds::type() const { - return SurfaceBounds::eConvexPolygon; -} - template bool Acts::ConvexPolygonBounds::inside( const Acts::Vector2& lposition, diff --git a/Core/include/Acts/Surfaces/CylinderBounds.hpp b/Core/include/Acts/Surfaces/CylinderBounds.hpp index f10078b995d..10fab504635 100644 --- a/Core/include/Acts/Surfaces/CylinderBounds.hpp +++ b/Core/include/Acts/Surfaces/CylinderBounds.hpp @@ -83,7 +83,7 @@ class CylinderBounds : public SurfaceBounds { checkConsistency(); } - BoundsType type() const final; + BoundsType type() const final { return SurfaceBounds::eCylinder; } /// Return the bound values as dynamically sized vector /// diff --git a/Core/include/Acts/Surfaces/DiamondBounds.hpp b/Core/include/Acts/Surfaces/DiamondBounds.hpp index eb613f6610a..096efc2dd27 100644 --- a/Core/include/Acts/Surfaces/DiamondBounds.hpp +++ b/Core/include/Acts/Surfaces/DiamondBounds.hpp @@ -66,7 +66,7 @@ class DiamondBounds : public PlanarBounds { Vector2{*std::max_element(values.begin(), values.begin() + 2), values[eHalfLengthYpos]}) {} - BoundsType type() const final; + BoundsType type() const final { return SurfaceBounds::eDiamond; } /// Return the bound values as dynamically sized vector /// diff --git a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp index e0f630611b6..e4d2800090a 100644 --- a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp +++ b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp @@ -59,7 +59,7 @@ class DiscTrapezoidBounds : public DiscBounds { checkConsistency(); } - SurfaceBounds::BoundsType type() const final; + BoundsType type() const final { return SurfaceBounds::eDiscTrapezoid; } /// Return the bound values as dynamically sized vector /// diff --git a/Core/include/Acts/Surfaces/EllipseBounds.hpp b/Core/include/Acts/Surfaces/EllipseBounds.hpp index 2b96fe2b228..337cb5b04af 100644 --- a/Core/include/Acts/Surfaces/EllipseBounds.hpp +++ b/Core/include/Acts/Surfaces/EllipseBounds.hpp @@ -68,7 +68,7 @@ class EllipseBounds : public PlanarBounds { checkConsistency(); } - BoundsType type() const final; + BoundsType type() const final { return SurfaceBounds::eEllipse; } /// Return the bound values as dynamically sized vector /// @@ -79,6 +79,8 @@ class EllipseBounds : public PlanarBounds { /// two ellipsoids if only tol0 is given and additional in the phi sector is /// tol1 is given /// + /// @warning This **only** works for tolerance-based checks + /// /// @param lposition Local position (assumed to be in right surface frame) /// @param boundaryTolerance boundary check directive /// @return boolean indicator for the success of this operation diff --git a/Core/include/Acts/Surfaces/InfiniteBounds.hpp b/Core/include/Acts/Surfaces/InfiniteBounds.hpp index 28737b7c8ab..e08ff779cbf 100644 --- a/Core/include/Acts/Surfaces/InfiniteBounds.hpp +++ b/Core/include/Acts/Surfaces/InfiniteBounds.hpp @@ -20,9 +20,7 @@ namespace Acts { /// class InfiniteBounds : public SurfaceBounds { public: - SurfaceBounds::BoundsType type() const final { - return SurfaceBounds::eBoundless; - } + BoundsType type() const final { return SurfaceBounds::eBoundless; } std::vector values() const final { return {}; } diff --git a/Core/include/Acts/Surfaces/LineBounds.hpp b/Core/include/Acts/Surfaces/LineBounds.hpp index 96876e6b4b1..76eefd95c74 100644 --- a/Core/include/Acts/Surfaces/LineBounds.hpp +++ b/Core/include/Acts/Surfaces/LineBounds.hpp @@ -42,7 +42,7 @@ class LineBounds : public SurfaceBounds { checkConsistency(); } - BoundsType type() const final; + BoundsType type() const final { return SurfaceBounds::eLine; } /// Return the bound values as dynamically sized vector /// @@ -77,19 +77,4 @@ class LineBounds : public SurfaceBounds { void checkConsistency() noexcept(false); }; -inline std::vector LineBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; -} - -inline void LineBounds::checkConsistency() noexcept(false) { - if (get(eR) < 0.) { - throw std::invalid_argument("LineBounds: zero radius."); - } - if (get(eHalfLengthZ) <= 0.) { - throw std::invalid_argument("LineBounds: zero/negative length."); - } -} - } // namespace Acts diff --git a/Core/include/Acts/Surfaces/RadialBounds.hpp b/Core/include/Acts/Surfaces/RadialBounds.hpp index bd4b94db7d6..f10884e5b75 100644 --- a/Core/include/Acts/Surfaces/RadialBounds.hpp +++ b/Core/include/Acts/Surfaces/RadialBounds.hpp @@ -56,7 +56,7 @@ class RadialBounds : public DiscBounds { checkConsistency(); } - SurfaceBounds::BoundsType type() const final; + BoundsType type() const final { return SurfaceBounds::eDisc; } /// Return the bound values as dynamically sized vector /// diff --git a/Core/include/Acts/Surfaces/TrapezoidBounds.hpp b/Core/include/Acts/Surfaces/TrapezoidBounds.hpp index 53e2dd15d12..f8bfebe2971 100644 --- a/Core/include/Acts/Surfaces/TrapezoidBounds.hpp +++ b/Core/include/Acts/Surfaces/TrapezoidBounds.hpp @@ -51,7 +51,7 @@ class TrapezoidBounds : public PlanarBounds { /// @param values the values to be stream in TrapezoidBounds(const std::array& values) noexcept(false); - BoundsType type() const final; + BoundsType type() const final { return SurfaceBounds::eTrapezoid; } std::vector values() const final; diff --git a/Core/src/Geometry/ConeVolumeBounds.cpp b/Core/src/Geometry/ConeVolumeBounds.cpp index ebc1262c1b8..425166abcd0 100644 --- a/Core/src/Geometry/ConeVolumeBounds.cpp +++ b/Core/src/Geometry/ConeVolumeBounds.cpp @@ -26,10 +26,10 @@ #include #include #include -#include #include namespace Acts { + ConeVolumeBounds::ConeVolumeBounds(double innerAlpha, double innerOffsetZ, double outerAlpha, double outerOffsetZ, double halflengthZ, double averagePhi, @@ -92,6 +92,10 @@ ConeVolumeBounds::ConeVolumeBounds(double cylinderR, double alpha, checkConsistency(); } +std::vector ConeVolumeBounds::values() const { + return {m_values.begin(), m_values.end()}; +} + std::vector Acts::ConeVolumeBounds::orientedSurfaces( const Transform3& transform) const { std::vector oSurfaces; @@ -334,10 +338,4 @@ double ConeVolumeBounds::outerTanAlpha() const { return m_outerTanAlpha; } -std::vector ConeVolumeBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; -} - } // namespace Acts diff --git a/Core/src/Geometry/CuboidVolumeBounds.cpp b/Core/src/Geometry/CuboidVolumeBounds.cpp index be2443c9691..a8b1729c74a 100644 --- a/Core/src/Geometry/CuboidVolumeBounds.cpp +++ b/Core/src/Geometry/CuboidVolumeBounds.cpp @@ -30,6 +30,10 @@ CuboidVolumeBounds::CuboidVolumeBounds(const std::array& values) buildSurfaceBounds(); } +std::vector CuboidVolumeBounds::values() const { + return {m_values.begin(), m_values.end()}; +} + std::vector Acts::CuboidVolumeBounds::orientedSurfaces( const Transform3& transform) const { std::vector oSurfaces; @@ -119,12 +123,6 @@ bool CuboidVolumeBounds::inside(const Vector3& pos, double tol) const { std::abs(pos.z()) <= get(eHalfLengthZ) + tol); } -std::vector CuboidVolumeBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; -} - void CuboidVolumeBounds::checkConsistency() noexcept(false) { if (get(eHalfLengthX) <= 0 || get(eHalfLengthY) <= 0 || get(eHalfLengthZ) <= 0.) { diff --git a/Core/src/Geometry/CutoutCylinderVolumeBounds.cpp b/Core/src/Geometry/CutoutCylinderVolumeBounds.cpp index 9d70f49b4b9..62033200b58 100644 --- a/Core/src/Geometry/CutoutCylinderVolumeBounds.cpp +++ b/Core/src/Geometry/CutoutCylinderVolumeBounds.cpp @@ -23,11 +23,30 @@ #include #include -#include +#include #include -bool Acts::CutoutCylinderVolumeBounds::inside(const Acts::Vector3& gpos, - double tol) const { +namespace Acts { + +std::vector CutoutCylinderVolumeBounds::values() const { + return {m_values.begin(), m_values.end()}; +} + +void CutoutCylinderVolumeBounds::checkConsistency() noexcept(false) { + if (get(eMinR) < 0. || get(eMedR) <= 0. || get(eMaxR) <= 0. || + get(eMinR) >= get(eMedR) || get(eMinR) >= get(eMaxR) || + get(eMedR) >= get(eMaxR)) { + throw std::invalid_argument( + "CutoutCylinderVolumeBounds: invalid radial input."); + } + if (get(eHalfLengthZ) <= 0 || get(eHalfLengthZcutout) <= 0. || + get(eHalfLengthZcutout) > get(eHalfLengthZ)) { + throw std::invalid_argument( + "CutoutCylinderVolumeBounds: invalid longitudinal input."); + } +} + +bool CutoutCylinderVolumeBounds::inside(const Vector3& gpos, double tol) const { // first check whether we are in the outer envelope at all (ignore r_med) using VectorHelpers::perp; using VectorHelpers::phi; @@ -48,8 +67,7 @@ bool Acts::CutoutCylinderVolumeBounds::inside(const Acts::Vector3& gpos, return !insideRInner || !insideZInner; // we are not, inside bounds } -std::vector -Acts::CutoutCylinderVolumeBounds::orientedSurfaces( +std::vector CutoutCylinderVolumeBounds::orientedSurfaces( const Transform3& transform) const { std::vector oSurfaces; @@ -122,9 +140,9 @@ Acts::CutoutCylinderVolumeBounds::orientedSurfaces( return oSurfaces; } -Acts::Volume::BoundingBox Acts::CutoutCylinderVolumeBounds::boundingBox( - const Acts::Transform3* trf, const Acts::Vector3& envelope, - const Acts::Volume* entity) const { +Volume::BoundingBox CutoutCylinderVolumeBounds::boundingBox( + const Transform3* trf, const Vector3& envelope, + const Volume* entity) const { Vector3 vmin, vmax; // no phi sector is possible, so this is just the outer size of @@ -133,21 +151,20 @@ Acts::Volume::BoundingBox Acts::CutoutCylinderVolumeBounds::boundingBox( vmax = {get(eMaxR), get(eMaxR), get(eHalfLengthZ)}; vmin = {-get(eMaxR), -get(eMaxR), -get(eHalfLengthZ)}; - Acts::Volume::BoundingBox box(entity, vmin - envelope, vmax + envelope); + Volume::BoundingBox box(entity, vmin - envelope, vmax + envelope); // transform at the very end, if required return trf == nullptr ? box : box.transformed(*trf); } -std::ostream& Acts::CutoutCylinderVolumeBounds::toStream( - std::ostream& sl) const { - sl << "Acts::CutoutCylinderVolumeBounds(\n"; +std::ostream& CutoutCylinderVolumeBounds::toStream(std::ostream& sl) const { + sl << "CutoutCylinderVolumeBounds(\n"; sl << "rmin = " << get(eMinR) << " rmed = " << get(eMedR) << " rmax = " << get(eMaxR) << "\n"; sl << "dz1 = " << get(eHalfLengthZ) << " dz2 = " << get(eHalfLengthZcutout); return sl; } -void Acts::CutoutCylinderVolumeBounds::buildSurfaceBounds() { +void CutoutCylinderVolumeBounds::buildSurfaceBounds() { if (get(eMinR) > s_epsilon) { double hlChoke = (get(eHalfLengthZ) - get(eHalfLengthZcutout)) * 0.5; m_innerCylinderBounds = @@ -164,3 +181,5 @@ void Acts::CutoutCylinderVolumeBounds::buildSurfaceBounds() { m_outerDiscBounds = std::make_shared(get(eMinR), get(eMaxR)); } + +} // namespace Acts diff --git a/Core/src/Geometry/CylinderVolumeBounds.cpp b/Core/src/Geometry/CylinderVolumeBounds.cpp index 672304fd996..00a4c71f882 100644 --- a/Core/src/Geometry/CylinderVolumeBounds.cpp +++ b/Core/src/Geometry/CylinderVolumeBounds.cpp @@ -252,9 +252,7 @@ double CylinderVolumeBounds::binningBorder(BinningValue bValue) const { } std::vector CylinderVolumeBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; + return {m_values.begin(), m_values.end()}; } void CylinderVolumeBounds::checkConsistency() { diff --git a/Core/src/Geometry/TrapezoidVolumeBounds.cpp b/Core/src/Geometry/TrapezoidVolumeBounds.cpp index f03af8c85c0..2034ce6f302 100644 --- a/Core/src/Geometry/TrapezoidVolumeBounds.cpp +++ b/Core/src/Geometry/TrapezoidVolumeBounds.cpp @@ -54,6 +54,10 @@ TrapezoidVolumeBounds::TrapezoidVolumeBounds(double minhalex, double haley, buildSurfaceBounds(); } +std::vector TrapezoidVolumeBounds::values() const { + return {m_values.begin(), m_values.end()}; +} + std::vector TrapezoidVolumeBounds::orientedSurfaces( const Transform3& transform) const { std::vector oSurfaces; @@ -198,12 +202,6 @@ Volume::BoundingBox TrapezoidVolumeBounds::boundingBox( return {entity, vmin - envelope, vmax + envelope}; } -std::vector TrapezoidVolumeBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; -} - void TrapezoidVolumeBounds::checkConsistency() noexcept(false) { if (get(eHalfLengthXnegY) < 0. || get(eHalfLengthXposY) < 0.) { throw std::invalid_argument( diff --git a/Core/src/Surfaces/AnnulusBounds.cpp b/Core/src/Surfaces/AnnulusBounds.cpp index 58d4201b64a..cdccdac0443 100644 --- a/Core/src/Surfaces/AnnulusBounds.cpp +++ b/Core/src/Surfaces/AnnulusBounds.cpp @@ -97,9 +97,7 @@ AnnulusBounds::AnnulusBounds(const std::array& values) noexcept( } std::vector AnnulusBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; + return {m_values.begin(), m_values.end()}; } void AnnulusBounds::checkConsistency() noexcept(false) { diff --git a/Core/src/Surfaces/ConeBounds.cpp b/Core/src/Surfaces/ConeBounds.cpp index a900f6e1cfd..3609ff30d82 100644 --- a/Core/src/Surfaces/ConeBounds.cpp +++ b/Core/src/Surfaces/ConeBounds.cpp @@ -42,9 +42,7 @@ ConeBounds::ConeBounds(const std::array& values) noexcept(false) } std::vector ConeBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; + return {m_values.begin(), m_values.end()}; } void ConeBounds::checkConsistency() noexcept(false) { @@ -63,7 +61,6 @@ void ConeBounds::checkConsistency() noexcept(false) { } } -/// Shift r-phi coordinate to be centered around the average phi. Vector2 ConeBounds::shifted(const Vector2& lposition) const { using detail::radian_sym; diff --git a/Core/src/Surfaces/ConvexPolygonBounds.cpp b/Core/src/Surfaces/ConvexPolygonBounds.cpp index 7f90439b36e..d48dfaf7030 100644 --- a/Core/src/Surfaces/ConvexPolygonBounds.cpp +++ b/Core/src/Surfaces/ConvexPolygonBounds.cpp @@ -45,10 +45,6 @@ ConvexPolygonBounds::ConvexPolygonBounds( : m_vertices(vertices.begin(), vertices.end()), m_boundingBox(makeBoundingBox(vertices)) {} -SurfaceBounds::BoundsType ConvexPolygonBounds::type() const { - return SurfaceBounds::eConvexPolygon; -} - bool ConvexPolygonBounds::inside( const Vector2& lposition, const BoundaryTolerance& boundaryTolerance) const { diff --git a/Core/src/Surfaces/CurvilinearSurface.cpp b/Core/src/Surfaces/CurvilinearSurface.cpp index 7a77ab1396e..899eee5f6f4 100644 --- a/Core/src/Surfaces/CurvilinearSurface.cpp +++ b/Core/src/Surfaces/CurvilinearSurface.cpp @@ -24,10 +24,10 @@ bool CurvilinearSurface::isStandardRepresentation() const { } RotationMatrix3 CurvilinearSurface::referenceFrame() const { - /// the right-handed coordinate system is defined as - /// T = normal - /// U = Z x T if T not parallel to Z otherwise U = X x T - /// V = T x U + // the right-handed coordinate system is defined as + // T = normal + // U = Z x T if T not parallel to Z otherwise U = X x T + // V = T x U Vector3 T = m_direction.normalized(); Vector3 U = (isStandardRepresentation() ? Vector3::UnitZ() : Vector3::UnitX()) .cross(T) diff --git a/Core/src/Surfaces/CylinderBounds.cpp b/Core/src/Surfaces/CylinderBounds.cpp index 0402539a47b..fbc50bac1d6 100644 --- a/Core/src/Surfaces/CylinderBounds.cpp +++ b/Core/src/Surfaces/CylinderBounds.cpp @@ -27,14 +27,8 @@ namespace Acts { using VectorHelpers::perp; using VectorHelpers::phi; -SurfaceBounds::BoundsType CylinderBounds::type() const { - return SurfaceBounds::eCylinder; -} - std::vector CylinderBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; + return {m_values.begin(), m_values.end()}; } Vector2 CylinderBounds::shifted(const Vector2& lposition) const { @@ -127,7 +121,7 @@ std::vector CylinderBounds::circleVertices( // Write the two bows/circles on either side std::vector sides = {-1, 1}; for (auto& side : sides) { - /// Helper method to create the segment + // Helper method to create the segment auto svertices = detail::VerticesHelper::segmentVertices( {get(eR), get(eR)}, avgPhi - halfPhi, avgPhi + halfPhi, phiRef, quarterSegments, Vector3(0., 0., side * get(eHalfLengthZ)), transform); diff --git a/Core/src/Surfaces/CylinderSurface.cpp b/Core/src/Surfaces/CylinderSurface.cpp index d07fc71f86b..c5e84140c43 100644 --- a/Core/src/Surfaces/CylinderSurface.cpp +++ b/Core/src/Surfaces/CylinderSurface.cpp @@ -57,7 +57,7 @@ CylinderSurface::CylinderSurface(const Transform3& transform, double radius, CylinderSurface::CylinderSurface(std::shared_ptr cbounds, const DetectorElementBase& detelement) : RegularSurface(detelement), m_bounds(std::move(cbounds)) { - /// surfaces representing a detector element must have bounds + // surfaces representing a detector element must have bounds throw_assert(m_bounds, "CylinderBounds must not be nullptr"); } diff --git a/Core/src/Surfaces/DiamondBounds.cpp b/Core/src/Surfaces/DiamondBounds.cpp index e93e87f9d06..78ff02c8c4a 100644 --- a/Core/src/Surfaces/DiamondBounds.cpp +++ b/Core/src/Surfaces/DiamondBounds.cpp @@ -19,14 +19,8 @@ namespace Acts { -SurfaceBounds::BoundsType DiamondBounds::type() const { - return SurfaceBounds::eDiamond; -} - std::vector DiamondBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; + return {m_values.begin(), m_values.end()}; } void DiamondBounds::checkConsistency() noexcept(false) { diff --git a/Core/src/Surfaces/DiscSurface.cpp b/Core/src/Surfaces/DiscSurface.cpp index 015567b4b60..06d316b80b5 100644 --- a/Core/src/Surfaces/DiscSurface.cpp +++ b/Core/src/Surfaces/DiscSurface.cpp @@ -365,7 +365,7 @@ double DiscSurface::binningPositionValue(const GeometryContext& gctx, double DiscSurface::pathCorrection(const GeometryContext& gctx, const Vector3& /*position*/, const Vector3& direction) const { - /// we can ignore the global position here + // we can ignore the global position here return 1. / std::abs(normal(gctx).dot(direction)); } diff --git a/Core/src/Surfaces/DiscTrapezoidBounds.cpp b/Core/src/Surfaces/DiscTrapezoidBounds.cpp index 394d73af0e3..344dff3573a 100644 --- a/Core/src/Surfaces/DiscTrapezoidBounds.cpp +++ b/Core/src/Surfaces/DiscTrapezoidBounds.cpp @@ -30,14 +30,8 @@ DiscTrapezoidBounds::DiscTrapezoidBounds(double halfXminR, double halfXmaxR, get(eHalfLengthXmaxR) * get(eHalfLengthXmaxR)); } -SurfaceBounds::BoundsType DiscTrapezoidBounds::type() const { - return SurfaceBounds::eDiscTrapezoid; -} - std::vector DiscTrapezoidBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; + return {m_values.begin(), m_values.end()}; } void DiscTrapezoidBounds::checkConsistency() noexcept(false) { diff --git a/Core/src/Surfaces/EllipseBounds.cpp b/Core/src/Surfaces/EllipseBounds.cpp index ebfd9cb23fe..435196a611a 100644 --- a/Core/src/Surfaces/EllipseBounds.cpp +++ b/Core/src/Surfaces/EllipseBounds.cpp @@ -23,14 +23,8 @@ namespace Acts { using VectorHelpers::perp; using VectorHelpers::phi; -SurfaceBounds::BoundsType EllipseBounds::type() const { - return SurfaceBounds::eEllipse; -} - std::vector EllipseBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; + return {m_values.begin(), m_values.end()}; } void EllipseBounds::checkConsistency() noexcept(false) { @@ -50,7 +44,6 @@ void EllipseBounds::checkConsistency() noexcept(false) { } } -/// @warning This **only** works for tolerance-based checks bool EllipseBounds::inside(const Vector2& lposition, const BoundaryTolerance& boundaryTolerance) const { if (boundaryTolerance.isInfinite()) { diff --git a/Core/src/Surfaces/LineBounds.cpp b/Core/src/Surfaces/LineBounds.cpp index 62784cefc32..de6dae7658d 100644 --- a/Core/src/Surfaces/LineBounds.cpp +++ b/Core/src/Surfaces/LineBounds.cpp @@ -16,8 +16,17 @@ namespace Acts { -SurfaceBounds::BoundsType LineBounds::type() const { - return SurfaceBounds::eLine; +std::vector LineBounds::values() const { + return {m_values.begin(), m_values.end()}; +} + +void LineBounds::checkConsistency() noexcept(false) { + if (get(eR) < 0.) { + throw std::invalid_argument("LineBounds: zero radius."); + } + if (get(eHalfLengthZ) <= 0.) { + throw std::invalid_argument("LineBounds: zero/negative length."); + } } bool LineBounds::inside(const Vector2& lposition, diff --git a/Core/src/Surfaces/PlaneSurface.cpp b/Core/src/Surfaces/PlaneSurface.cpp index f3c0dbd542b..301f5955210 100644 --- a/Core/src/Surfaces/PlaneSurface.cpp +++ b/Core/src/Surfaces/PlaneSurface.cpp @@ -43,7 +43,7 @@ PlaneSurface::PlaneSurface(const GeometryContext& gctx, PlaneSurface::PlaneSurface(std::shared_ptr pbounds, const DetectorElementBase& detelement) : RegularSurface(detelement), m_bounds(std::move(pbounds)) { - /// surfaces representing a detector element must have bounds + // surfaces representing a detector element must have bounds throw_assert(m_bounds, "PlaneBounds must not be nullptr"); } diff --git a/Core/src/Surfaces/RadialBounds.cpp b/Core/src/Surfaces/RadialBounds.cpp index 897c3e0381d..93bfd803ce0 100644 --- a/Core/src/Surfaces/RadialBounds.cpp +++ b/Core/src/Surfaces/RadialBounds.cpp @@ -20,14 +20,8 @@ namespace Acts { -SurfaceBounds::BoundsType RadialBounds::type() const { - return SurfaceBounds::eDisc; -} - std::vector RadialBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; + return {m_values.begin(), m_values.end()}; } void RadialBounds::checkConsistency() noexcept(false) { diff --git a/Core/src/Surfaces/StrawSurface.cpp b/Core/src/Surfaces/StrawSurface.cpp index 9b28accf85f..8a004b31354 100644 --- a/Core/src/Surfaces/StrawSurface.cpp +++ b/Core/src/Surfaces/StrawSurface.cpp @@ -61,7 +61,7 @@ Polyhedron StrawSurface::polyhedronRepresentation( // Write the two bows/circles on either side std::vector sides = {-1, 1}; for (auto& side : sides) { - /// Helper method to create the segment + // Helper method to create the segment auto svertices = detail::VerticesHelper::segmentVertices( {r, r}, -std::numbers::pi, std::numbers::pi, {}, quarterSegments, Vector3(0., 0., side * m_bounds->get(LineBounds::eHalfLengthZ)), diff --git a/Core/src/Surfaces/TrapezoidBounds.cpp b/Core/src/Surfaces/TrapezoidBounds.cpp index d16f3a07dd5..73b082cefec 100644 --- a/Core/src/Surfaces/TrapezoidBounds.cpp +++ b/Core/src/Surfaces/TrapezoidBounds.cpp @@ -17,12 +17,6 @@ namespace Acts { -/// Constructor for symmetric Trapezoid -/// -/// @param halfXnegY minimal half length X, definition at negative Y -/// @param halfXposY maximal half length X, definition at positive Y -/// @param halfY half length Y - defined at x=0 -/// @param rotAngle: rotation angle of the bounds w.r.t coordinate axes TrapezoidBounds::TrapezoidBounds(double halfXnegY, double halfXposY, double halfY, double rotAngle) noexcept(false) : m_values({halfXnegY, halfXposY, halfY, rotAngle}), @@ -31,9 +25,6 @@ TrapezoidBounds::TrapezoidBounds(double halfXnegY, double halfXposY, checkConsistency(); } -/// Constructor for symmetric Trapezoid - from fixed size array -/// -/// @param values the values to be stream in TrapezoidBounds::TrapezoidBounds( const std::array& values) noexcept(false) : m_values(values), @@ -44,8 +35,8 @@ TrapezoidBounds::TrapezoidBounds( checkConsistency(); } -SurfaceBounds::BoundsType TrapezoidBounds::type() const { - return SurfaceBounds::eTrapezoid; +std::vector TrapezoidBounds::values() const { + return {m_values.begin(), m_values.end()}; } bool TrapezoidBounds::inside(const Vector2& lposition, @@ -121,12 +112,6 @@ std::ostream& TrapezoidBounds::toStream(std::ostream& sl) const { return sl; } -std::vector TrapezoidBounds::values() const { - std::vector valvector; - valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); - return valvector; -} - void TrapezoidBounds::rotateBoundingBox() noexcept(false) { const double rotAngle = get(eRotationAngle);