diff --git a/Core/include/Acts/Geometry/CuboidVolumeBounds.hpp b/Core/include/Acts/Geometry/CuboidVolumeBounds.hpp index f883ff946f6ce91d02d4c05bd0606cd8a42dcaac..7c9622f3f19c2b83cecb60ddfed8007fff68249d 100644 --- a/Core/include/Acts/Geometry/CuboidVolumeBounds.hpp +++ b/Core/include/Acts/Geometry/CuboidVolumeBounds.hpp @@ -127,7 +127,7 @@ class CuboidVolumeBounds : public VolumeBounds { std::shared_ptr<const RectangleBounds> faceZXRectangleBounds() const; /// The bound values - std::vector<double> m_boundValues; + std::vector<double> m_values; std::shared_ptr<const RectangleBounds> m_xyBounds; std::shared_ptr<const RectangleBounds> m_yzBounds; std::shared_ptr<const RectangleBounds> m_zxBounds; @@ -138,21 +138,21 @@ inline CuboidVolumeBounds* CuboidVolumeBounds::clone() const { } inline bool CuboidVolumeBounds::inside(const Vector3D& pos, double tol) const { - return (std::abs(pos.x()) <= m_boundValues.at(bv_halfX) + tol && - std::abs(pos.y()) <= m_boundValues.at(bv_halfY) + tol && - std::abs(pos.z()) <= m_boundValues.at(bv_halfZ) + tol); + return (std::abs(pos.x()) <= m_values.at(bv_halfX) + tol && + std::abs(pos.y()) <= m_values.at(bv_halfY) + tol && + std::abs(pos.z()) <= m_values.at(bv_halfZ) + tol); } inline double CuboidVolumeBounds::halflengthX() const { - return m_boundValues.at(bv_halfX); + return m_values.at(bv_halfX); } inline double CuboidVolumeBounds::halflengthY() const { - return m_boundValues.at(bv_halfY); + return m_values.at(bv_halfY); } inline double CuboidVolumeBounds::halflengthZ() const { - return m_boundValues.at(bv_halfZ); + return m_values.at(bv_halfZ); } template <class T> @@ -160,8 +160,8 @@ T& CuboidVolumeBounds::dumpT(T& dt) const { dt << std::setiosflags(std::ios::fixed); dt << std::setprecision(5); dt << "Acts::CuboidVolumeBounds: (halfX, halfY, halfZ) = "; - dt << "(" << m_boundValues.at(bv_halfX) << ", " << m_boundValues.at(bv_halfY) - << ", " << m_boundValues.at(bv_halfZ) << ")"; + dt << "(" << m_values.at(bv_halfX) << ", " << m_values.at(bv_halfY) << ", " + << m_values.at(bv_halfZ) << ")"; return dt; } } // namespace Acts \ No newline at end of file diff --git a/Core/include/Acts/Geometry/CylinderVolumeBounds.hpp b/Core/include/Acts/Geometry/CylinderVolumeBounds.hpp index 6162677aa815252ced09d092966061065b253da3..1ed77ae6263438077f4c977db25f25e81f8851a9 100644 --- a/Core/include/Acts/Geometry/CylinderVolumeBounds.hpp +++ b/Core/include/Acts/Geometry/CylinderVolumeBounds.hpp @@ -205,7 +205,7 @@ class CylinderVolumeBounds : public VolumeBounds { std::shared_ptr<const PlanarBounds> sectorPlaneBounds() const; /// The internal version of the bounds can be float/double - std::vector<double> m_boundValues; + std::vector<double> m_values; /// numerical stability /// @todo unify the numerical stability checks @@ -221,12 +221,12 @@ inline bool CylinderVolumeBounds::inside(const Vector3D& pos, using VectorHelpers::perp; using VectorHelpers::phi; double ros = perp(pos); - bool insidePhi = cos(phi(pos)) >= cos(m_boundValues[bv_halfPhiSector]) - tol; - bool insideR = insidePhi ? ((ros >= m_boundValues[bv_innerRadius] - tol) && - (ros <= m_boundValues[bv_outerRadius] + tol)) + bool insidePhi = cos(phi(pos)) >= cos(m_values[bv_halfPhiSector]) - tol; + bool insideR = insidePhi ? ((ros >= m_values[bv_innerRadius] - tol) && + (ros <= m_values[bv_outerRadius] + tol)) : false; bool insideZ = - insideR ? (std::abs(pos.z()) <= m_boundValues[bv_halfZ] + tol) : false; + insideR ? (std::abs(pos.z()) <= m_values[bv_halfZ] + tol) : false; return (insideZ && insideR && insidePhi); } @@ -250,28 +250,27 @@ inline double CylinderVolumeBounds::binningBorder(BinningValue bValue) } inline double CylinderVolumeBounds::innerRadius() const { - return m_boundValues.at(bv_innerRadius); + return m_values.at(bv_innerRadius); } inline double CylinderVolumeBounds::outerRadius() const { - return m_boundValues.at(bv_outerRadius); + return m_values.at(bv_outerRadius); } inline double CylinderVolumeBounds::mediumRadius() const { - return 0.5 * - (m_boundValues.at(bv_innerRadius) + m_boundValues.at(bv_outerRadius)); + return 0.5 * (m_values.at(bv_innerRadius) + m_values.at(bv_outerRadius)); } inline double CylinderVolumeBounds::deltaRadius() const { - return (m_boundValues.at(bv_outerRadius) - m_boundValues.at(bv_innerRadius)); + return (m_values.at(bv_outerRadius) - m_values.at(bv_innerRadius)); } inline double CylinderVolumeBounds::halfPhiSector() const { - return m_boundValues.at(bv_halfPhiSector); + return m_values.at(bv_halfPhiSector); } inline double CylinderVolumeBounds::halflengthZ() const { - return m_boundValues.at(bv_halfZ); + return m_values.at(bv_halfZ); } template <class T> @@ -279,10 +278,9 @@ T& CylinderVolumeBounds::dumpT(T& tstream) const { tstream << std::setiosflags(std::ios::fixed); tstream << std::setprecision(5); tstream << "Acts::CylinderVolumeBounds: (rMin, rMax, halfPhi, halfZ) = "; - tstream << m_boundValues.at(bv_innerRadius) << ", " - << m_boundValues.at(bv_outerRadius) << ", " - << m_boundValues.at(bv_halfPhiSector) << ", " - << m_boundValues.at(bv_halfZ); + tstream << m_values.at(bv_innerRadius) << ", " << m_values.at(bv_outerRadius) + << ", " << m_values.at(bv_halfPhiSector) << ", " + << m_values.at(bv_halfZ); return tstream; } } // namespace Acts \ No newline at end of file diff --git a/Core/include/Acts/Geometry/DoubleTrapezoidVolumeBounds.hpp b/Core/include/Acts/Geometry/DoubleTrapezoidVolumeBounds.hpp index 0b14f1d0711a6db6fd3b02a5cfbeca8a0d321e4f..3355393eb070bb8f6330d84b8c75ae1810935fb5 100644 --- a/Core/include/Acts/Geometry/DoubleTrapezoidVolumeBounds.hpp +++ b/Core/include/Acts/Geometry/DoubleTrapezoidVolumeBounds.hpp @@ -188,7 +188,7 @@ class DoubleTrapezoidVolumeBounds : public VolumeBounds { /// parallel to local zx plane, positive local y RectangleBounds* faceZXRectangleBoundsTop() const; - std::vector<double> m_boundValues; ///< the internal store + std::vector<double> m_values; ///< the internal store }; inline DoubleTrapezoidVolumeBounds* DoubleTrapezoidVolumeBounds::clone() const { @@ -196,35 +196,35 @@ inline DoubleTrapezoidVolumeBounds* DoubleTrapezoidVolumeBounds::clone() const { } inline double DoubleTrapezoidVolumeBounds::minHalflengthX() const { - return m_boundValues.at(bv_minHalfX); + return m_values.at(bv_minHalfX); } inline double DoubleTrapezoidVolumeBounds::medHalflengthX() const { - return m_boundValues.at(bv_medHalfX); + return m_values.at(bv_medHalfX); } inline double DoubleTrapezoidVolumeBounds::maxHalflengthX() const { - return m_boundValues.at(bv_maxHalfX); + return m_values.at(bv_maxHalfX); } inline double DoubleTrapezoidVolumeBounds::halflengthY1() const { - return m_boundValues.at(bv_halfY1); + return m_values.at(bv_halfY1); } inline double DoubleTrapezoidVolumeBounds::halflengthY2() const { - return m_boundValues.at(bv_halfY2); + return m_values.at(bv_halfY2); } inline double DoubleTrapezoidVolumeBounds::halflengthZ() const { - return m_boundValues.at(bv_halfZ); + return m_values.at(bv_halfZ); } inline double DoubleTrapezoidVolumeBounds::alpha1() const { - return m_boundValues.at(bv_alpha1); + return m_values.at(bv_alpha1); } inline double DoubleTrapezoidVolumeBounds::alpha2() const { - return m_boundValues.at(bv_alpha2); + return m_values.at(bv_alpha2); } template <class T> @@ -233,11 +233,10 @@ T& DoubleTrapezoidVolumeBounds::dumpT(T& dT) const { dT << std::setprecision(5); dT << "Acts::DoubleTrapezoidVolumeBounds: (minhalfX, medhalfX, maxhalfX, " "halfY1, halfY2, halfZ) = "; - dT << "(" << m_boundValues.at(bv_minHalfX) << ", " - << m_boundValues.at(bv_medHalfX) << ", " << m_boundValues.at(bv_maxHalfX); - dT << ", " << m_boundValues.at(bv_halfY1) << ", " - << m_boundValues.at(bv_halfY2) << ", " << m_boundValues.at(bv_halfZ) - << ")"; + dT << "(" << m_values.at(bv_minHalfX) << ", " << m_values.at(bv_medHalfX) + << ", " << m_values.at(bv_maxHalfX); + dT << ", " << m_values.at(bv_halfY1) << ", " << m_values.at(bv_halfY2) << ", " + << m_values.at(bv_halfZ) << ")"; return dT; } } // namespace Acts \ No newline at end of file diff --git a/Core/include/Acts/Geometry/TrapezoidVolumeBounds.hpp b/Core/include/Acts/Geometry/TrapezoidVolumeBounds.hpp index 085ee6cf431e423a20acec411e593c96cddeaf1a..eb2320d96f12a9c0bc5446986c7f52cdd2ab2aee 100644 --- a/Core/include/Acts/Geometry/TrapezoidVolumeBounds.hpp +++ b/Core/include/Acts/Geometry/TrapezoidVolumeBounds.hpp @@ -170,7 +170,7 @@ class TrapezoidVolumeBounds : public VolumeBounds { RectangleBounds* faceZXRectangleBoundsTop() const; /// the bounds values - std::vector<double> m_boundValues; + std::vector<double> m_values; }; inline TrapezoidVolumeBounds* TrapezoidVolumeBounds::clone() const { @@ -178,22 +178,22 @@ inline TrapezoidVolumeBounds* TrapezoidVolumeBounds::clone() const { } inline double TrapezoidVolumeBounds::minHalflengthX() const { - return m_boundValues.at(bv_minHalfX); + return m_values.at(bv_minHalfX); } inline double TrapezoidVolumeBounds::maxHalflengthX() const { - return m_boundValues.at(bv_maxHalfX); + return m_values.at(bv_maxHalfX); } inline double TrapezoidVolumeBounds::halflengthY() const { - return m_boundValues.at(bv_halfY); + return m_values.at(bv_halfY); } inline double TrapezoidVolumeBounds::halflengthZ() const { - return m_boundValues.at(bv_halfZ); + return m_values.at(bv_halfZ); } inline double TrapezoidVolumeBounds::alpha() const { - return m_boundValues.at(bv_alpha); + return m_values.at(bv_alpha); } inline double TrapezoidVolumeBounds::beta() const { - return m_boundValues.at(bv_beta); + return m_values.at(bv_beta); } template <class T> @@ -202,10 +202,9 @@ T& TrapezoidVolumeBounds::dumpT(T& dt) const { dt << std::setprecision(5); dt << "Acts::TrapezoidVolumeBounds: (minhalfX, halfY, halfZ, alpha, beta) " "= "; - dt << "(" << m_boundValues.at(bv_minHalfX) << ", " - << m_boundValues.at(bv_halfY) << ", " << m_boundValues.at(bv_halfZ); - dt << ", " << m_boundValues.at(bv_alpha) << ", " << m_boundValues.at(bv_beta) - << ")"; + dt << "(" << m_values.at(bv_minHalfX) << ", " << m_values.at(bv_halfY) << ", " + << m_values.at(bv_halfZ); + dt << ", " << m_values.at(bv_alpha) << ", " << m_values.at(bv_beta) << ")"; return dt; } } // namespace Acts \ No newline at end of file diff --git a/Core/include/Acts/Geometry/VolumeBounds.hpp b/Core/include/Acts/Geometry/VolumeBounds.hpp index b1ba49f5c15bcdba8a1be9a899c36af02bd96694..c39a141b9d44371931bd090cc5025a7a0d0c3c2a 100644 --- a/Core/include/Acts/Geometry/VolumeBounds.hpp +++ b/Core/include/Acts/Geometry/VolumeBounds.hpp @@ -16,12 +16,12 @@ #include "Acts/Utilities/Definitions.hpp" #ifndef VOLUMEBOUNDS_boundValues_FILL -#define VOLUMEBOUNDS_boundValues_FILL(val) m_boundValues[bv_##val] = val +#define VOLUMEBOUNDS_boundValues_FILL(val) m_values[bv_##val] = val #endif #ifndef VOLUMEBOUNDS_boundValues_ACCESS #define VOLUMEBOUNDS_boundValues_ACCESS(val) \ - double val() const { return m_boundValues[bv_##val]; } + double val() const { return m_values[bv_##val]; } #endif #ifndef VOLUMEBOUNDS_DERIVED_ACCESS diff --git a/Core/include/Acts/Surfaces/AnnulusBounds.hpp b/Core/include/Acts/Surfaces/AnnulusBounds.hpp index 31839564bdd12f10ed870440f4a6af305fbba84a..1245a4b140fec2ba1db0096059e1d5ad0a245ae3 100644 --- a/Core/include/Acts/Surfaces/AnnulusBounds.hpp +++ b/Core/include/Acts/Surfaces/AnnulusBounds.hpp @@ -64,7 +64,7 @@ class AnnulusBounds : public DiscBounds { SurfaceBounds::BoundsType type() const final; /// This returns the stored values for persisitency - std::vector<double> boundValues() const final; + ActsVectorXd values() const final; /// Inside check for the bounds object driven by the boundary check directive /// Each Bounds has a method inside, which checks if a LocalPosition is inside diff --git a/Core/include/Acts/Surfaces/ConeBounds.hpp b/Core/include/Acts/Surfaces/ConeBounds.hpp index fddcaccb5d822c469914f33173795d2948aa2811..86a5988dae7f136ee929b7309f935d42b0d69339 100644 --- a/Core/include/Acts/Surfaces/ConeBounds.hpp +++ b/Core/include/Acts/Surfaces/ConeBounds.hpp @@ -34,7 +34,7 @@ class ConeBounds : public SurfaceBounds { eMaxZ = 2, eHalfPhiSector = 3, eAveragePhi = 4, - eValues = 5 + eSize = 5 }; ConeBounds() = delete; @@ -53,18 +53,18 @@ class ConeBounds : public SurfaceBounds { /// default a full cone but can optionally make it a conical section /// /// @param alpha is the opening angle of the cone - /// @param zmin cone expanding from minimal z - /// @param zmax cone expanding to maximal z + /// @param minz cone expanding from minimal z + /// @param maxz cone expanding to maximal z /// @param halfphi is the half opening angle (default is pi) /// @param avphi is the phi value around which the bounds are opened /// (default=0) - ConeBounds(double alpha, double zmin, double zmax, double halfphi = M_PI, + ConeBounds(double alpha, double minz, double maxz, double halfphi = M_PI, double avphi = 0.); /// Constructor - from parameters vector /// - /// @param parametes The parameter vector - ConeBounds(const std::vector<double>& parameters); + /// @param parameters The parameter vector + ConeBounds(const ActsVectorXd& parameters); ~ConeBounds() override = default; @@ -73,10 +73,10 @@ class ConeBounds : public SurfaceBounds { /// Return the bounds type BoundsType type() const final; - /// Return the bound values + /// Return the bound values as dynamically sized vector /// /// @return this returns a copy of the internal parameters - std::vector<double> boundValues() const final; + ActsVectorXd values() const final; /// inside method for local position /// @@ -107,14 +107,11 @@ class ConeBounds : public SurfaceBounds { /// Return tangent of alpha (pre-computed) double tanAlpha() const; - /// Templated access to the bound parameters - template <BoundValues bValue> - double get() const { - return m_parameters[bValue]; - } + /// Access to the bound parameters + double get(BoundValues bValue) const { return m_parameters[bValue]; } private: - std::vector<double> m_parameters; + ActsRowVectorD<eSize> m_parameters; double m_tanAlpha; /// Private helper functin to shift a local 2D position @@ -131,7 +128,7 @@ inline double ConeBounds::tanAlpha() const { return m_tanAlpha; } -inline std::vector<double> ConeBounds::boundValues() const { +inline ActsVectorXd ConeBounds::values() const { return m_parameters; } diff --git a/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp b/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp index c23dc711b699080f3ef69537c79db02f09610932..7389b14fee69b83ecd7c95986e0f2b1a67be210d 100644 --- a/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp +++ b/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp @@ -30,7 +30,7 @@ class ConvexPolygonBoundsBase : public PlanarBounds { /// Return vector containing defining parameters /// @return the parameters - std::vector<double> boundValues() const final; + ActsVectorXd values() const final; protected: /// Return a rectangle bounds instance that encloses a set of vertices. @@ -65,7 +65,6 @@ class ConvexPolygonBounds : public ConvexPolygonBoundsBase { public: static_assert(N >= 3, "ConvexPolygonBounds needs at least 3 sides."); - /// Default constructor, deleted ConvexPolygonBounds() = delete; /// Constructor from a vector of vertices, to facilitate construction. diff --git a/Core/include/Acts/Surfaces/ConvexPolygonBounds.ipp b/Core/include/Acts/Surfaces/ConvexPolygonBounds.ipp index 6c230a70b31860f224b6a19f11ec05b7d9d71b8d..10ab5b5f68171475af362a1fbb77edb6e5649fd3 100644 --- a/Core/include/Acts/Surfaces/ConvexPolygonBounds.ipp +++ b/Core/include/Acts/Surfaces/ConvexPolygonBounds.ipp @@ -37,11 +37,10 @@ Acts::RectangleBounds Acts::ConvexPolygonBoundsBase::makeBoundingBox( return {vmin, vmax}; } -std::vector<double> Acts::ConvexPolygonBoundsBase::boundValues() const { - std::vector<double> values; +Acts::ActsVectorXd Acts::ConvexPolygonBoundsBase::values() const { + ActsVectorXd values; for (const auto& vtx : vertices()) { - values.push_back(vtx.x()); - values.push_back(vtx.y()); + values << vtx.x(), vtx.y(); } return values; } diff --git a/Core/include/Acts/Surfaces/CylinderBounds.hpp b/Core/include/Acts/Surfaces/CylinderBounds.hpp index b2400eb07a92034b3a9b20b486bdfbcf172dd5cf..c399a7eb09466a47d5a4df1916414b875c44a5d1 100644 --- a/Core/include/Acts/Surfaces/CylinderBounds.hpp +++ b/Core/include/Acts/Surfaces/CylinderBounds.hpp @@ -36,49 +36,34 @@ class CylinderBounds : public SurfaceBounds { public: /// @enum BoundValues for readablility /// nested enumeration object - enum BoundValues { - bv_radius = 0, - bv_averagePhi = 1, - bv_halfPhiSector = 2, - bv_halfZ = 3, - bv_length = 4 + enum BoundValues : int { + eRadius = 0, + eHalfLengthZ = 1, + eHalfPhiSector = 2, + eAveragePhi = 3, + eSize = 4 }; CylinderBounds() = delete; /// Constructor - full cylinder /// - /// @param radius is the radius of the cylinder - /// @param halez is the half length in z - CylinderBounds(double radius, double halfZ); + /// @param radius The radius of the cylinder + /// @param halfz The half length in z + /// @param halfphi The half opening angle + /// @param avphi The phi value from which the opening angle spans (both sides) + CylinderBounds(double radius, double halfz, double halfphi = M_PI, + double avphi = 0.); - /// Constructor - open cylinder - /// - /// @param radius is the radius of the cylinder - /// @param halfPhi is the half opening angle - /// @param halfZ is the half length in z - CylinderBounds(double radius, double halfPhi, double halfZ); - - /// Constructor - open cylinder - /// - /// @param radius is the radius of the cylinder - /// @param avphi is the middle phi position of the segment - /// @param halfphi is the half opening angle - /// @param halez is the half length in z - CylinderBounds(double radius, double averagePhi, double halfPhi, - double halfZ); - - /// Defaulted destructor ~CylinderBounds() override = default; - /// Virtual constructor CylinderBounds* clone() const final; /// Type enumeration BoundsType type() const final; - /// The value store - std::vector<double> boundValues() const final; + /// The values of the object as dynamically sized vector + ActsVectorXd values() const final; /// Inside check for the bounds object driven by the boundary check directive /// Each Bounds has a method inside, which checks if a LocalPosition is inside @@ -105,52 +90,31 @@ class CylinderBounds : public SurfaceBounds { /// @return is a signed distance parameter double distanceToBoundary(const Vector2D& lposition) const final; - /// Output Method for std::ostream - std::ostream& toStream(std::ostream& sl) const final; - - /// This method returns the radius - double r() const; - - /// This method returns the average phi - double averagePhi() const; - - /// This method returns the halfPhiSector angle - double halfPhiSector() const; - - /// This method returns the halflengthZ - double halflengthZ() const; + /// Templated access to the bound parameters + double get(BoundValues bValue) const { return m_parameters[bValue]; } /// Returns true for full phi coverage bool coversFullAzimuth() const; + /// Output Method for std::ostream + std::ostream& toStream(std::ostream& sl) const final; + private: - /// the bound radius, average, half phi and half Z - double m_radius, m_avgPhi, m_halfPhi, m_halfZ; - /// an indicator if the bounds are closed + /// The bound radius, half Z, half phi and average phi + ActsRowVectorD<eSize> m_parameters; + /// Indicator if the bounds are closed bool m_closed; Vector2D shifted(const Vector2D& lposition) const; ActsSymMatrixD<2> jacobian() const; }; -inline double CylinderBounds::r() const { - return m_radius; -} - -inline double CylinderBounds::averagePhi() const { - return m_avgPhi; -} - -inline double CylinderBounds::halfPhiSector() const { - return m_halfPhi; -} - -inline double CylinderBounds::halflengthZ() const { - return m_halfZ; +inline ActsVectorXd CylinderBounds::values() const { + return m_parameters; } inline bool CylinderBounds::coversFullAzimuth() const { - return (m_halfPhi == M_PI); + return m_closed; } } // namespace Acts \ No newline at end of file diff --git a/Core/include/Acts/Surfaces/CylinderSurface.hpp b/Core/include/Acts/Surfaces/CylinderSurface.hpp index c91769264915ca510e12a67b5752796b9619db25..363437029ba585fcdd7546469694828fabf446c3 100644 --- a/Core/include/Acts/Surfaces/CylinderSurface.hpp +++ b/Core/include/Acts/Surfaces/CylinderSurface.hpp @@ -35,25 +35,6 @@ class CylinderSurface : public Surface { friend Surface; protected: - /// Constructor from Transform3D, radius and halflength - /// - /// @param htrans transform to position the surface, can be nullptr - /// @note if htrans == nullptr, the cylinder is positioned around (0.,0.,0.) - /// @param radius is the radius of the cylinder - /// @param hlength is the half length of the cylinder in z - CylinderSurface(std::shared_ptr<const Transform3D> htrans, double radius, - double hlength); - - /// Constructor from Transform3D, radius halfphi, and halflength - /// - /// @param htrans transform to position the surface, can be nullptr - /// @note if htrans == nullptr, the cylinder is positioned around (0.,0.,0.) - /// @param radius is the radius of the cylinder - /// @param hphi is the half length in phi of the cylinder - /// @param hlength is the half length of the cylinder in z - CylinderSurface(std::shared_ptr<const Transform3D> htrans, double radius, - double hphi, double hlength); - /// Constructor from DetectorElementBase: Element proxy /// /// @param cbounds are the provided cylinder bounds (shared) @@ -64,6 +45,16 @@ class CylinderSurface : public Surface { /// Constructor from Transform3D and CylinderBounds /// /// @param htrans transform to position the surface, can be nullptr + /// @param radius The radius of the cylinder + /// @param halfz The half length in z + /// @param halfphi The half opening angle + /// @param avphi The phi value from which the opening angle spans (both sides) + CylinderSurface(std::shared_ptr<const Transform3D> htrans, double radius, + double halfz, double halfphi = M_PI, double avphi = 0.); + + /// Constructor from Transform3D and CylinderBounds arguments + /// + /// @param htrans transform to position the surface, can be nullptr /// @note if htrans == nullptr, the cylinder is positioned around (0.,0.,0.) /// @param cbounds is a shared pointer to a cylindeer bounds object, /// it must exist (assert test) diff --git a/Core/include/Acts/Surfaces/DiamondBounds.hpp b/Core/include/Acts/Surfaces/DiamondBounds.hpp index 34e3ee72fcb8bc81665c464b46f2b45efa6292da..a425bdc0c4cf012ad1c36a2a844c910ef5466b27 100644 --- a/Core/include/Acts/Surfaces/DiamondBounds.hpp +++ b/Core/include/Acts/Surfaces/DiamondBounds.hpp @@ -16,7 +16,6 @@ namespace Acts { -/// /// @class DiamondBounds /// /// Bounds for a double trapezoidal ("diamond"), planar Surface. @@ -54,7 +53,7 @@ class DiamondBounds : public PlanarBounds { BoundsType type() const final; /// The value store for persistency - std::vector<double> boundValues() const final; + ActsVectorXd values() const final; /// Inside check for the bounds object driven by the boundary check directive /// Each Bounds has a method inside, which checks if a LocalPosition is inside diff --git a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp index 11fd7a2e89f6c4b0a2ef12504e36aa0933613d95..d58895209b425713342fea4e23d91c999d860d5f 100644 --- a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp +++ b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp @@ -60,7 +60,7 @@ class DiscTrapezoidBounds : public DiscBounds { SurfaceBounds::BoundsType type() const final; /// Value store for persistency - std::vector<double> boundValues() const final; + ActsVectorXd values() const final; /// This method cheks if the radius given in the LocalPosition is inside /// [rMin,rMax] diff --git a/Core/include/Acts/Surfaces/EllipseBounds.hpp b/Core/include/Acts/Surfaces/EllipseBounds.hpp index 718e45f78e4d52bb141fa0e81e6902d1ac72cef1..a7c86bdbc220caa85fd028760358706863422ab7 100644 --- a/Core/include/Acts/Surfaces/EllipseBounds.hpp +++ b/Core/include/Acts/Surfaces/EllipseBounds.hpp @@ -63,7 +63,7 @@ class EllipseBounds : public PlanarBounds { BoundsType type() const final; /// Complete value store for persistency - std::vector<double> boundValues() const final; + ActsVectorXd values() const final; /// This method checks if the point given in the local coordinates is between /// two ellipsoids if only tol0 is given and additional in the phi sector is diff --git a/Core/include/Acts/Surfaces/InfiniteBounds.hpp b/Core/include/Acts/Surfaces/InfiniteBounds.hpp index 26dc9d25dd5b3043a40ee393f17e295d902c7e30..f67630752745f6dc5afbadbe27cd5db73b412d3a 100644 --- a/Core/include/Acts/Surfaces/InfiniteBounds.hpp +++ b/Core/include/Acts/Surfaces/InfiniteBounds.hpp @@ -20,6 +20,7 @@ namespace Acts { class InfiniteBounds : public SurfaceBounds { public: InfiniteBounds() = default; + ~InfiniteBounds() override = default; InfiniteBounds* clone() const final { return new InfiniteBounds(); } @@ -28,7 +29,7 @@ class InfiniteBounds : public SurfaceBounds { return SurfaceBounds::eBoundless; } - std::vector<double> boundValues() const final { return {}; } + ActsVectorXd values() const final { return ActsVectorXd(); } /// Method inside() returns true for any case /// diff --git a/Core/include/Acts/Surfaces/LineBounds.hpp b/Core/include/Acts/Surfaces/LineBounds.hpp index 5d71462412269123d5747870860fef95a82e2692..be78d481af37a69d9af53effc2ad1a55eca60f19 100644 --- a/Core/include/Acts/Surfaces/LineBounds.hpp +++ b/Core/include/Acts/Surfaces/LineBounds.hpp @@ -39,7 +39,7 @@ class LineBounds : public SurfaceBounds { BoundsType type() const final; /// Return the intrinsic values - std::vector<double> boundValues() const final; + ActsVectorXd values() const final; /// Inside check for the bounds object driven by the boundary check directive /// Each Bounds has a method inside, which checks if a LocalPosition is inside diff --git a/Core/include/Acts/Surfaces/RadialBounds.hpp b/Core/include/Acts/Surfaces/RadialBounds.hpp index 7c92e99f5c0e74657ddc19d7706dae237fbc8fc0..3e94bea7145cd15df05d3f2e68c9eef4700392ea 100644 --- a/Core/include/Acts/Surfaces/RadialBounds.hpp +++ b/Core/include/Acts/Surfaces/RadialBounds.hpp @@ -65,7 +65,7 @@ class RadialBounds : public DiscBounds { SurfaceBounds::BoundsType type() const final; /// Value store to be written out - std::vector<double> boundValues() const final; + ActsVectorXd values() const final; /// For disc surfaces the local position in (r,phi) is checked /// diff --git a/Core/include/Acts/Surfaces/RectangleBounds.hpp b/Core/include/Acts/Surfaces/RectangleBounds.hpp index bb2b5a96ae90dd18733919302ea161d625eaa59a..2f55f066efe53e08b833b9802672cc98d1d95394 100644 --- a/Core/include/Acts/Surfaces/RectangleBounds.hpp +++ b/Core/include/Acts/Surfaces/RectangleBounds.hpp @@ -47,7 +47,7 @@ class RectangleBounds : public PlanarBounds { BoundsType type() const final; - std::vector<double> boundValues() const final; + ActsVectorXd values() const final; /// Inside check for the bounds object driven by the boundary check directive /// Each Bounds has a method inside, which checks if a LocalPosition is inside diff --git a/Core/include/Acts/Surfaces/SurfaceBounds.hpp b/Core/include/Acts/Surfaces/SurfaceBounds.hpp index 850a39e72d78d0b2d797516dfd0abfd6dde52c31..1990810f040c667fe2ba1293fa072255ecc30800 100644 --- a/Core/include/Acts/Surfaces/SurfaceBounds.hpp +++ b/Core/include/Acts/Surfaces/SurfaceBounds.hpp @@ -58,10 +58,11 @@ class SurfaceBounds { /// @return is a BoundsType enum virtual BoundsType type() const = 0; - /// Access method for bound values, this is for persistency + /// Access method for bound values, this is a dynamically sized + /// vector containing the parameters needed to describe these bounds /// /// @return of the stored values for this SurfaceBounds object - virtual std::vector<double> boundValues() const = 0; + virtual ActsVectorXd values() const = 0; /// Inside check for the bounds object driven by the boundary check directive /// Each Bounds has a method inside, which checks if a LocalPosition is inside @@ -89,7 +90,7 @@ inline bool operator==(const SurfaceBounds& lhs, const SurfaceBounds& rhs) { if (&lhs == &rhs) { return true; } - return (lhs.type() == rhs.type()) && (lhs.boundValues() == rhs.boundValues()); + return (lhs.type() == rhs.type()) && (lhs.values() == rhs.values()); } inline bool operator!=(const SurfaceBounds& lhs, const SurfaceBounds& rhs) { diff --git a/Core/include/Acts/Surfaces/TrapezoidBounds.hpp b/Core/include/Acts/Surfaces/TrapezoidBounds.hpp index 1566af952e1b727b3b780c8a93e6030091a5cbd1..f0496877cd241bd5c438544a663cf7a9c838cdb6 100644 --- a/Core/include/Acts/Surfaces/TrapezoidBounds.hpp +++ b/Core/include/Acts/Surfaces/TrapezoidBounds.hpp @@ -50,7 +50,7 @@ class TrapezoidBounds : public PlanarBounds { BoundsType type() const final; - std::vector<double> boundValues() const final; + ActsVectorXd values() const final; /// The orientation of the Trapezoid is according to the figure above, /// in words: the shorter of the two parallel sides of the trapezoid diff --git a/Core/include/Acts/Surfaces/TriangleBounds.hpp b/Core/include/Acts/Surfaces/TriangleBounds.hpp index 3df61dbf56971d5db7fdaee08fc49261f79b0ffd..27fc0cdd3b0500f40719b9c2268d62e49826ae9f 100644 --- a/Core/include/Acts/Surfaces/TriangleBounds.hpp +++ b/Core/include/Acts/Surfaces/TriangleBounds.hpp @@ -53,7 +53,7 @@ class TriangleBounds : public PlanarBounds { BoundsType type() const final; - std::vector<double> boundValues() const final; + ActsVectorXd values() const final; /// This method checks if the provided local coordinates are inside the /// surface bounds diff --git a/Core/include/Acts/Surfaces/detail/CylinderSurface.ipp b/Core/include/Acts/Surfaces/detail/CylinderSurface.ipp index c3f6a8a6bd343b95e64a1d5e1d29dce259addd02..c1c843fc25e4d853d773a6f1897440ab946d32cf 100644 --- a/Core/include/Acts/Surfaces/detail/CylinderSurface.ipp +++ b/Core/include/Acts/Surfaces/detail/CylinderSurface.ipp @@ -20,7 +20,7 @@ inline detail::RealQuadraticEquation CylinderSurface::intersectionSolver( const Transform3D& transform, const Vector3D& position, const Vector3D& direction) const { // Solve for radius R - double R = bounds().r(); + double R = bounds().get(CylinderBounds::eRadius); // Get the transformation matrtix const auto& tMatrix = transform.matrix(); @@ -105,7 +105,7 @@ inline SurfaceIntersection CylinderSurface::intersect( const Vector3D vecLocal(solution - tMatrix.block<3, 1>(0, 3)); double cZ = vecLocal.dot(tMatrix.block<3, 1>(0, 2)); double tolerance = s_onSurfaceTolerance + bcheck.tolerance()[eLOC_Z]; - double hZ = cBounds.halflengthZ() + tolerance; + double hZ = cBounds.get(CylinderBounds::eHalfLengthZ) + tolerance; return (cZ * cZ < hZ * hZ) ? status : Intersection::Status::missed; } return (isOnSurface(gctx, solution, direction, bcheck) diff --git a/Core/include/Acts/Utilities/BinAdjustment.hpp b/Core/include/Acts/Utilities/BinAdjustment.hpp index 011620157598ea31be5ea5f6fe1d986c19716e3c..95650f17a8f086e0901e436ff4329cb40d1441d0 100644 --- a/Core/include/Acts/Utilities/BinAdjustment.hpp +++ b/Core/include/Acts/Utilities/BinAdjustment.hpp @@ -76,10 +76,13 @@ BinUtility adjustBinUtility(const BinUtility& bu, // Default constructor BinUtility uBinUtil; // The parameters from the cylinder bounds - double cR = cBounds.r(); - double cHz = cBounds.halflengthZ(); - double minPhi = cBounds.averagePhi() - cBounds.halfPhiSector(); - double maxPhi = cBounds.averagePhi() + cBounds.halfPhiSector(); + double cR = cBounds.get(CylinderBounds::eRadius); + double cHz = cBounds.get(CylinderBounds::eHalfLengthZ); + double avgPhi = cBounds.get(CylinderBounds::eAveragePhi); + double halfPhi = cBounds.get(CylinderBounds::eHalfPhiSector); + double minPhi = avgPhi - halfPhi; + double maxPhi = avgPhi + halfPhi; + ; // Retrieve the binning data const std::vector<BinningData>& bData = bu.binningData(); // Loop over the binning data and adjust the dimensions diff --git a/Core/src/Geometry/CuboidVolumeBounds.cpp b/Core/src/Geometry/CuboidVolumeBounds.cpp index b399b031519e512fec48a7992c2b65c280f816dd..219c233efa070a52e59c5dc263679b614bffdbdf 100644 --- a/Core/src/Geometry/CuboidVolumeBounds.cpp +++ b/Core/src/Geometry/CuboidVolumeBounds.cpp @@ -15,18 +15,18 @@ #include "Acts/Utilities/BoundingBox.hpp" Acts::CuboidVolumeBounds::CuboidVolumeBounds() - : VolumeBounds(), m_boundValues(bv_length, 0.) {} + : VolumeBounds(), m_values(bv_length, 0.) {} Acts::CuboidVolumeBounds::CuboidVolumeBounds(double halex, double haley, double halez) : VolumeBounds(), - m_boundValues(bv_length, 0.), + m_values(bv_length, 0.), m_xyBounds(nullptr), m_yzBounds(nullptr), m_zxBounds(nullptr) { - m_boundValues.at(bv_halfX) = halex; - m_boundValues.at(bv_halfY) = haley; - m_boundValues.at(bv_halfZ) = halez; + m_values.at(bv_halfX) = halex; + m_values.at(bv_halfY) = haley; + m_values.at(bv_halfZ) = halez; m_xyBounds = faceXYRectangleBounds(); m_yzBounds = faceYZRectangleBounds(); @@ -35,7 +35,7 @@ Acts::CuboidVolumeBounds::CuboidVolumeBounds(double halex, double haley, Acts::CuboidVolumeBounds::CuboidVolumeBounds(const CuboidVolumeBounds& bobo) : VolumeBounds(), - m_boundValues(bobo.m_boundValues), + m_values(bobo.m_values), m_xyBounds(bobo.m_xyBounds), m_yzBounds(bobo.m_yzBounds), m_zxBounds(bobo.m_zxBounds) {} @@ -45,7 +45,7 @@ Acts::CuboidVolumeBounds::~CuboidVolumeBounds() = default; Acts::CuboidVolumeBounds& Acts::CuboidVolumeBounds::operator=( const CuboidVolumeBounds& bobo) { if (this != &bobo) { - m_boundValues = bobo.m_boundValues; + m_values = bobo.m_values; m_xyBounds = bobo.m_xyBounds; m_yzBounds = bobo.m_yzBounds; m_zxBounds = bobo.m_zxBounds; @@ -113,20 +113,20 @@ Acts::SurfacePtrVector Acts::CuboidVolumeBounds::decomposeToSurfaces( std::shared_ptr<const Acts::RectangleBounds> Acts::CuboidVolumeBounds::faceXYRectangleBounds() const { - return std::make_shared<const RectangleBounds>(m_boundValues.at(bv_halfX), - m_boundValues.at(bv_halfY)); + return std::make_shared<const RectangleBounds>(m_values.at(bv_halfX), + m_values.at(bv_halfY)); } std::shared_ptr<const Acts::RectangleBounds> Acts::CuboidVolumeBounds::faceYZRectangleBounds() const { - return std::make_shared<const RectangleBounds>(m_boundValues.at(bv_halfY), - m_boundValues.at(bv_halfZ)); + return std::make_shared<const RectangleBounds>(m_values.at(bv_halfY), + m_values.at(bv_halfZ)); } std::shared_ptr<const Acts::RectangleBounds> Acts::CuboidVolumeBounds::faceZXRectangleBounds() const { - return std::make_shared<const RectangleBounds>(m_boundValues.at(bv_halfZ), - m_boundValues.at(bv_halfX)); + return std::make_shared<const RectangleBounds>(m_values.at(bv_halfZ), + m_values.at(bv_halfX)); } // ostream operator overload diff --git a/Core/src/Geometry/CutoutCylinderVolumeBounds.cpp b/Core/src/Geometry/CutoutCylinderVolumeBounds.cpp index e777b74ea06e960ac3f4a0fb0646b8c055982a4c..81d89b835e9ff279bf186d23f43949cba670cb28 100644 --- a/Core/src/Geometry/CutoutCylinderVolumeBounds.cpp +++ b/Core/src/Geometry/CutoutCylinderVolumeBounds.cpp @@ -65,11 +65,13 @@ Acts::CutoutCylinderVolumeBounds::decomposeToSurfaces( } // outer cylinder envelope - auto outer = Surface::makeShared<CylinderSurface>(trf, m_rmax, m_dz1); + auto outerBounds = std::make_shared<CylinderBounds>(m_rmax, m_dz1); + auto outer = Surface::makeShared<CylinderSurface>(trf, outerBounds); surfaces.at(tubeOuterCover) = outer; // inner (small) cylinder envelope - auto ctr_inner = Surface::makeShared<CylinderSurface>(trf, m_rmed, m_dz2); + auto ctr_innerBounds = std::make_shared<CylinderBounds>(m_rmed, m_dz2); + auto ctr_inner = Surface::makeShared<CylinderSurface>(trf, ctr_innerBounds); surfaces.at(tubeInnerCover) = ctr_inner; // z position of the pos and neg choke points diff --git a/Core/src/Geometry/CylinderVolumeBounds.cpp b/Core/src/Geometry/CylinderVolumeBounds.cpp index 95e976f38cb382d3c4b455c26fdb2161671a94e6..040ee4a0e4ce59b3b0a6b082e9593d135d83551a 100644 --- a/Core/src/Geometry/CylinderVolumeBounds.cpp +++ b/Core/src/Geometry/CylinderVolumeBounds.cpp @@ -25,63 +25,63 @@ const double Acts::CylinderVolumeBounds::s_numericalStable = 10e-2; Acts::CylinderVolumeBounds::CylinderVolumeBounds() - : VolumeBounds(), m_boundValues(4, 0.) {} + : VolumeBounds(), m_values(4, 0.) {} Acts::CylinderVolumeBounds::CylinderVolumeBounds(double radius, double halez) - : VolumeBounds(), m_boundValues(4, 0.) { - m_boundValues.at(bv_innerRadius) = 0.; - m_boundValues.at(bv_outerRadius) = std::abs(radius); - m_boundValues.at(bv_halfPhiSector) = M_PI; - m_boundValues.at(bv_halfZ) = std::abs(halez); + : VolumeBounds(), m_values(4, 0.) { + m_values.at(bv_innerRadius) = 0.; + m_values.at(bv_outerRadius) = std::abs(radius); + m_values.at(bv_halfPhiSector) = M_PI; + m_values.at(bv_halfZ) = std::abs(halez); } Acts::CylinderVolumeBounds::CylinderVolumeBounds(double rinner, double router, double halez) - : VolumeBounds(), m_boundValues(4, 0.) { - m_boundValues.at(bv_innerRadius) = std::abs(rinner); - m_boundValues.at(bv_outerRadius) = std::abs(router); - m_boundValues.at(bv_halfPhiSector) = M_PI; - m_boundValues.at(bv_halfZ) = std::abs(halez); + : VolumeBounds(), m_values(4, 0.) { + m_values.at(bv_innerRadius) = std::abs(rinner); + m_values.at(bv_outerRadius) = std::abs(router); + m_values.at(bv_halfPhiSector) = M_PI; + m_values.at(bv_halfZ) = std::abs(halez); } Acts::CylinderVolumeBounds::CylinderVolumeBounds(double rinner, double router, double haphi, double halez) - : VolumeBounds(), m_boundValues(4, 0.) { - m_boundValues.at(bv_innerRadius) = std::abs(rinner); - m_boundValues.at(bv_outerRadius) = std::abs(router); - m_boundValues.at(bv_halfPhiSector) = std::abs(haphi); - m_boundValues.at(bv_halfZ) = std::abs(halez); + : VolumeBounds(), m_values(4, 0.) { + m_values.at(bv_innerRadius) = std::abs(rinner); + m_values.at(bv_outerRadius) = std::abs(router); + m_values.at(bv_halfPhiSector) = std::abs(haphi); + m_values.at(bv_halfZ) = std::abs(halez); } Acts::CylinderVolumeBounds::CylinderVolumeBounds(const CylinderBounds& cBounds, double thickness) - : VolumeBounds(), m_boundValues(4, 0.) { - double cR = cBounds.r(); - m_boundValues.at(bv_innerRadius) = cR - 0.5 * thickness; - m_boundValues.at(bv_outerRadius) = cR + 0.5 * thickness; - m_boundValues.at(bv_halfPhiSector) = cBounds.halfPhiSector(); - m_boundValues.at(bv_halfZ) = cBounds.halflengthZ(); + : VolumeBounds(), m_values(4, 0.) { + double cR = cBounds.get(CylinderBounds::eRadius); + m_values.at(bv_innerRadius) = cR - 0.5 * thickness; + m_values.at(bv_outerRadius) = cR + 0.5 * thickness; + m_values.at(bv_halfPhiSector) = cBounds.get(CylinderBounds::eHalfPhiSector); + m_values.at(bv_halfZ) = cBounds.get(CylinderBounds::eHalfLengthZ); } Acts::CylinderVolumeBounds::CylinderVolumeBounds(const RadialBounds& rBounds, double thickness) - : VolumeBounds(), m_boundValues(4, 0.) { - m_boundValues.at(bv_innerRadius) = rBounds.rMin(); - m_boundValues.at(bv_outerRadius) = rBounds.rMax(); - m_boundValues.at(bv_halfPhiSector) = rBounds.halfPhiSector(); - m_boundValues.at(bv_halfZ) = 0.5 * thickness; + : VolumeBounds(), m_values(4, 0.) { + m_values.at(bv_innerRadius) = rBounds.rMin(); + m_values.at(bv_outerRadius) = rBounds.rMax(); + m_values.at(bv_halfPhiSector) = rBounds.halfPhiSector(); + m_values.at(bv_halfZ) = 0.5 * thickness; } Acts::CylinderVolumeBounds::CylinderVolumeBounds( const CylinderVolumeBounds& cylbo) - : VolumeBounds(), m_boundValues(cylbo.m_boundValues) {} + : VolumeBounds(), m_values(cylbo.m_values) {} Acts::CylinderVolumeBounds::~CylinderVolumeBounds() = default; Acts::CylinderVolumeBounds& Acts::CylinderVolumeBounds::operator=( const CylinderVolumeBounds& cylbo) { if (this != &cylbo) { - m_boundValues = cylbo.m_boundValues; + m_values = cylbo.m_values; } return *this; } @@ -146,31 +146,30 @@ Acts::CylinderVolumeBounds::decomposeToSurfaces( std::shared_ptr<const Acts::CylinderBounds> Acts::CylinderVolumeBounds::innerCylinderBounds() const { - return std::make_shared<const CylinderBounds>( - m_boundValues.at(bv_innerRadius), m_boundValues.at(bv_halfPhiSector), - m_boundValues.at(bv_halfZ)); + return std::make_shared<const CylinderBounds>(m_values.at(bv_innerRadius), + m_values.at(bv_halfPhiSector), + m_values.at(bv_halfZ)); } std::shared_ptr<const Acts::CylinderBounds> Acts::CylinderVolumeBounds::outerCylinderBounds() const { - return std::make_shared<const CylinderBounds>( - m_boundValues.at(bv_outerRadius), m_boundValues.at(bv_halfPhiSector), - m_boundValues.at(bv_halfZ)); + return std::make_shared<const CylinderBounds>(m_values.at(bv_outerRadius), + m_values.at(bv_halfPhiSector), + m_values.at(bv_halfZ)); } std::shared_ptr<const Acts::DiscBounds> Acts::CylinderVolumeBounds::discBounds() const { - return std::shared_ptr<const DiscBounds>(new RadialBounds( - m_boundValues.at(bv_innerRadius), m_boundValues.at(bv_outerRadius), - m_boundValues.at(bv_halfPhiSector))); + return std::shared_ptr<const DiscBounds>( + new RadialBounds(m_values.at(bv_innerRadius), m_values.at(bv_outerRadius), + m_values.at(bv_halfPhiSector))); } std::shared_ptr<const Acts::PlanarBounds> Acts::CylinderVolumeBounds::sectorPlaneBounds() const { return std::shared_ptr<const PlanarBounds>(new RectangleBounds( - 0.5 * - (m_boundValues.at(bv_outerRadius) - m_boundValues.at(bv_innerRadius)), - m_boundValues.at(bv_halfZ))); + 0.5 * (m_values.at(bv_outerRadius) - m_values.at(bv_innerRadius)), + m_values.at(bv_halfZ))); } std::ostream& Acts::CylinderVolumeBounds::toStream(std::ostream& sl) const { diff --git a/Core/src/Geometry/CylinderVolumeBuilder.cpp b/Core/src/Geometry/CylinderVolumeBuilder.cpp index 0c9f79e85d99098dc43699d158ef34d1d08c151f..945ba7f0ec179f0fa8dfb066ef725c6d3e5182d3 100644 --- a/Core/src/Geometry/CylinderVolumeBuilder.cpp +++ b/Core/src/Geometry/CylinderVolumeBuilder.cpp @@ -495,12 +495,15 @@ Acts::VolumeConfig Acts::CylinderVolumeBuilder::analyzeContent( dynamic_cast<const CylinderLayer*>(layer.get()); if (cLayer != nullptr) { // now we have access to all the information - double rMinC = - cLayer->surfaceRepresentation().bounds().r() - 0.5 * thickness; - double rMaxC = - cLayer->surfaceRepresentation().bounds().r() + 0.5 * thickness; - - double hZ = cLayer->surfaceRepresentation().bounds().halflengthZ(); + double rMinC = cLayer->surfaceRepresentation().bounds().get( + CylinderBounds::eRadius) - + 0.5 * thickness; + double rMaxC = cLayer->surfaceRepresentation().bounds().get( + CylinderBounds::eRadius) + + 0.5 * thickness; + + double hZ = cLayer->surfaceRepresentation().bounds().get( + CylinderBounds::eHalfLengthZ); takeSmaller(lConfig.rMin, rMinC - m_cfg.layerEnvelopeR.first); takeBigger(lConfig.rMax, rMaxC + m_cfg.layerEnvelopeR.second); takeSmaller(lConfig.zMin, center.z() - hZ - m_cfg.layerEnvelopeZ); diff --git a/Core/src/Geometry/CylinderVolumeHelper.cpp b/Core/src/Geometry/CylinderVolumeHelper.cpp index d4899289249d133024719f88c4cd1d317c59282c..ec27e48943b87703023e3c3be0f01e6d534af2e6 100644 --- a/Core/src/Geometry/CylinderVolumeHelper.cpp +++ b/Core/src/Geometry/CylinderVolumeHelper.cpp @@ -443,13 +443,13 @@ bool Acts::CylinderVolumeHelper::estimateAndCheckDimension( if (cylBounds != nullptr) { radial = true; // get the raw data - double currentR = cylBounds->r(); + double currentR = cylBounds->get(CylinderBounds::eRadius); double centerZ = (layerIter->surfaceRepresentation()).center(gctx).z(); // check for min/max in the cylinder bounds case currentRmin = currentR - (0.5 * (layerIter)->thickness()); currentRmax = currentR + (0.5 * (layerIter)->thickness()); - currentZmin = centerZ - cylBounds->halflengthZ(); - currentZmax = centerZ + cylBounds->halflengthZ(); + currentZmin = centerZ - cylBounds->get(CylinderBounds::eHalfLengthZ); + currentZmax = centerZ + cylBounds->get(CylinderBounds::eHalfLengthZ); } // dynamic cast to the DiscBounds const RadialBounds* discBounds = dynamic_cast<const RadialBounds*>( @@ -789,9 +789,10 @@ void Acts::CylinderVolumeHelper::glueTrackingVolumes( // 2 cases: r-Binning and zBinning if (faceOne == cylinderCover || faceOne == tubeOuterCover) { // (1) create the Boundary CylinderSurface + auto cBounds = + std::make_shared<CylinderBounds>(rGlueMin, 0.5 * (zMax - zMin)); std::shared_ptr<const Surface> cSurface = - Surface::makeShared<CylinderSurface>(transform, rGlueMin, - 0.5 * (zMax - zMin)); + Surface::makeShared<CylinderSurface>(transform, cBounds); ACTS_VERBOSE( " creating a new cylindrical boundary surface " "with bounds = " diff --git a/Core/src/Geometry/DoubleTrapezoidVolumeBounds.cpp b/Core/src/Geometry/DoubleTrapezoidVolumeBounds.cpp index 7a5b1edf7d6ef9d9d6545a03cb0841573f8cc796..ba9bf68702797fde8057a173dbd54245b0a72ec8 100644 --- a/Core/src/Geometry/DoubleTrapezoidVolumeBounds.cpp +++ b/Core/src/Geometry/DoubleTrapezoidVolumeBounds.cpp @@ -20,36 +20,36 @@ #include "Acts/Surfaces/RectangleBounds.hpp" Acts::DoubleTrapezoidVolumeBounds::DoubleTrapezoidVolumeBounds() - : VolumeBounds(), m_boundValues(bv_length, 0.) {} + : VolumeBounds(), m_values(bv_length, 0.) {} Acts::DoubleTrapezoidVolumeBounds::DoubleTrapezoidVolumeBounds( double minhalex, double medhalex, double maxhalex, double haley1, double haley2, double halez) - : VolumeBounds(), m_boundValues(bv_length, 0.) { - m_boundValues.at(bv_minHalfX) = minhalex; - m_boundValues.at(bv_medHalfX) = medhalex; - m_boundValues.at(bv_maxHalfX) = maxhalex; - m_boundValues.at(bv_halfY1) = haley1; - m_boundValues.at(bv_halfY2) = haley2; - m_boundValues.at(bv_halfZ) = halez; - m_boundValues.at(bv_alpha1) = - atan2(m_boundValues.at(bv_medHalfX) - m_boundValues.at(bv_minHalfX), - 2. * m_boundValues.at(bv_halfY1)); - m_boundValues.at(bv_alpha2) = - atan2(m_boundValues.at(bv_medHalfX) - m_boundValues.at(bv_maxHalfX), - 2. * m_boundValues.at(bv_halfY2)); + : VolumeBounds(), m_values(bv_length, 0.) { + m_values.at(bv_minHalfX) = minhalex; + m_values.at(bv_medHalfX) = medhalex; + m_values.at(bv_maxHalfX) = maxhalex; + m_values.at(bv_halfY1) = haley1; + m_values.at(bv_halfY2) = haley2; + m_values.at(bv_halfZ) = halez; + m_values.at(bv_alpha1) = + atan2(m_values.at(bv_medHalfX) - m_values.at(bv_minHalfX), + 2. * m_values.at(bv_halfY1)); + m_values.at(bv_alpha2) = + atan2(m_values.at(bv_medHalfX) - m_values.at(bv_maxHalfX), + 2. * m_values.at(bv_halfY2)); } Acts::DoubleTrapezoidVolumeBounds::DoubleTrapezoidVolumeBounds( const Acts::DoubleTrapezoidVolumeBounds& trabo) - : VolumeBounds(), m_boundValues(trabo.m_boundValues) {} + : VolumeBounds(), m_values(trabo.m_values) {} Acts::DoubleTrapezoidVolumeBounds::~DoubleTrapezoidVolumeBounds() = default; Acts::DoubleTrapezoidVolumeBounds& Acts::DoubleTrapezoidVolumeBounds::operator=( const Acts::DoubleTrapezoidVolumeBounds& trabo) { if (this != &trabo) { - m_boundValues = trabo.m_boundValues; + m_values = trabo.m_values; } return *this; } @@ -177,61 +177,58 @@ Acts::DoubleTrapezoidVolumeBounds::decomposeToSurfaces( // faces in xy Acts::DiamondBounds* Acts::DoubleTrapezoidVolumeBounds::faceXYDiamondBounds() const { - return new DiamondBounds( - m_boundValues.at(bv_minHalfX), m_boundValues.at(bv_medHalfX), - m_boundValues.at(bv_maxHalfX), 2 * m_boundValues.at(bv_halfY1), - 2 * m_boundValues.at(bv_halfY2)); + return new DiamondBounds(m_values.at(bv_minHalfX), m_values.at(bv_medHalfX), + m_values.at(bv_maxHalfX), 2 * m_values.at(bv_halfY1), + 2 * m_values.at(bv_halfY2)); } Acts::RectangleBounds* Acts::DoubleTrapezoidVolumeBounds::faceAlpha1RectangleBounds() const { return new RectangleBounds( - m_boundValues.at(bv_halfY1) / cos(m_boundValues.at(bv_alpha1)), - m_boundValues.at(bv_halfZ)); + m_values.at(bv_halfY1) / cos(m_values.at(bv_alpha1)), + m_values.at(bv_halfZ)); } Acts::RectangleBounds* Acts::DoubleTrapezoidVolumeBounds::faceAlpha2RectangleBounds() const { return new RectangleBounds( - m_boundValues.at(bv_halfY2) / cos(m_boundValues.at(bv_alpha2)), - m_boundValues.at(bv_halfZ)); + m_values.at(bv_halfY2) / cos(m_values.at(bv_alpha2)), + m_values.at(bv_halfZ)); } Acts::RectangleBounds* Acts::DoubleTrapezoidVolumeBounds::faceBeta1RectangleBounds() const { return new RectangleBounds( - m_boundValues.at(bv_halfY1) / cos(m_boundValues.at(bv_alpha1)), - m_boundValues.at(bv_halfZ)); + m_values.at(bv_halfY1) / cos(m_values.at(bv_alpha1)), + m_values.at(bv_halfZ)); } Acts::RectangleBounds* Acts::DoubleTrapezoidVolumeBounds::faceBeta2RectangleBounds() const { return new RectangleBounds( - m_boundValues.at(bv_halfY2) / cos(m_boundValues.at(bv_alpha2)), - m_boundValues.at(bv_halfZ)); + m_values.at(bv_halfY2) / cos(m_values.at(bv_alpha2)), + m_values.at(bv_halfZ)); } Acts::RectangleBounds* Acts::DoubleTrapezoidVolumeBounds::faceZXRectangleBoundsBottom() const { - return new RectangleBounds(m_boundValues.at(bv_halfZ), - m_boundValues.at(bv_minHalfX)); + return new RectangleBounds(m_values.at(bv_halfZ), m_values.at(bv_minHalfX)); } Acts::RectangleBounds* Acts::DoubleTrapezoidVolumeBounds::faceZXRectangleBoundsTop() const { - return new RectangleBounds(m_boundValues.at(bv_halfZ), - m_boundValues.at(bv_maxHalfX)); + return new RectangleBounds(m_values.at(bv_halfZ), m_values.at(bv_maxHalfX)); } bool Acts::DoubleTrapezoidVolumeBounds::inside(const Vector3D& pos, double tol) const { - if (std::abs(pos.z()) > m_boundValues.at(bv_halfZ) + tol) { + if (std::abs(pos.z()) > m_values.at(bv_halfZ) + tol) { return false; } - if (pos.y() < -2 * m_boundValues.at(bv_halfY1) - tol) { + if (pos.y() < -2 * m_values.at(bv_halfY1) - tol) { return false; } - if (pos.y() > 2 * m_boundValues.at(bv_halfY2) - tol) { + if (pos.y() > 2 * m_values.at(bv_halfY2) - tol) { return false; } DiamondBounds* faceXYBounds = faceXYDiamondBounds(); diff --git a/Core/src/Geometry/LayerArrayCreator.cpp b/Core/src/Geometry/LayerArrayCreator.cpp index 8cf79aa5e208182b034dcddca2ce62bbe5ec8ad4..2fe653acaa9b60aa24042fee5debd92f63d402a4 100644 --- a/Core/src/Geometry/LayerArrayCreator.cpp +++ b/Core/src/Geometry/LayerArrayCreator.cpp @@ -213,16 +213,18 @@ std::shared_ptr<Acts::Surface> Acts::LayerArrayCreator::createNavigationSurface( // get the bounds const CylinderBounds* cBounds = dynamic_cast<const CylinderBounds*>(&(layerSurface.bounds())); - double navigationR = cBounds->r() + offset; - double halflengthZ = cBounds->halflengthZ(); + double navigationR = cBounds->get(CylinderBounds::eRadius) + offset; + double halflengthZ = cBounds->get(CylinderBounds::eHalfLengthZ); // create the new layer surface std::shared_ptr<const Transform3D> navTrasform = (!layerSurface.transform(gctx).isApprox(s_idTransform)) ? std::make_shared<const Transform3D>(layerSurface.transform(gctx)) : nullptr; // new navigation layer - navigationSurface = Surface::makeShared<CylinderSurface>( - navTrasform, navigationR, halflengthZ); + auto cylinderBounds = + std::make_shared<CylinderBounds>(navigationR, halflengthZ); + navigationSurface = + Surface::makeShared<CylinderSurface>(navTrasform, cylinderBounds); } return navigationSurface; } diff --git a/Core/src/Geometry/ProtoLayer.cpp b/Core/src/Geometry/ProtoLayer.cpp index 9694dfab4f48a0302a31358b4a81e6abe2909c76..3b2d62e519f4cf975d5c10d281cf66362565c18c 100644 --- a/Core/src/Geometry/ProtoLayer.cpp +++ b/Core/src/Geometry/ProtoLayer.cpp @@ -169,7 +169,7 @@ void ProtoLayer::measure(const GeometryContext& gctx, } // set envelopes to half radius - double cylBoundsR = cylSurface->bounds().r(); + double cylBoundsR = cylSurface->bounds().get(CylinderBounds::eRadius); double env = cylBoundsR / 2.; envX = {env, env}; envY = {env, env}; @@ -192,11 +192,11 @@ void ProtoLayer::measure(const GeometryContext& gctx, dynamic_cast<const AnnulusBounds*>(&(sf->bounds())); if (cBounds != nullptr) { - double r = cBounds->r(); + double r = cBounds->get(CylinderBounds::eRadius); double z = sf->center(gctx).z(); - double hZ = cBounds->halflengthZ(); - double phi = cBounds->averagePhi(); - double hPhi = cBounds->halfPhiSector(); + double hZ = cBounds->get(CylinderBounds::eHalfLengthZ); + double phi = cBounds->get(CylinderBounds::eAveragePhi); + double hPhi = cBounds->get(CylinderBounds::eHalfPhiSector); maxX = r; minX = -r; diff --git a/Core/src/Geometry/TrapezoidVolumeBounds.cpp b/Core/src/Geometry/TrapezoidVolumeBounds.cpp index 3c415cbfc2f581cedd81fad64524001da16018bf..564a85450185153b2d49340f6cc6b6b9263c3ef1 100644 --- a/Core/src/Geometry/TrapezoidVolumeBounds.cpp +++ b/Core/src/Geometry/TrapezoidVolumeBounds.cpp @@ -22,47 +22,47 @@ #include "Acts/Utilities/BoundingBox.hpp" Acts::TrapezoidVolumeBounds::TrapezoidVolumeBounds() - : VolumeBounds(), m_boundValues(bv_length, 0.) {} + : VolumeBounds(), m_values(bv_length, 0.) {} Acts::TrapezoidVolumeBounds::TrapezoidVolumeBounds(double minhalex, double maxhalex, double haley, double halez) - : VolumeBounds(), m_boundValues(bv_length, 0.) { - m_boundValues.at(bv_minHalfX) = minhalex; - m_boundValues.at(bv_maxHalfX) = maxhalex; - m_boundValues.at(bv_halfY) = haley; - m_boundValues.at(bv_halfZ) = halez; - m_boundValues.at(bv_alpha) = - atan((m_boundValues.at(bv_maxHalfX) - m_boundValues.at(bv_minHalfX)) / 2 / - m_boundValues.at(bv_halfY)) + + : VolumeBounds(), m_values(bv_length, 0.) { + m_values.at(bv_minHalfX) = minhalex; + m_values.at(bv_maxHalfX) = maxhalex; + m_values.at(bv_halfY) = haley; + m_values.at(bv_halfZ) = halez; + m_values.at(bv_alpha) = + atan((m_values.at(bv_maxHalfX) - m_values.at(bv_minHalfX)) / 2 / + m_values.at(bv_halfY)) + 0.5 * M_PI; - m_boundValues.at(bv_beta) = m_boundValues.at(bv_alpha); + m_values.at(bv_beta) = m_values.at(bv_alpha); } Acts::TrapezoidVolumeBounds::TrapezoidVolumeBounds(double minhalex, double haley, double halez, double alpha, double beta) - : VolumeBounds(), m_boundValues(bv_length, 0.) { - m_boundValues.at(bv_minHalfX) = minhalex; - m_boundValues.at(bv_halfY) = haley; - m_boundValues.at(bv_halfZ) = halez; - m_boundValues.at(bv_alpha) = alpha; - m_boundValues.at(bv_beta) = beta; + : VolumeBounds(), m_values(bv_length, 0.) { + m_values.at(bv_minHalfX) = minhalex; + m_values.at(bv_halfY) = haley; + m_values.at(bv_halfZ) = halez; + m_values.at(bv_alpha) = alpha; + m_values.at(bv_beta) = beta; // now calculate the remaining max half X double gamma = (alpha > beta) ? (alpha - 0.5 * M_PI) : (beta - 0.5 * M_PI); - m_boundValues.at(bv_maxHalfX) = minhalex + (2. * haley) * tan(gamma); + m_values.at(bv_maxHalfX) = minhalex + (2. * haley) * tan(gamma); } Acts::TrapezoidVolumeBounds::TrapezoidVolumeBounds( const TrapezoidVolumeBounds& trabo) - : VolumeBounds(), m_boundValues(trabo.m_boundValues) {} + : VolumeBounds(), m_values(trabo.m_values) {} Acts::TrapezoidVolumeBounds::~TrapezoidVolumeBounds() = default; Acts::TrapezoidVolumeBounds& Acts::TrapezoidVolumeBounds::operator=( const TrapezoidVolumeBounds& trabo) { if (this != &trabo) { - m_boundValues = trabo.m_boundValues; + m_values = trabo.m_values; } return *this; } @@ -163,47 +163,44 @@ Acts::TrapezoidVolumeBounds::decomposeToSurfaces( Acts::TrapezoidBounds* Acts::TrapezoidVolumeBounds::faceXYTrapezoidBounds() const { - return new TrapezoidBounds(m_boundValues.at(bv_minHalfX), - m_boundValues.at(bv_maxHalfX), - m_boundValues.at(bv_halfY)); + return new TrapezoidBounds(m_values.at(bv_minHalfX), m_values.at(bv_maxHalfX), + m_values.at(bv_halfY)); } Acts::RectangleBounds* Acts::TrapezoidVolumeBounds::faceAlphaRectangleBounds() const { return new RectangleBounds( - m_boundValues.at(bv_halfY) / cos(m_boundValues.at(bv_alpha) - 0.5 * M_PI), - m_boundValues.at(bv_halfZ)); + m_values.at(bv_halfY) / cos(m_values.at(bv_alpha) - 0.5 * M_PI), + m_values.at(bv_halfZ)); } Acts::RectangleBounds* Acts::TrapezoidVolumeBounds::faceBetaRectangleBounds() const { return new RectangleBounds( - m_boundValues.at(bv_halfY) / cos(m_boundValues.at(bv_beta) - 0.5 * M_PI), - m_boundValues.at(bv_halfZ)); + m_values.at(bv_halfY) / cos(m_values.at(bv_beta) - 0.5 * M_PI), + m_values.at(bv_halfZ)); } Acts::RectangleBounds* Acts::TrapezoidVolumeBounds::faceZXRectangleBoundsBottom() const { - return new RectangleBounds(m_boundValues.at(bv_halfZ), - m_boundValues.at(bv_minHalfX)); + return new RectangleBounds(m_values.at(bv_halfZ), m_values.at(bv_minHalfX)); } Acts::RectangleBounds* Acts::TrapezoidVolumeBounds::faceZXRectangleBoundsTop() const { - // double delta = (m_boundValues.at(bv_alpha) < m_boundValues.at(bv_beta)) ? - // m_boundValues.at(bv_alpha) - M_PI/2. : m_boundValues.at(bv_beta) - M_PI/2.; - // return new RectangleBounds(m_boundValues.at(bv_halfZ), - // 0.5*(m_boundValues.at(bv_minHalfX)+m_boundValues.at(bv_minHalfX)+2.*m_boundValues.at(bv_halfY)/cos(delta))); - return new RectangleBounds(m_boundValues.at(bv_halfZ), - m_boundValues.at(bv_maxHalfX)); + // double delta = (m_values.at(bv_alpha) < m_values.at(bv_beta)) ? + // m_values.at(bv_alpha) - M_PI/2. : m_values.at(bv_beta) - M_PI/2.; + // return new RectangleBounds(m_values.at(bv_halfZ), + // 0.5*(m_values.at(bv_minHalfX)+m_values.at(bv_minHalfX)+2.*m_values.at(bv_halfY)/cos(delta))); + return new RectangleBounds(m_values.at(bv_halfZ), m_values.at(bv_maxHalfX)); } bool Acts::TrapezoidVolumeBounds::inside(const Vector3D& pos, double tol) const { - if (std::abs(pos.z()) > m_boundValues.at(bv_halfZ) + tol) { + if (std::abs(pos.z()) > m_values.at(bv_halfZ) + tol) { return false; } - if (std::abs(pos.y()) > m_boundValues.at(bv_halfY) + tol) { + if (std::abs(pos.y()) > m_values.at(bv_halfY) + tol) { return false; } TrapezoidBounds* faceXYBounds = faceXYTrapezoidBounds(); diff --git a/Core/src/Surfaces/AnnulusBounds.cpp b/Core/src/Surfaces/AnnulusBounds.cpp index 7afe671d1cb78a0e0e54c5cf220b0fdc9e221edf..d5e8a6ada23c458f88987b489f8acf212610a766 100644 --- a/Core/src/Surfaces/AnnulusBounds.cpp +++ b/Core/src/Surfaces/AnnulusBounds.cpp @@ -89,15 +89,10 @@ Acts::AnnulusBounds::AnnulusBounds(double minR, double maxR, double minPhi, m_inRightModulePC = stripXYToModulePC(m_inRightStripXY); } -std::vector<double> Acts::AnnulusBounds::boundValues() const { - std::vector<double> values(AnnulusBounds::bv_length); - values[AnnulusBounds::bv_minR] = rMin(); - values[AnnulusBounds::bv_maxR] = rMax(); - values[AnnulusBounds::bv_phiMin] = phiMin(); - values[AnnulusBounds::bv_phiMax] = phiMax(); - values[AnnulusBounds::bv_phiAvg] = 0.5 * (phiMin() + phiMax()); - values[AnnulusBounds::bv_originX] = m_moduleOrigin.x(); - values[AnnulusBounds::bv_originY] = m_moduleOrigin.y(); +Acts::ActsVectorXd Acts::AnnulusBounds::values() const { + ActsVectorXd values; + values << rMin(), rMax(), phiMin(), phiMax(), 0.5 * (phiMin() + phiMax()), + m_moduleOrigin.x(), m_moduleOrigin.y(); return values; } diff --git a/Core/src/Surfaces/ConeBounds.cpp b/Core/src/Surfaces/ConeBounds.cpp index cdf495b7e1ee03f961f3bd823d9d845a3efaba47..db23a536964570bc1f19bbb6e65c7befcdb142e7 100644 --- a/Core/src/Surfaces/ConeBounds.cpp +++ b/Core/src/Surfaces/ConeBounds.cpp @@ -20,14 +20,15 @@ Acts::ConeBounds::ConeBounds(double alpha, bool symm, double halfphi, : ConeBounds(alpha, symm ? -std::numeric_limits<double>::infinity() : 0, std::numeric_limits<double>::infinity(), halfphi, avphi) {} -Acts::ConeBounds::ConeBounds(double alpha, double zmin, double zmax, +Acts::ConeBounds::ConeBounds(double alpha, double minz, double maxz, double halfphi, double avphi) - : m_parameters( - {alpha, zmin, zmax, std::abs(halfphi), detail::radian_sym(avphi)}), - m_tanAlpha(std::tan(alpha)) {} + : m_parameters(), m_tanAlpha(std::tan(alpha)) { + m_parameters << alpha, minz, maxz, std::abs(halfphi), + detail::radian_sym(avphi); +} -Acts::ConeBounds::ConeBounds(const std::vector<double>& parameters) - : m_parameters(parameters), m_tanAlpha(std::tan(get<eAlpha>())) {} +Acts::ConeBounds::ConeBounds(const ActsVectorXd& parameters) + : m_parameters(parameters), m_tanAlpha(std::tan(parameters[eAlpha])) {} Acts::ConeBounds* Acts::ConeBounds::clone() const { return new ConeBounds(*this); @@ -47,24 +48,24 @@ Acts::Vector2D Acts::ConeBounds::shifted( shifted[eLOC_Z] = lposition[eLOC_Z]; shifted[eLOC_RPHI] = std::isnormal(x) - ? (x * radian_sym((lposition[eLOC_RPHI] / x) - get<eAveragePhi>())) + ? (x * radian_sym((lposition[eLOC_RPHI] / x) - get(eAveragePhi))) : lposition[eLOC_RPHI]; return shifted; } bool Acts::ConeBounds::inside(const Acts::Vector2D& lposition, const Acts::BoundaryCheck& bcheck) const { - auto rphiHalf = r(lposition[eLOC_Z]) * get<eHalfPhiSector>(); - return bcheck.isInside(shifted(lposition), Vector2D(-rphiHalf, get<eMinZ>()), - Vector2D(rphiHalf, get<eMaxZ>())); + auto rphiHalf = r(lposition[eLOC_Z]) * get(eHalfPhiSector); + return bcheck.isInside(shifted(lposition), Vector2D(-rphiHalf, get(eMinZ)), + Vector2D(rphiHalf, get(eMaxZ))); } double Acts::ConeBounds::distanceToBoundary( const Acts::Vector2D& lposition) const { - auto rphiHalf = r(lposition[eLOC_Z]) * get<eHalfPhiSector>(); + auto rphiHalf = r(lposition[eLOC_Z]) * get(eHalfPhiSector); return BoundaryCheck(true).distance(shifted(lposition), - Vector2D(-rphiHalf, get<eMinZ>()), - Vector2D(rphiHalf, get<eMaxZ>())); + Vector2D(-rphiHalf, get(eMinZ)), + Vector2D(rphiHalf, get(eMaxZ))); } std::ostream& Acts::ConeBounds::toStream(std::ostream& sl) const { @@ -72,8 +73,8 @@ std::ostream& Acts::ConeBounds::toStream(std::ostream& sl) const { sl << std::setprecision(7); sl << "Acts::ConeBounds: (tanAlpha, minZ, maxZ, halfPhiSector, averagePhi) " "= "; - sl << "(" << m_tanAlpha << ", " << get<eMinZ>() << ", " << get<eMaxZ>() - << ", " << get<eHalfPhiSector>() << ", " << get<eAveragePhi>() << ")"; + sl << "(" << m_tanAlpha << ", " << get(eMinZ) << ", " << get(eMaxZ) << ", " + << get(eHalfPhiSector) << ", " << get(eAveragePhi) << ")"; sl << std::setprecision(-1); return sl; } diff --git a/Core/src/Surfaces/ConeSurface.cpp b/Core/src/Surfaces/ConeSurface.cpp index 7cf09be521ee3915e9a0913b9f9d9aba44cc7f91..1bf3f6bec906bc57321fe0716ec921eae62becdc 100644 --- a/Core/src/Surfaces/ConeSurface.cpp +++ b/Core/src/Surfaces/ConeSurface.cpp @@ -140,8 +140,8 @@ double Acts::ConeSurface::pathCorrection(const GeometryContext& gctx, m_transform ? transform(gctx).inverse() * position : position; double phi = VectorHelpers::phi(posLocal); double sgn = posLocal.z() > 0. ? -1. : +1.; - double cosAlpha = std::cos(bounds().get<ConeBounds::eAlpha>()); - double sinAlpha = std::sin(bounds().get<ConeBounds::eAlpha>()); + double cosAlpha = std::cos(bounds().get(ConeBounds::eAlpha)); + double sinAlpha = std::sin(bounds().get(ConeBounds::eAlpha)); Vector3D normalC(cos(phi) * cosAlpha, sin(phi) * cosAlpha, sgn * sinAlpha); if (m_transform) { normalC = transform(gctx) * normalC; @@ -171,8 +171,8 @@ const Acts::Vector3D Acts::ConeSurface::normal( double phi = lposition[Acts::eLOC_RPHI] / (bounds().r(lposition[Acts::eLOC_Z])), sgn = lposition[Acts::eLOC_Z] > 0 ? -1. : +1.; - double cosAlpha = std::cos(bounds().get<ConeBounds::eAlpha>()); - double sinAlpha = std::sin(bounds().get<ConeBounds::eAlpha>()); + double cosAlpha = std::cos(bounds().get(ConeBounds::eAlpha)); + double sinAlpha = std::sin(bounds().get(ConeBounds::eAlpha)); Vector3D localNormal(cos(phi) * cosAlpha, sin(phi) * cosAlpha, sgn * sinAlpha); return m_transform ? Vector3D(transform(gctx).linear() * localNormal) @@ -203,8 +203,8 @@ Acts::Polyhedron Acts::ConeSurface::polyhedronRepresentation( std::vector<Polyhedron::Face> faces; std::vector<Polyhedron::Face> triangularMesh; - double minZ = bounds().get<ConeBounds::eMinZ>(); - double maxZ = bounds().get<ConeBounds::eMaxZ>(); + double minZ = bounds().get(ConeBounds::eMinZ); + double maxZ = bounds().get(ConeBounds::eMaxZ); if (minZ == -std::numeric_limits<double>::infinity() or maxZ == std::numeric_limits<double>::infinity()) { @@ -222,8 +222,8 @@ Acts::Polyhedron Acts::ConeSurface::polyhedronRepresentation( } // Cone parameters - double hPhiSec = bounds().get<ConeBounds::eHalfPhiSector>(); - double avgPhi = bounds().get<ConeBounds::eAveragePhi>(); + double hPhiSec = bounds().get(ConeBounds::eHalfPhiSector); + double avgPhi = bounds().get(ConeBounds::eAveragePhi); bool fullCone = (hPhiSec == M_PI); // Get the phi segments from the helper diff --git a/Core/src/Surfaces/CylinderBounds.cpp b/Core/src/Surfaces/CylinderBounds.cpp index 38909baeee36298f9ee2f720b4dd9670fa707ceb..3682b82c441b73396806779833d9c3e797cf30b7 100644 --- a/Core/src/Surfaces/CylinderBounds.cpp +++ b/Core/src/Surfaces/CylinderBounds.cpp @@ -18,23 +18,11 @@ using Acts::VectorHelpers::perp; using Acts::VectorHelpers::phi; -Acts::CylinderBounds::CylinderBounds(double radius, double halfZ) - : CylinderBounds(radius, 0, M_PI, halfZ) { - m_closed = true; -} - -Acts::CylinderBounds::CylinderBounds(double radius, double halfPhi, - double halfZ) - : CylinderBounds(radius, 0, halfPhi, halfZ) {} - -Acts::CylinderBounds::CylinderBounds(double radius, double averagePhi, - double halfPhi, double halfZ) - : m_radius(std::abs(radius)), - m_avgPhi(detail::radian_sym(averagePhi)), - m_halfPhi(std::abs(halfPhi)), - m_halfZ(std::abs(halfZ)), - m_closed(false) { - if (halfPhi == M_PI) { +Acts::CylinderBounds::CylinderBounds(double radius, double halfz, + double halfphi, double avphi) + : m_parameters(), m_closed(false) { + m_parameters << radius, halfz, halfphi, avphi; + if (halfphi == M_PI) { m_closed = true; } } @@ -47,27 +35,16 @@ Acts::SurfaceBounds::BoundsType Acts::CylinderBounds::type() const { return SurfaceBounds::eCylinder; } -std::vector<double> Acts::CylinderBounds::boundValues() const { - std::vector<double> values(CylinderBounds::bv_length); - values[CylinderBounds::bv_radius] = m_radius; - values[CylinderBounds::bv_averagePhi] = m_avgPhi; - values[CylinderBounds::bv_halfPhiSector] = m_halfPhi; - values[CylinderBounds::bv_halfZ] = m_halfZ; - return values; -} - -// Convert from (r*phi,z) to (phi,z) centered around phi0 Acts::Vector2D Acts::CylinderBounds::shifted( const Acts::Vector2D& lposition) const { - return {Acts::detail::radian_sym((lposition[Acts::eLOC_RPHI] / m_radius) - - m_avgPhi), + return {Acts::detail::radian_sym((lposition[Acts::eLOC_RPHI] / get(eRadius)) - + get(eAveragePhi)), lposition[Acts::eLOC_Z]}; } -// Jacobian from (r*phi,z) to (phi,z) Acts::ActsSymMatrixD<2> Acts::CylinderBounds::jacobian() const { ActsSymMatrixD<2> j; - j(0, eLOC_RPHI) = 1 / m_radius; + j(0, eLOC_RPHI) = 1 / get(eRadius); j(0, eLOC_Z) = 0; j(1, eLOC_RPHI) = 0; j(1, eLOC_Z) = 1; @@ -77,8 +54,9 @@ Acts::ActsSymMatrixD<2> Acts::CylinderBounds::jacobian() const { bool Acts::CylinderBounds::inside(const Vector2D& lposition, const BoundaryCheck& bcheck) const { return bcheck.transformed(jacobian()) - .isInside(shifted(lposition), Vector2D(-m_halfPhi, -m_halfZ), - Vector2D(m_halfPhi, m_halfZ)); + .isInside(shifted(lposition), + Vector2D(-get(eHalfPhiSector), -get(eHalfLengthZ)), + Vector2D(get(eHalfPhiSector), get(eHalfLengthZ))); } bool Acts::CylinderBounds::inside3D(const Vector3D& position, @@ -92,34 +70,35 @@ bool Acts::CylinderBounds::inside3D(const Vector3D& position, double addToleranceZ = checkAbsolute ? bcheck.m_tolerance[1] : 0.; // check if the position compatible with the radius if ((s_onSurfaceTolerance + addToleranceR) <= - std::abs(perp(position) - m_radius)) { + std::abs(perp(position) - get(eRadius))) { return false; } else if (checkAbsolute && m_closed) { - return ((s_onSurfaceTolerance + addToleranceZ + m_halfZ) >= + return ((s_onSurfaceTolerance + addToleranceZ + get(eHalfLengthZ)) >= std::abs(position.z())); } // detailed, but slower check - Vector2D lpos(detail::radian_sym(phi(position) - m_avgPhi), position.z()); + Vector2D lpos(detail::radian_sym(phi(position) - get(eAveragePhi)), + position.z()); return bcheck.transformed(jacobian()) - .isInside(lpos, Vector2D(-m_halfPhi, -m_halfZ), - Vector2D(m_halfPhi, m_halfZ)); + .isInside(lpos, Vector2D(-get(eHalfPhiSector), -get(eHalfLengthZ)), + Vector2D(get(eHalfPhiSector), get(eHalfLengthZ))); } double Acts::CylinderBounds::distanceToBoundary( const Acts::Vector2D& lposition) const { - return BoundaryCheck(true).distance(shifted(lposition), - Vector2D(-m_halfPhi, -m_halfZ), - Vector2D(m_halfPhi, m_halfZ)); + return BoundaryCheck(true).distance( + shifted(lposition), Vector2D(-get(eHalfPhiSector), -get(eHalfLengthZ)), + Vector2D(get(eHalfPhiSector), get(eHalfLengthZ))); } -// ostream operator overload std::ostream& Acts::CylinderBounds::toStream(std::ostream& sl) const { sl << std::setiosflags(std::ios::fixed); sl << std::setprecision(7); - sl << "Acts::CylinderBounds: (radius, averagePhi, halfPhiSector, " - "halflengthInZ) = "; - sl << "(" << m_radius << ", " << m_avgPhi << ", "; - sl << m_halfPhi << ", " << m_halfZ << ")"; + sl << "Acts::CylinderBounds: (radius, halfLengthZ, halfPhiSector, " + "averagePhi, " + ") = "; + sl << "(" << get(eRadius) << ", " << get(eHalfLengthZ) << ", "; + sl << get(eHalfPhiSector) << ", " << get(eAveragePhi) << ")"; sl << std::setprecision(-1); return sl; } diff --git a/Core/src/Surfaces/CylinderSurface.cpp b/Core/src/Surfaces/CylinderSurface.cpp index cd7ebd3e2cad3a681c239531a6104a60f38789fc..be6a8466ae68e20a1ef2078d2aeccd7c1f410732 100644 --- a/Core/src/Surfaces/CylinderSurface.cpp +++ b/Core/src/Surfaces/CylinderSurface.cpp @@ -31,25 +31,11 @@ Acts::CylinderSurface::CylinderSurface(const GeometryContext& gctx, m_bounds(other.m_bounds) {} Acts::CylinderSurface::CylinderSurface( - std::shared_ptr<const Transform3D> htrans, double radius, double hlength) - : GeometryObject(), - Surface(std::move(htrans)), - m_bounds(std::make_shared<const CylinderBounds>(radius, hlength)) {} - -Acts::CylinderSurface::CylinderSurface( - std::shared_ptr<const Transform3D> htrans, double radius, double hphi, - double hlength) - : GeometryObject(), - Surface(std::move(htrans)), - m_bounds(std::make_shared<const CylinderBounds>(radius, hphi, hlength)) {} - -Acts::CylinderSurface::CylinderSurface( - std::shared_ptr<const CylinderBounds> cbounds, - const Acts::DetectorElementBase& detelement) - : Surface(detelement), m_bounds(std::move(cbounds)) { - /// surfaces representing a detector element must have bounds - assert(cbounds); -} + std::shared_ptr<const Transform3D> htrans, double radius, double halfz, + double halfphi, double avphi) + : Surface(std::move(htrans)), + m_bounds(std::make_shared<const CylinderBounds>(radius, halfz, halfphi, + avphi)) {} Acts::CylinderSurface::CylinderSurface( std::shared_ptr<const Transform3D> htrans, @@ -73,8 +59,8 @@ const Acts::Vector3D Acts::CylinderSurface::binningPosition( const Acts::Vector3D& sfCenter = center(gctx); // special binning type for R-type methods if (bValue == Acts::binR || bValue == Acts::binRPhi) { - double R = bounds().r(); - double phi = m_bounds ? m_bounds->averagePhi() : 0.; + double R = bounds().get(CylinderBounds::eRadius); + double phi = bounds().get(CylinderBounds::eAveragePhi); return Vector3D(sfCenter.x() + R * cos(phi), sfCenter.y() + R * sin(phi), sfCenter.z()); } @@ -112,7 +98,7 @@ void Acts::CylinderSurface::localToGlobal(const GeometryContext& gctx, const Vector3D& /*unused*/, Vector3D& position) const { // create the position in the local 3d frame - double r = bounds().r(); + double r = bounds().get(CylinderBounds::eRadius); double phi = lposition[Acts::eLOC_RPHI] / r; position = Vector3D(r * cos(phi), r * sin(phi), lposition[Acts::eLOC_Z]); position = transform(gctx) * position; @@ -127,7 +113,7 @@ bool Acts::CylinderSurface::globalToLocal(const GeometryContext& gctx, // transform it to the globalframe: CylinderSurfaces are allowed to have 0 // pointer transform double radius = 0.; - double inttol = bounds().r() * 0.0001; + double inttol = bounds().get(CylinderBounds::eRadius) * 0.0001; if (inttol < 0.01) { inttol = 0.01; } @@ -135,10 +121,13 @@ bool Acts::CylinderSurface::globalToLocal(const GeometryContext& gctx, const Transform3D& sfTransform = transform(gctx); Transform3D inverseTrans(sfTransform.inverse()); Vector3D loc3Dframe(inverseTrans * position); - lposition = Vector2D(bounds().r() * phi(loc3Dframe), loc3Dframe.z()); + lposition = Vector2D(bounds().get(CylinderBounds::eRadius) * phi(loc3Dframe), + loc3Dframe.z()); radius = perp(loc3Dframe); // return true or false - return ((std::abs(radius - bounds().r()) > inttol) ? false : true); + return ((std::abs(radius - bounds().get(CylinderBounds::eRadius)) > inttol) + ? false + : true); } std::string Acts::CylinderSurface::name() const { @@ -157,7 +146,8 @@ Acts::CylinderSurface* Acts::CylinderSurface::clone_impl( const Acts::Vector3D Acts::CylinderSurface::normal( const GeometryContext& gctx, const Acts::Vector2D& lposition) const { - double phi = lposition[Acts::eLOC_RPHI] / m_bounds->r(); + double phi = + lposition[Acts::eLOC_RPHI] / m_bounds->get(CylinderBounds::eRadius); Vector3D localNormal(cos(phi), sin(phi), 0.); return Vector3D(transform(gctx).matrix().block<3, 3>(0, 0) * localNormal); } @@ -195,13 +185,14 @@ Acts::Polyhedron Acts::CylinderSurface::polyhedronRepresentation( auto ctrans = transform(gctx); bool fullCylinder = bounds().coversFullAzimuth(); + double avgPhi = bounds().get(CylinderBounds::eAveragePhi); + double halfPhi = bounds().get(CylinderBounds::eHalfPhiSector); + // Get the phi segments from the helper - ensures extra points auto phiSegs = fullCylinder ? detail::VerticesHelper::phiSegments() : detail::VerticesHelper::phiSegments( - bounds().averagePhi() - bounds().halfPhiSector(), - bounds().averagePhi() + bounds().halfPhiSector(), - {bounds().averagePhi()}); + avgPhi - halfPhi, avgPhi + halfPhi, {avgPhi}); // Write the two bows/circles on either side std::vector<int> sides = {-1, 1}; @@ -210,9 +201,12 @@ Acts::Polyhedron Acts::CylinderSurface::polyhedronRepresentation( int addon = (iseg == phiSegs.size() - 2 and not fullCylinder) ? 1 : 0; /// Helper method to create the segment detail::VerticesHelper::createSegment( - vertices, {bounds().r(), bounds().r()}, phiSegs[iseg], - phiSegs[iseg + 1], lseg, addon, - Vector3D(0., 0., side * bounds().halflengthZ()), ctrans); + vertices, + {bounds().get(CylinderBounds::eRadius), + bounds().get(CylinderBounds::eRadius)}, + phiSegs[iseg], phiSegs[iseg + 1], lseg, addon, + Vector3D(0., 0., side * bounds().get(CylinderBounds::eHalfLengthZ)), + ctrans); } } auto facesMesh = diff --git a/Core/src/Surfaces/DiamondBounds.cpp b/Core/src/Surfaces/DiamondBounds.cpp index e1ac2a67bb49d55ba159025f4c557ac2064527d6..6055bcd35ae4564f557069a7522b64bdcd044d5d 100644 --- a/Core/src/Surfaces/DiamondBounds.cpp +++ b/Core/src/Surfaces/DiamondBounds.cpp @@ -33,13 +33,9 @@ Acts::SurfaceBounds::BoundsType Acts::DiamondBounds::type() const { return SurfaceBounds::eDiamond; } -std::vector<double> Acts::DiamondBounds::boundValues() const { - std::vector<double> values(DiamondBounds::bv_length); - values[DiamondBounds::bv_x1] = x1(); - values[DiamondBounds::bv_x2] = x2(); - values[DiamondBounds::bv_x3] = x3(); - values[DiamondBounds::bv_y1] = y1(); - values[DiamondBounds::bv_y2] = y2(); +Acts::ActsVectorXd Acts::DiamondBounds::values() const { + ActsVectorXd values; + values << x1(), x2(), x3(), y1(), y2(); return values; } diff --git a/Core/src/Surfaces/DiscTrapezoidBounds.cpp b/Core/src/Surfaces/DiscTrapezoidBounds.cpp index 625a8fde3a46ca85fb9095e795c6baf947d2de9d..020ce3b72c9bd9dc71cf0a4e3621d7127f844533 100644 --- a/Core/src/Surfaces/DiscTrapezoidBounds.cpp +++ b/Core/src/Surfaces/DiscTrapezoidBounds.cpp @@ -32,14 +32,10 @@ Acts::SurfaceBounds::BoundsType Acts::DiscTrapezoidBounds::type() const { return SurfaceBounds::eDiscTrapezoid; } -std::vector<double> Acts::DiscTrapezoidBounds::boundValues() const { - std::vector<double> values(DiscTrapezoidBounds::bv_length); - values[bv_rMin] = rMin(); - values[bv_rMax] = rMax(); - values[bv_minHalfX] = minHalflengthX(); - values[bv_maxHalfX] = maxHalflengthX(); - values[bv_averagePhi] = averagePhi(); - values[bv_stereo] = m_stereo; +Acts::ActsVectorXd Acts::DiscTrapezoidBounds::values() const { + ActsVectorXd values; + values << rMin(), rMax(), minHalflengthX(), maxHalflengthX(), averagePhi(), + m_stereo; return values; } diff --git a/Core/src/Surfaces/EllipseBounds.cpp b/Core/src/Surfaces/EllipseBounds.cpp index e3aa15f9fe8e6e3a746af824894808af551c0e82..1a0bc7f37c46a0e136311ef83d5ffb4c14ab1d6a 100644 --- a/Core/src/Surfaces/EllipseBounds.cpp +++ b/Core/src/Surfaces/EllipseBounds.cpp @@ -39,14 +39,9 @@ Acts::SurfaceBounds::BoundsType Acts::EllipseBounds::type() const { return SurfaceBounds::eEllipse; } -std::vector<double> Acts::EllipseBounds::boundValues() const { - std::vector<double> values(EllipseBounds::bv_length); - values[EllipseBounds::bv_rMinX] = m_rMinX; - values[EllipseBounds::bv_rMinY] = m_rMinY; - values[EllipseBounds::bv_rMaxX] = m_rMaxX; - values[EllipseBounds::bv_rMaxY] = m_rMaxY; - values[EllipseBounds::bv_averagePhi] = m_avgPhi; - values[EllipseBounds::bv_halfPhiSector] = m_halfPhi; +Acts::ActsVectorXd Acts::EllipseBounds::values() const { + ActsVectorXd values; + values << m_rMinX, m_rMinY, m_rMaxX, m_rMaxY, m_avgPhi, m_halfPhi; return values; } @@ -72,10 +67,10 @@ bool Acts::EllipseBounds::inside(const Acts::Vector2D& lposition, } // For ellipse bound this is only approximation which is valid -// only if m_boundValues.at(EllipseBounds::bv_rMinX) ~= -// m_boundValues.at(EllipseBounds::bv_rMinY) -// and m_boundValues.at(EllipseBounds::bv_rMaxX) ~= -// m_boundValues.at(EllipseBounds::bv_rMaxY) +// only if m_values.at(EllipseBounds::bv_rMinX) ~= +// m_values.at(EllipseBounds::bv_rMinY) +// and m_values.at(EllipseBounds::bv_rMaxX) ~= +// m_values.at(EllipseBounds::bv_rMaxY) // double Acts::EllipseBounds::distanceToBoundary( const Vector2D& lposition) const { diff --git a/Core/src/Surfaces/LineBounds.cpp b/Core/src/Surfaces/LineBounds.cpp index 5fc70ca4ff4f05a1b42e255ac0f9d7aa20df97cf..4e0a24f0f681b811cb9bb347782776605354da73 100644 --- a/Core/src/Surfaces/LineBounds.cpp +++ b/Core/src/Surfaces/LineBounds.cpp @@ -22,10 +22,9 @@ Acts::SurfaceBounds::BoundsType Acts::LineBounds::type() const { return SurfaceBounds::eLine; } -std::vector<double> Acts::LineBounds::boundValues() const { - std::vector<double> values(LineBounds::bv_length); - values[LineBounds::bv_radius] = r(); - values[LineBounds::bv_halfZ] = halflengthZ(); +Acts::ActsVectorXd Acts::LineBounds::values() const { + ActsVectorXd values; + values << r(), halflengthZ(); return values; } diff --git a/Core/src/Surfaces/PlaneSurface.cpp b/Core/src/Surfaces/PlaneSurface.cpp index 4fb44e33aa52f0118868732ba0195ef8c017e11d..b08573700527219425c19cc55aca0f2b293a66b6 100644 --- a/Core/src/Surfaces/PlaneSurface.cpp +++ b/Core/src/Surfaces/PlaneSurface.cpp @@ -135,7 +135,7 @@ Acts::Polyhedron Acts::PlaneSurface::polyhedronRepresentation( bool isEllipse = bounds().type() == SurfaceBounds::eEllipse; bool innerExists = false, coversFull = false; if (isEllipse) { - auto vStore = bounds().boundValues(); + auto vStore = bounds().values(); innerExists = std::abs(vStore[EllipseBounds::BoundValues::bv_rMinX]) < s_onSurfaceTolerance; coversFull = diff --git a/Core/src/Surfaces/RadialBounds.cpp b/Core/src/Surfaces/RadialBounds.cpp index 90b4c7c4789af8e86f3b39642d821f43762e40b1..a639b04485d96db96838e37a397f2d255b5ab408 100644 --- a/Core/src/Surfaces/RadialBounds.cpp +++ b/Core/src/Surfaces/RadialBounds.cpp @@ -32,12 +32,9 @@ Acts::SurfaceBounds::BoundsType Acts::RadialBounds::type() const { return SurfaceBounds::eDisc; } -std::vector<double> Acts::RadialBounds::boundValues() const { - std::vector<double> values(RadialBounds::bv_length); - values[RadialBounds::bv_rMin] = rMin(); - values[RadialBounds::bv_rMax] = rMax(); - values[RadialBounds::bv_averagePhi] = averagePhi(); - values[RadialBounds::bv_halfPhiSector] = halfPhiSector(); +Acts::ActsVectorXd Acts::RadialBounds::values() const { + ActsVectorXd values; + values << rMin(), rMax(), averagePhi(), halfPhiSector(); return values; } diff --git a/Core/src/Surfaces/RectangleBounds.cpp b/Core/src/Surfaces/RectangleBounds.cpp index 7f8a5afdcd311d7f6162f33367b78f109f243359..4658042e9f4484b2ca74943b29cc2b352ac38258 100644 --- a/Core/src/Surfaces/RectangleBounds.cpp +++ b/Core/src/Surfaces/RectangleBounds.cpp @@ -24,9 +24,9 @@ Acts::RectangleBounds* Acts::RectangleBounds::clone() const { return new RectangleBounds(*this); } -std::vector<double> Acts::RectangleBounds::boundValues() const { - std::vector<double> values(RectangleBounds::bv_length); - values = {m_min.x(), m_min.y(), m_max.x(), m_max.y()}; +Acts::ActsVectorXd Acts::RectangleBounds::values() const { + ActsVectorXd values; + values << m_min.x(), m_min.y(), m_max.x(), m_max.y(); return values; } diff --git a/Core/src/Surfaces/TrapezoidBounds.cpp b/Core/src/Surfaces/TrapezoidBounds.cpp index 1ae3cb84fbc85c11316926c6deb681b137b5f254..0e7ee44542c28e086fed7838c60d986bc81e14dc 100644 --- a/Core/src/Surfaces/TrapezoidBounds.cpp +++ b/Core/src/Surfaces/TrapezoidBounds.cpp @@ -29,11 +29,9 @@ Acts::SurfaceBounds::BoundsType Acts::TrapezoidBounds::type() const { return SurfaceBounds::eTrapezoid; } -std::vector<double> Acts::TrapezoidBounds::boundValues() const { - std::vector<double> values(TrapezoidBounds::bv_length); - values[TrapezoidBounds::bv_minHalfX] = minHalflengthX(); - values[TrapezoidBounds::bv_maxHalfX] = maxHalflengthX(); - values[TrapezoidBounds::bv_halfY] = halflengthY(); +Acts::ActsVectorXd Acts::TrapezoidBounds::values() const { + ActsVectorXd values; + values << minHalflengthX(), maxHalflengthX(), halflengthY(); return values; } diff --git a/Core/src/Surfaces/TriangleBounds.cpp b/Core/src/Surfaces/TriangleBounds.cpp index 7ee9cae680b946c8850a4c708e8cfdcd317cdec4..6503192689ec5f1fcc558318b969ca3ed7b5409c 100644 --- a/Core/src/Surfaces/TriangleBounds.cpp +++ b/Core/src/Surfaces/TriangleBounds.cpp @@ -32,14 +32,10 @@ Acts::SurfaceBounds::BoundsType Acts::TriangleBounds::type() const { return SurfaceBounds::eTriangle; } -std::vector<double> Acts::TriangleBounds::boundValues() const { - std::vector<double> values(TriangleBounds::bv_length); - values[TriangleBounds::bv_x1] = m_vertices[0].x(); - values[TriangleBounds::bv_y1] = m_vertices[0].y(); - values[TriangleBounds::bv_x2] = m_vertices[1].x(); - values[TriangleBounds::bv_y2] = m_vertices[1].y(); - values[TriangleBounds::bv_x3] = m_vertices[2].x(); - values[TriangleBounds::bv_y3] = m_vertices[2].y(); +Acts::ActsVectorXd Acts::TriangleBounds::values() const { + ActsVectorXd values; + values << m_vertices[0].x(), m_vertices[0].y(), m_vertices[1].x(), + m_vertices[1].y(), m_vertices[2].x(), m_vertices[2].y(); return values; } diff --git a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/ActsExtension.hpp b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/ActsExtension.hpp index 768cabd4dc32f9334fe92cc897fcac3539c9cb25..2dc04a8ced8fa6c818ad6a217164c8b291ccf0ae 100644 --- a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/ActsExtension.hpp +++ b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/ActsExtension.hpp @@ -115,7 +115,7 @@ class ActsExtension { std::map<std::string, std::string> m_flagStore; /// Unique value store for doubles - std::map<std::string, double> m_boundValues; + std::map<std::string, double> m_values; }; // Templated helper method to get from the value/type store diff --git a/Plugins/DD4hep/src/ActsExtension.cpp b/Plugins/DD4hep/src/ActsExtension.cpp index 2852a2764308eca12686b2e195b5a460c7a07f0c..1ab694d81e350bd0a455685e4c58fd3526a647e2 100644 --- a/Plugins/DD4hep/src/ActsExtension.cpp +++ b/Plugins/DD4hep/src/ActsExtension.cpp @@ -14,22 +14,22 @@ Acts::ActsExtension::ActsExtension(const std::string& axes) { Acts::ActsExtension::ActsExtension(const ActsExtension& ext, const dd4hep::DetElement& /*elem*/) - : m_flagStore(ext.m_flagStore), m_boundValues(ext.m_boundValues) {} + : m_flagStore(ext.m_flagStore), m_values(ext.m_values) {} double Acts::ActsExtension::getValue(const std::string& tag, const std::string& category) const noexcept(false) { - return getT(m_boundValues, tag, category); + return getT(m_values, tag, category); } void Acts::ActsExtension::addValue(double value, const std::string& tag, const std::string& category) { - addT(m_boundValues, value, tag, category, 0.0); + addT(m_values, value, tag, category, 0.0); } bool Acts::ActsExtension::hasValue(const std::string& tag, const std::string& category) const { - return hasT(m_boundValues, tag, category); + return hasT(m_values, tag, category); } bool Acts::ActsExtension::hasType(const std::string& type, @@ -63,7 +63,7 @@ std::string Acts::ActsExtension::toString() const { } rString += "- value store: "; rString += '\n'; - for (auto const& [key, value] : m_boundValues) { + for (auto const& [key, value] : m_values) { rString += key; rString += " : "; rString += std::to_string(value); diff --git a/Plugins/Digitization/include/Acts/Plugins/Digitization/CartesianSegmentation.hpp b/Plugins/Digitization/include/Acts/Plugins/Digitization/CartesianSegmentation.hpp index 845366b89c2b2041e1e637034a5aadfc1f5af03e..08ff4f1f820087422deb5dde8f6cbd664458e64b 100644 --- a/Plugins/Digitization/include/Acts/Plugins/Digitization/CartesianSegmentation.hpp +++ b/Plugins/Digitization/include/Acts/Plugins/Digitization/CartesianSegmentation.hpp @@ -138,7 +138,7 @@ inline DigitizationCell CartesianSegmentation::cell( inline std::pair<double, double> CartesianSegmentation::pitch() const { auto boundingBox = m_activeBounds->boundingBox(); - auto values = boundingBox.boundValues(); + auto values = boundingBox.values(); double pitchX = 2. * values[0] / m_binUtility->bins(0); double pitchY = 2. * values[1] / m_binUtility->bins(1); return std::pair<double, double>(pitchX, pitchY); diff --git a/Plugins/Json/src/JsonGeometryConverter.cpp b/Plugins/Json/src/JsonGeometryConverter.cpp index 45f40f816ffad082b0f5f12a246522265076f2ff..0700c2ac83d9b3b5a33383b4984af36ed7cc4a24 100644 --- a/Plugins/Json/src/JsonGeometryConverter.cpp +++ b/Plugins/Json/src/JsonGeometryConverter.cpp @@ -600,9 +600,11 @@ void Acts::JsonGeometryConverter::addSurfaceToJson(json& sjson, } if (cylinderBounds != nullptr) { sjson[m_cfg.surfacetypekey] = "Cylinder"; - sjson[m_cfg.surfacepositionkey] = cylinderBounds->r(); - sjson[m_cfg.surfacerangekey] = {-1 * cylinderBounds->halflengthZ(), - cylinderBounds->halflengthZ()}; + sjson[m_cfg.surfacepositionkey] = + cylinderBounds->get(CylinderBounds::eRadius); + sjson[m_cfg.surfacerangekey] = { + -1 * cylinderBounds->get(CylinderBounds::eHalfLengthZ), + cylinderBounds->get(CylinderBounds::eHalfLengthZ)}; } if (annulusBounds != nullptr) { sjson[m_cfg.surfacetypekey] = "Annulus"; @@ -673,13 +675,17 @@ Acts::BinUtility Acts::JsonGeometryConverter::DefaultBin( Acts::open, Acts::binR); } if (cylinderBounds != nullptr) { - bUtility += BinUtility( - 1, cylinderBounds->averagePhi() - cylinderBounds->halfPhiSector(), - cylinderBounds->averagePhi() + cylinderBounds->halfPhiSector(), - Acts::closed, Acts::binPhi); bUtility += - BinUtility(1, -1 * cylinderBounds->halflengthZ(), - cylinderBounds->halflengthZ(), Acts::open, Acts::binZ); + BinUtility(1, + cylinderBounds->get(CylinderBounds::eAveragePhi) - + cylinderBounds->get(CylinderBounds::eHalfPhiSector), + cylinderBounds->get(CylinderBounds::eAveragePhi) + + cylinderBounds->get(CylinderBounds::eHalfPhiSector), + Acts::closed, Acts::binPhi); + bUtility += + BinUtility(1, -1 * cylinderBounds->get(CylinderBounds::eHalfLengthZ), + cylinderBounds->get(CylinderBounds::eHalfLengthZ), + Acts::open, Acts::binZ); } if (annulusBounds != nullptr) { bUtility += BinUtility(1, annulusBounds->phiMin(), annulusBounds->phiMax(), diff --git a/Tests/UnitTests/Core/EventData/BoundParametersTests.cpp b/Tests/UnitTests/Core/EventData/BoundParametersTests.cpp index 1b5529f9c7327b53106b1b478f06b2c61d91de6b..0064b6848213617cbd1f670869985fd07be5f1a0 100644 --- a/Tests/UnitTests/Core/EventData/BoundParametersTests.cpp +++ b/Tests/UnitTests/Core/EventData/BoundParametersTests.cpp @@ -279,9 +279,9 @@ BOOST_DATA_TEST_CASE( Vector3D mom = p * direction; // 3D position in local frame - const double phi_l = pars_array[0] / bounds->r(); - Vector3D pos = (bounds->r() * cos(phi_l)) * rot.col(0) + - (bounds->r() * sin(phi_l)) * rot.col(1) + + double r = bounds->get(CylinderBounds::eRadius); + const double phi_l = pars_array[0] / r; + Vector3D pos = (r * cos(phi_l)) * rot.col(0) + (r * sin(phi_l)) * rot.col(1) + (pars_array[1]) * rot.col(2) + center; // constructor from parameter vector diff --git a/Tests/UnitTests/Core/EventData/MeasurementHelpersTests.cpp b/Tests/UnitTests/Core/EventData/MeasurementHelpersTests.cpp index 3b424e4fa12930eb9e454b9132573a6f4dc2dcc3..6ee55462c38f3e25f5510a780bddcd21d154ce78 100644 --- a/Tests/UnitTests/Core/EventData/MeasurementHelpersTests.cpp +++ b/Tests/UnitTests/Core/EventData/MeasurementHelpersTests.cpp @@ -25,8 +25,11 @@ using MeasurementType = Measurement<SourceLink, params...>; using FittableMeasurement = FittableMeasurement<SourceLink>; BOOST_AUTO_TEST_CASE(getSurface_test) { - auto cylinder = Surface::makeShared<CylinderSurface>(nullptr, 3, 10); - auto cylinder2 = Surface::makeShared<CylinderSurface>(nullptr, 3, 10); + auto cylinderBounds = std::make_shared<CylinderBounds>(3, 10); + + auto cylinder = Surface::makeShared<CylinderSurface>(nullptr, cylinderBounds); + auto cylinder2 = + Surface::makeShared<CylinderSurface>(nullptr, cylinderBounds); ActsSymMatrixD<2> cov; cov << 0.04, 0, 0, 0.1; diff --git a/Tests/UnitTests/Core/Geometry/LayerCreatorTests.cpp b/Tests/UnitTests/Core/Geometry/LayerCreatorTests.cpp index 88e04677c85875f15ae9cb64a9afb756a3e1fb7f..547fe1263d2d9d2a65e2e9029cb006914c7b91f7 100644 --- a/Tests/UnitTests/Core/Geometry/LayerCreatorTests.cpp +++ b/Tests/UnitTests/Core/Geometry/LayerCreatorTests.cpp @@ -252,8 +252,9 @@ BOOST_FIXTURE_TEST_CASE(LayerCreator_createCylinderLayer, LayerCreatorFixture) { CHECK_CLOSE_REL(layer->thickness(), (rMax - rMin) + 2 * envR, 1e-3); const CylinderBounds* bounds = &layer->bounds(); - CHECK_CLOSE_REL(bounds->r(), (rMax + rMin) / 2., 1e-3); - CHECK_CLOSE_REL(bounds->halflengthZ(), 14 + envZ, 1e-3); + CHECK_CLOSE_REL(bounds->get(CylinderBounds::eRadius), (rMax + rMin) / 2., + 1e-3); + CHECK_CLOSE_REL(bounds->get(CylinderBounds::eHalfLengthZ), 14 + envZ, 1e-3); BOOST_CHECK(checkBinning(tgContext, *layer->surfaceArray())); auto axes = layer->surfaceArray()->getAxes(); BOOST_CHECK_EQUAL(axes.at(0)->getNBins(), 30u); @@ -272,8 +273,9 @@ BOOST_FIXTURE_TEST_CASE(LayerCreator_createCylinderLayer, LayerCreatorFixture) { p_LC->cylinderLayer(tgContext, srf, 30, 7, pl2)); CHECK_CLOSE_REL(layer->thickness(), (rMax - rMin) + 2 * envR, 1e-3); bounds = &layer->bounds(); - CHECK_CLOSE_REL(bounds->r(), (rMax + rMin) / 2., 1e-3); - CHECK_CLOSE_REL(bounds->halflengthZ(), 14 + envZ, 1e-3); + CHECK_CLOSE_REL(bounds->get(CylinderBounds::eRadius), (rMax + rMin) / 2., + 1e-3); + CHECK_CLOSE_REL(bounds->get(CylinderBounds::eHalfLengthZ), 14 + envZ, 1e-3); BOOST_CHECK(checkBinning(tgContext, *layer->surfaceArray())); axes = layer->surfaceArray()->getAxes(); BOOST_CHECK_EQUAL(axes.at(0)->getNBins(), 30u); @@ -287,8 +289,9 @@ BOOST_FIXTURE_TEST_CASE(LayerCreator_createCylinderLayer, LayerCreatorFixture) { p_LC->cylinderLayer(tgContext, srf, 13, 3, pl2)); CHECK_CLOSE_REL(layer->thickness(), (rMax - rMin) + 2 * envR, 1e-3); bounds = &layer->bounds(); - CHECK_CLOSE_REL(bounds->r(), (rMax + rMin) / 2., 1e-3); - CHECK_CLOSE_REL(bounds->halflengthZ(), 14 + envZ, 1e-3); + CHECK_CLOSE_REL(bounds->get(CylinderBounds::eRadius), (rMax + rMin) / 2., + 1e-3); + CHECK_CLOSE_REL(bounds->get(CylinderBounds::eHalfLengthZ), 14 + envZ, 1e-3); // this succeeds despite sub-optimal binning // since we now have multientry bins BOOST_CHECK(checkBinning(tgContext, *layer->surfaceArray())); @@ -310,8 +313,8 @@ BOOST_FIXTURE_TEST_CASE(LayerCreator_createCylinderLayer, LayerCreatorFixture) { p_LC->cylinderLayer(tgContext, srf, equidistant, equidistant, pl3)); CHECK_CLOSE_REL(layer->thickness(), 19, 1e-3); bounds = &layer->bounds(); - CHECK_CLOSE_REL(bounds->r(), 10.5, 1e-3); - CHECK_CLOSE_REL(bounds->halflengthZ(), 25, 1e-3); + CHECK_CLOSE_REL(bounds->get(CylinderBounds::eRadius), 10.5, 1e-3); + CHECK_CLOSE_REL(bounds->get(CylinderBounds::eHalfLengthZ), 25, 1e-3); // this should fail, b/c it's a completely inconvenient binning // but it succeeds despite sub-optimal binning diff --git a/Tests/UnitTests/Core/Geometry/TrackingVolumeCreation.hpp b/Tests/UnitTests/Core/Geometry/TrackingVolumeCreation.hpp index 06a76eff553473bc4f13e2a5ecc3cac2daeb4cdd..b9cdea978a7b77e8e60557749f637acf4d3e43a8 100644 --- a/Tests/UnitTests/Core/Geometry/TrackingVolumeCreation.hpp +++ b/Tests/UnitTests/Core/Geometry/TrackingVolumeCreation.hpp @@ -35,12 +35,15 @@ TrackingVolumePtr constructCylinderVolume( auto sfpTransform = std::make_shared<const Transform3D>(Translation3D(sfpPosition)); /// the surfaces - auto sfn = Surface::makeShared<CylinderSurface>( - sfnTransform, surfaceRadius - 0.5 * surfaceRstagger, surfaceHalfLengthZ); - auto sfc = Surface::makeShared<CylinderSurface>( - sfcTransform, surfaceRadius + 0.5 * surfaceRstagger, surfaceHalfLengthZ); - auto sfp = Surface::makeShared<CylinderSurface>( - sfpTransform, surfaceRadius - 0.5 * surfaceRstagger, surfaceHalfLengthZ); + auto sfnBounds = std::make_shared<CylinderBounds>( + surfaceRadius - 0.5 * surfaceRstagger, surfaceHalfLengthZ); + auto sfn = Surface::makeShared<CylinderSurface>(sfnTransform, sfnBounds); + auto sfcBounds = std::make_shared<CylinderBounds>( + surfaceRadius + 0.5 * surfaceRstagger, surfaceHalfLengthZ); + auto sfc = Surface::makeShared<CylinderSurface>(sfcTransform, sfcBounds); + auto sfpBounds = std::make_shared<CylinderBounds>( + surfaceRadius - 0.5 * surfaceRstagger, surfaceHalfLengthZ); + auto sfp = Surface::makeShared<CylinderSurface>(sfpTransform, sfpBounds); /// prepare the surfaces diff --git a/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp b/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp index d690f011c3c35351c2545595f01ebb45259d0f3c..7d1e08c753f40b6146556ff62cdf783858a58d93 100644 --- a/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp +++ b/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp @@ -119,8 +119,10 @@ BFieldType bField(0, 0, Bz); EigenStepperType estepper(bField); EigenPropagatorType epropagator(std::move(estepper)); -auto mSurface = Surface::makeShared<CylinderSurface>(nullptr, 10., 1000_mm); -auto cSurface = Surface::makeShared<CylinderSurface>(nullptr, 150., 1000_mm); +auto mCylinder = std::make_shared<CylinderBounds>(10_mm, 1000_mm); +auto mSurface = Surface::makeShared<CylinderSurface>(nullptr, mCylinder); +auto cCylinder = std::make_shared<CylinderBounds>(150_mm, 1000_mm); +auto cSurface = Surface::makeShared<CylinderSurface>(nullptr, cCylinder); const int ntests = 5; diff --git a/Tests/UnitTests/Core/Surfaces/ConeBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/ConeBoundsTests.cpp index 7ec2267736953335d463bc923c40ffe12bb7d9f2..2d164c74519a200b660e66e340a0efeaa02ee2e5 100644 --- a/Tests/UnitTests/Core/Surfaces/ConeBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/ConeBoundsTests.cpp @@ -83,16 +83,16 @@ BOOST_AUTO_TEST_CASE(ConeBoundsProperties) { CHECK_CLOSE_REL(coneBoundsObject.tanAlpha(), std::tan(alpha), 1e-6); // /// test for alpha - CHECK_CLOSE_REL(coneBoundsObject.get<ConeBounds::eAlpha>(), alpha, 1e-6); + CHECK_CLOSE_REL(coneBoundsObject.get(ConeBounds::eAlpha), alpha, 1e-6); // /// test for minZ - CHECK_CLOSE_REL(coneBoundsObject.get<ConeBounds::eMinZ>(), zMin, 1e-6); + CHECK_CLOSE_REL(coneBoundsObject.get(ConeBounds::eMinZ), zMin, 1e-6); // /// test for maxZ - CHECK_CLOSE_REL(coneBoundsObject.get<ConeBounds::eMaxZ>(), zMax, 1e-6); + CHECK_CLOSE_REL(coneBoundsObject.get(ConeBounds::eMaxZ), zMax, 1e-6); // /// test for averagePhi - CHECK_CLOSE_REL(coneBoundsObject.get<ConeBounds::eHalfPhiSector>(), halfPhi, + CHECK_CLOSE_REL(coneBoundsObject.get(ConeBounds::eHalfPhiSector), halfPhi, 1e-6); /// test for dump boost::test_tools::output_test_stream dumpOuput; diff --git a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp index 2080fad9c26feb3e14ea1032d144dc925932e852..92c26897df96e2dea06300922447e6bfc4d97712 100644 --- a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp @@ -90,17 +90,21 @@ BOOST_AUTO_TEST_CASE(CylinderBoundsProperties) { 1e-6); // fail /// test for r() - CHECK_CLOSE_REL(cylinderBoundsObject.r(), nominalRadius, 1e-6); + CHECK_CLOSE_REL(cylinderBoundsObject.get(CylinderBounds::eRadius), + nominalRadius, 1e-6); /// test for averagePhi - CHECK_CLOSE_REL(cylinderBoundsObject.averagePhi(), averagePhi, 1e-6); + CHECK_CLOSE_REL(cylinderBoundsObject.get(CylinderBounds::eAveragePhi), + averagePhi, 1e-6); /// test for halfPhiSector - CHECK_CLOSE_REL(cylinderBoundsSegment.halfPhiSector(), halfphi, + CHECK_CLOSE_REL(cylinderBoundsSegment.get(CylinderBounds::eHalfPhiSector), + halfphi, 1e-6); // fail /// test for halflengthZ (NOTE: Naming violation) - CHECK_CLOSE_REL(cylinderBoundsObject.halflengthZ(), nominalHalfLength, 1e-6); + CHECK_CLOSE_REL(cylinderBoundsObject.get(CylinderBounds::eHalfLengthZ), + nominalHalfLength, 1e-6); /// test for dump boost::test_tools::output_test_stream dumpOuput; @@ -117,7 +121,8 @@ BOOST_AUTO_TEST_CASE(CylinderBoundsAssignment) { CylinderBounds cylinderBoundsObject(nominalRadius, nominalHalfLength); CylinderBounds assignedCylinderBounds(10.5, 6.6); assignedCylinderBounds = cylinderBoundsObject; - BOOST_CHECK_EQUAL(assignedCylinderBounds.r(), cylinderBoundsObject.r()); + BOOST_CHECK_EQUAL(assignedCylinderBounds.get(CylinderBounds::eRadius), + cylinderBoundsObject.get(CylinderBounds::eRadius)); BOOST_CHECK_EQUAL(assignedCylinderBounds, cylinderBoundsObject); } diff --git a/Tests/UnitTests/Core/Surfaces/SurfaceBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/SurfaceBoundsTests.cpp index 6b3b9877242f56f060416689d7a1f86ed5ee9d8a..f404797562cad6fbfceb5dc1a0b108a0f7699760 100644 --- a/Tests/UnitTests/Core/Surfaces/SurfaceBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/SurfaceBoundsTests.cpp @@ -28,7 +28,7 @@ class SurfaceBoundsStub : public SurfaceBounds { } SurfaceBounds* clone() const final { return nullptr; } BoundsType type() const final { return SurfaceBounds::eOther; } - std::vector<double> boundValues() const override { return m_values; } + ActsVectorXd values() const override { return m_values; } bool inside(const Vector2D& /*lpos*/, const BoundaryCheck& /*bcheck*/) const final { return true; @@ -42,7 +42,7 @@ class SurfaceBoundsStub : public SurfaceBounds { } private: - std::vector<double> m_values; + ActsVectorXd m_values; }; namespace Test { @@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE(SurfaceBoundsConstruction) { BOOST_AUTO_TEST_CASE(SurfaceBoundsProperties) { SurfaceBoundsStub surface(5); std::vector<double> reference{0, 1, 2, 3, 4}; - const auto& boundValues = surface.boundValues(); + const auto& boundValues = surface.values(); BOOST_CHECK_EQUAL_COLLECTIONS(reference.cbegin(), reference.cend(), boundValues.cbegin(), boundValues.cend()); } @@ -71,8 +71,8 @@ BOOST_AUTO_TEST_CASE(SurfaceBoundsEquality) { SurfaceBoundsStub assignedSurface; assignedSurface = surface; BOOST_CHECK_EQUAL(surface, assignedSurface); - const auto& surfaceboundValues = surface.boundValues(); - const auto& assignedboundValues = assignedSurface.boundValues(); + const auto& surfaceboundValues = surface.values(); + const auto& assignedboundValues = assignedSurface.values(); BOOST_CHECK_EQUAL_COLLECTIONS( surfaceboundValues.cbegin(), surfaceboundValues.cend(), assignedboundValues.cbegin(), assignedboundValues.cend());