diff --git a/Core/include/ACTS/Surfaces/ConeBounds.hpp b/Core/include/ACTS/Surfaces/ConeBounds.hpp index 5522d9b1764113f845efe192a048eda78af53243..179bb5874f8f19d457b96577650d570fd1ece7ba 100644 --- a/Core/include/ACTS/Surfaces/ConeBounds.hpp +++ b/Core/include/ACTS/Surfaces/ConeBounds.hpp @@ -22,7 +22,7 @@ namespace Acts { /// @class ConeBounds /// -/// Bounds for a conical Surface, +/// Bounds for a conical surface, /// the opening angle is stored in \f$ \tan(\alpha) \f$ and always positively /// defined. /// The cone can open to both sides, steered by \f$ z_min \f$ and \f$ z_max @@ -195,11 +195,9 @@ private: bool inside(const Vector2D& lpos, double tol0, double tol1) const; - std::vector<TDD_real_t> - m_valueStore; ///< internal storage for the bound values - TDD_real_t m_tanAlpha; ///< internal cache - TDD_real_t m_sinAlpha; ///< internal cache - TDD_real_t m_cosAlpha; ///< internal cache + TDD_real_t m_tanAlpha; ///< internal cache + TDD_real_t m_sinAlpha; ///< internal cache + TDD_real_t m_cosAlpha; ///< internal cache /// Helper function for angle parameter initialization virtual void @@ -209,14 +207,14 @@ private: inline double minPhi() const { - return m_valueStore.at(ConeBounds::bv_averagePhi) - - m_valueStore.at(ConeBounds::bv_halfPhiSector); + return m_valueStore[ConeBounds::bv_averagePhi] + - m_valueStore[ConeBounds::bv_halfPhiSector]; } inline double maxPhi() const { - return m_valueStore.at(ConeBounds::bv_averagePhi) - + m_valueStore.at(ConeBounds::bv_halfPhiSector); + return m_valueStore[ConeBounds::bv_averagePhi] + + m_valueStore[ConeBounds::bv_halfPhiSector]; } }; @@ -230,8 +228,8 @@ inline bool ConeBounds::inside(const Vector2D& lpos, double tol0, double tol1) const { double z = lpos[Acts::eLOC_Z]; - bool insideZ = z > (m_valueStore.at(ConeBounds::bv_minZ) - tol1) - && z < (m_valueStore.at(ConeBounds::bv_maxZ) + tol1); + bool insideZ = z > (m_valueStore[ConeBounds::bv_minZ] - tol1) + && z < (m_valueStore[ConeBounds::bv_maxZ] + tol1); if (!insideZ) return false; // TODO: Do we need some sort of "R" tolerance also here (take // it off the z tol1 in that case?) or does the rphi tol0 cover @@ -260,8 +258,8 @@ inline bool ConeBounds::insideLoc1(const Vector2D& lpos, double tol1) const { double z = lpos[Acts::eLOC_Z]; - return (z > (m_valueStore.at(ConeBounds::bv_minZ) - tol1) - && z < (m_valueStore.at(ConeBounds::bv_maxZ) + tol1)); + return (z > (m_valueStore[ConeBounds::bv_minZ] - tol1) + && z < (m_valueStore[ConeBounds::bv_maxZ] + tol1)); } inline double @@ -291,45 +289,45 @@ ConeBounds::cosAlpha() const inline double ConeBounds::alpha() const { - return m_valueStore.at(ConeBounds::bv_alpha); + return m_valueStore[ConeBounds::bv_alpha]; } inline double ConeBounds::minZ() const { - return m_valueStore.at(ConeBounds::bv_minZ); + return m_valueStore[ConeBounds::bv_minZ]; } inline double ConeBounds::maxZ() const { - return m_valueStore.at(ConeBounds::bv_maxZ); + return m_valueStore[ConeBounds::bv_maxZ]; } inline double ConeBounds::averagePhi() const { - return m_valueStore.at(ConeBounds::bv_averagePhi); + return m_valueStore[ConeBounds::bv_averagePhi]; } inline double ConeBounds::halfPhiSector() const { - return m_valueStore.at(ConeBounds::bv_halfPhiSector); + return m_valueStore[ConeBounds::bv_halfPhiSector]; } inline void ConeBounds::initCache() { - m_tanAlpha = tan(m_valueStore.at(ConeBounds::bv_alpha)); - m_sinAlpha = sin(m_valueStore.at(ConeBounds::bv_alpha)); - m_cosAlpha = cos(m_valueStore.at(ConeBounds::bv_alpha)); + m_tanAlpha = tan(m_valueStore[ConeBounds::bv_alpha]); + m_sinAlpha = sin(m_valueStore[ConeBounds::bv_alpha]); + m_cosAlpha = cos(m_valueStore[ConeBounds::bv_alpha]); // validate the halfphi - if (m_valueStore.at(ConeBounds::bv_halfPhiSector) < 0.) - m_valueStore.at(ConeBounds::bv_halfPhiSector) - = -m_valueStore.at(ConeBounds::bv_halfPhiSector); - if (m_valueStore.at(ConeBounds::bv_halfPhiSector) > M_PI) - m_valueStore.at(ConeBounds::bv_halfPhiSector) = M_PI; + if (m_valueStore[ConeBounds::bv_halfPhiSector] < 0.) + m_valueStore[ConeBounds::bv_halfPhiSector] + = -m_valueStore[ConeBounds::bv_halfPhiSector]; + if (m_valueStore[ConeBounds::bv_halfPhiSector] > M_PI) + m_valueStore[ConeBounds::bv_halfPhiSector] = M_PI; } } diff --git a/Core/include/ACTS/Surfaces/CylinderBounds.hpp b/Core/include/ACTS/Surfaces/CylinderBounds.hpp index 0c4027df0269506ed6fa384d6773dab185d0ecb1..db2f8e166e29e3d3af0293b05355c4212a6fbdca 100644 --- a/Core/include/ACTS/Surfaces/CylinderBounds.hpp +++ b/Core/include/ACTS/Surfaces/CylinderBounds.hpp @@ -209,19 +209,22 @@ CylinderBounds::inside(const Vector2D& lpos, const BoundaryCheck& bcheck) const { if (bcheck.bcType == 0 || bcheck.nSigmas == 0 || m_valueStore.at(CylinderBounds::bv_halfPhiSector) != M_PI) - return CylinderBounds::inside(lpos, bcheck.toleranceLoc0, bcheck.toleranceLoc1); + return CylinderBounds::inside( + lpos, bcheck.toleranceLoc0, bcheck.toleranceLoc1); - float theta = ((*bcheck.lCovariance)(1, 0) != 0 - && ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0)) != 0) + float theta + = ((*bcheck.lCovariance)(1, 0) != 0 + && ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0)) != 0) ? .5 - * bcheck.FastArcTan(2 * (*bcheck.lCovariance)(1, 0) - / ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0))) + * bcheck.FastArcTan( + 2 * (*bcheck.lCovariance)(1, 0) + / ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0))) : 0.; sincosCache scResult = bcheck.FastSinCos(theta); - double dphi = scResult.sinC * scResult.sinC * (*bcheck.lCovariance)(0, 0); - double dz = scResult.cosC * scResult.cosC * (*bcheck.lCovariance)(0, 1); - double max_ell = dphi > dz ? dphi : dz; - double limit = bcheck.nSigmas * sqrt(max_ell); + double dphi = scResult.sinC * scResult.sinC * (*bcheck.lCovariance)(0, 0); + double dz = scResult.cosC * scResult.cosC * (*bcheck.lCovariance)(0, 1); + double max_ell = dphi > dz ? dphi : dz; + double limit = bcheck.nSigmas * sqrt(max_ell); return insideLocZ(lpos[Acts::eLOC_Z], limit); } diff --git a/Core/include/ACTS/Surfaces/CylinderSurface.hpp b/Core/include/ACTS/Surfaces/CylinderSurface.hpp index bd5606553f33c49cf68d2468e6e7cbc9759ee94d..51bb1c6e554e3241af2746bd3242a1049b38ad06 100644 --- a/Core/include/ACTS/Surfaces/CylinderSurface.hpp +++ b/Core/include/ACTS/Surfaces/CylinderSurface.hpp @@ -202,7 +202,7 @@ public: /// recalculated /// into the new frame. /// Suppose, this is done, the intersection is straight forward: - /// @f$p_{1}=(p_{1x}, p_{1y}, p_{1z}), p_{2}=(p_{2x}, p_{2y}, p_{2z}) @f$ + /// @f$p_{1}=(p_{1x}, p_{1y}, p_{1z}), p_{2}=(p_{2x}, p_{2y}, p_{2z}) @f$ /// are the two points describing the 3D-line, /// then the line in the \f$x-y@f$ plane can be written as /// @f$y=kx+d\f$, where @f$k =\frac{p_{2y}-p_{1y}}{p_{2x}-p_{1x}}@f$such as diff --git a/Core/include/ACTS/Surfaces/DiamondBounds.hpp b/Core/include/ACTS/Surfaces/DiamondBounds.hpp index 8da20a290e1f94c88cfa85dea5918d16cd3a99e5..47cbc28acc0a0793f3a18f84acddd2b8576e60f1 100644 --- a/Core/include/ACTS/Surfaces/DiamondBounds.hpp +++ b/Core/include/ACTS/Surfaces/DiamondBounds.hpp @@ -23,7 +23,7 @@ namespace Acts { /// /// @class DiamondBounds -/// +/// /// Bounds for a double trapezoidal ("diamond"), planar Surface. /// class DiamondBounds : public PlanarBounds @@ -190,9 +190,9 @@ private: initCache(); // std::vector<TDD_real_t> m_valueStore; ///< internal parameter store - TDD_real_t m_alpha1; ///< internal parameter cache for alpha1 - TDD_real_t m_alpha2; ///< internal parameter cache for alpha2 - RectangleBounds m_boundingBox; ///< internal bounding box cache + TDD_real_t m_alpha1; ///< internal parameter cache for alpha1 + TDD_real_t m_alpha2; ///< internal parameter cache for alpha2 + RectangleBounds m_boundingBox; ///< internal bounding box cache }; inline DiamondBounds* @@ -235,7 +235,8 @@ inline bool DiamondBounds::inside(const Vector2D& lpos, const BoundaryCheck& bcheck) const { if (bcheck.bcType == 0) - return DiamondBounds::inside(lpos, bcheck.toleranceLoc0, bcheck.toleranceLoc1); + return DiamondBounds::inside( + lpos, bcheck.toleranceLoc0, bcheck.toleranceLoc1); // a fast FALSE double max_ell = (*bcheck.lCovariance)(0, 0) > (*bcheck.lCovariance)(1, 1) @@ -271,11 +272,13 @@ DiamondBounds::inside(const Vector2D& lpos, const BoundaryCheck& bcheck) const // compute KDOP and axes for surface polygon std::vector<KDOP> elementKDOP(5); std::vector<Vector2D> elementP(6); - float theta = ((*bcheck.lCovariance)(1, 0) != 0 - && ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0)) != 0) + float theta + = ((*bcheck.lCovariance)(1, 0) != 0 + && ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0)) != 0) ? .5 - * bcheck.FastArcTan(2 * (*bcheck.lCovariance)(1, 0) - / ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0))) + * bcheck.FastArcTan( + 2 * (*bcheck.lCovariance)(1, 0) + / ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0))) : 0.; sincosCache scResult = bcheck.FastSinCos(theta); ActsMatrixD<2, 2> rotMatrix; diff --git a/Core/include/ACTS/Surfaces/DiscSurface.hpp b/Core/include/ACTS/Surfaces/DiscSurface.hpp index fb06cd4c6022242310eebb87da4694164d054b71..413a56ffa6073322e251204ae5f50d48e0b85a65 100644 --- a/Core/include/ACTS/Surfaces/DiscSurface.hpp +++ b/Core/include/ACTS/Surfaces/DiscSurface.hpp @@ -61,7 +61,7 @@ public: /// This is n this case you have DiscTrapezoidalBounds /// /// @param htrans is transform that places the disc in the global 3D space - /// (can be nullptr) + /// (can be nullptr) /// @param minhalfx is the half length in x at minimal r /// @param maxhalfx is the half length in x at maximal r /// @param rmin is the inner radius of the disc surface @@ -313,7 +313,7 @@ DiscSurface::normal(const Vector2D&) const { // fast access via tranform matrix (and not rotation()) auto tMatrix = transform().matrix(); - return Vector3D(tMatrix(0,2),tMatrix(1,2),tMatrix(2,2)); + return Vector3D(tMatrix(0, 2), tMatrix(1, 2), tMatrix(2, 2)); } inline const Vector3D DiscSurface::binningPosition(BinningValue) const @@ -332,8 +332,8 @@ inline const Vector2D DiscSurface::localCartesianToPolar(const Vector2D& lcart) const { return Vector2D(sqrt(lcart[Acts::eLOC_X] * lcart[Acts::eLOC_X] - + lcart[Acts::eLOC_Y] * lcart[Acts::eLOC_Y]), - atan2(lcart[Acts::eLOC_Y], lcart[Acts::eLOC_X])); + + lcart[Acts::eLOC_Y] * lcart[Acts::eLOC_Y]), + atan2(lcart[Acts::eLOC_Y], lcart[Acts::eLOC_X])); } inline double @@ -356,7 +356,8 @@ DiscSurface::intersectionEstimate(const Vector3D& gpos, // evaluate the intersection in terms of direction bool isValid = forceDir ? (u > 0.) : true; // evaluate (if necessary in terms of boundaries) - isValid = bcheck ? (isValid && isOnSurface(intersectPoint, bcheck)) : isValid; + isValid + = bcheck ? (isValid && isOnSurface(intersectPoint, bcheck)) : isValid; // return the result return Intersection(intersectPoint, u, isValid); } diff --git a/Core/include/ACTS/Surfaces/DiscTrapezoidalBounds.hpp b/Core/include/ACTS/Surfaces/DiscTrapezoidalBounds.hpp index 94433c0eeb8557ecc3ab627402868b217309b509..5a2b9a5e604a075a13c3d6772eb9b3d7bbf7fedb 100644 --- a/Core/include/ACTS/Surfaces/DiscTrapezoidalBounds.hpp +++ b/Core/include/ACTS/Surfaces/DiscTrapezoidalBounds.hpp @@ -404,7 +404,7 @@ DiscTrapezoidalBounds::inside(const Vector2D& lpos, && (lCovarianceCar(1, 1) - lCovarianceCar(0, 0)) != 0) ? .5 * bcheck.FastArcTan(2 * lCovarianceCar(1, 0) - / (lCovarianceCar(1, 1) - lCovarianceCar(0, 0))) + / (lCovarianceCar(1, 1) - lCovarianceCar(0, 0))) : 0.; scResult = bcheck.FastSinCos(theta); ActsMatrixD<2, 2> rotMatrix; diff --git a/Core/include/ACTS/Surfaces/EllipseBounds.hpp b/Core/include/ACTS/Surfaces/EllipseBounds.hpp index efdca6c9944225a74dbe64a8e07e2b4b6a959fd7..3de77084bc02dbed7c48c0a2bfce633fe03e2ec6 100644 --- a/Core/include/ACTS/Surfaces/EllipseBounds.hpp +++ b/Core/include/ACTS/Surfaces/EllipseBounds.hpp @@ -27,9 +27,9 @@ namespace Acts { /// i.e. the surface between two ellipses. /// By providing an argument for hphisec, the bounds can /// be restricted to a phirange around the center position. -/// +/// /// @image html EllipseBounds.png -/// +/// class EllipseBounds : public PlanarBounds { public: @@ -226,7 +226,8 @@ EllipseBounds::inside(const Vector2D& lpos, double tol0, double tol1) const inline bool EllipseBounds::inside(const Vector2D& lpos, const BoundaryCheck& bcheck) const { - return EllipseBounds::inside(lpos, bcheck.toleranceLoc0, bcheck.toleranceLoc1); + return EllipseBounds::inside( + lpos, bcheck.toleranceLoc0, bcheck.toleranceLoc1); } inline bool diff --git a/Core/include/ACTS/Surfaces/LineBounds.hpp b/Core/include/ACTS/Surfaces/LineBounds.hpp index 978cedceca72fc18830a564303f0bd5498ae843b..6e06c1feb0ac2cc540bc7f140eaf98c2df477a1f 100644 --- a/Core/include/ACTS/Surfaces/LineBounds.hpp +++ b/Core/include/ACTS/Surfaces/LineBounds.hpp @@ -160,17 +160,19 @@ LineBounds::inside(const Vector2D& lpos, const BoundaryCheck& bcheck) const if (bcheck.bcType == 0 || bcheck.nSigmas == 0) return LineBounds::inside(lpos, bcheck.toleranceLoc0, bcheck.toleranceLoc1); // ellipsoid check - float theta = ((*bcheck.lCovariance)(1, 0) != 0 - && ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0)) != 0) + float theta + = ((*bcheck.lCovariance)(1, 0) != 0 + && ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0)) != 0) ? .5 - * bcheck.FastArcTan(2 * (*bcheck.lCovariance)(1, 0) - / ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0))) + * bcheck.FastArcTan( + 2 * (*bcheck.lCovariance)(1, 0) + / ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0))) : 0.; sincosCache scResult = bcheck.FastSinCos(theta); - double dphi = scResult.sinC * scResult.sinC * (*bcheck.lCovariance)(0, 0); - double dz = scResult.cosC * scResult.cosC * (*bcheck.lCovariance)(0, 1); - double max_ell = dphi > dz ? dphi : dz; - double limit = bcheck.nSigmas * sqrt(max_ell); + double dphi = scResult.sinC * scResult.sinC * (*bcheck.lCovariance)(0, 0); + double dz = scResult.cosC * scResult.cosC * (*bcheck.lCovariance)(0, 1); + double max_ell = dphi > dz ? dphi : dz; + double limit = bcheck.nSigmas * sqrt(max_ell); return insideLocZ(lpos[Acts::eLOC_Z], limit); } diff --git a/Core/include/ACTS/Surfaces/LineSurface.hpp b/Core/include/ACTS/Surfaces/LineSurface.hpp index 754535c4ba706e49a8bc006b2647d1e12e0f5f41..c42a48cf3bf878a76bb247bf315c615daf237c28 100644 --- a/Core/include/ACTS/Surfaces/LineSurface.hpp +++ b/Core/include/ACTS/Surfaces/LineSurface.hpp @@ -291,7 +291,7 @@ LineSurface::lineDirection() const { // fast access via tranform matrix (and not rotation()) auto tMatrix = transform().matrix(); - return Vector3D(tMatrix(0,2),tMatrix(1,2),tMatrix(2,2)); + return Vector3D(tMatrix(0, 2), tMatrix(1, 2), tMatrix(2, 2)); } } // end of namespace diff --git a/Core/include/ACTS/Surfaces/PlaneSurface.hpp b/Core/include/ACTS/Surfaces/PlaneSurface.hpp index 80ce32fb7eff3df4bb139fc4edfb9b52f183d5d4..ba5e986ac98f7deed441ee1c0138f892a1f14236 100644 --- a/Core/include/ACTS/Surfaces/PlaneSurface.hpp +++ b/Core/include/ACTS/Surfaces/PlaneSurface.hpp @@ -235,7 +235,7 @@ PlaneSurface::normal(const Vector2D&) const { // fast access via tranform matrix (and not rotation()) auto tMatrix = transform().matrix(); - return Vector3D(tMatrix(0,2),tMatrix(1,2),tMatrix(2,2)); + return Vector3D(tMatrix(0, 2), tMatrix(1, 2), tMatrix(2, 2)); } inline const Vector3D PlaneSurface::binningPosition(BinningValue) const @@ -263,7 +263,8 @@ PlaneSurface::intersectionEstimate(const Vector3D& gpos, // evaluate the intersection in terms of direction bool isValid = forceDir ? (u > 0.) : true; // evaluate (if necessary in terms of boundaries) - isValid = bcheck ? (isValid && isOnSurface(intersectPoint, bcheck)) : isValid; + isValid + = bcheck ? (isValid && isOnSurface(intersectPoint, bcheck)) : isValid; // return the result return Intersection(intersectPoint, u, isValid); } diff --git a/Core/include/ACTS/Surfaces/RadialBounds.hpp b/Core/include/ACTS/Surfaces/RadialBounds.hpp index d7104b36fb8ea4a507e1f8bc0838f8298ea263f9..3c319bcdafc4a116e89774decd0b8bcbc36e3dd4 100644 --- a/Core/include/ACTS/Surfaces/RadialBounds.hpp +++ b/Core/include/ACTS/Surfaces/RadialBounds.hpp @@ -185,7 +185,8 @@ RadialBounds::inside(const Vector2D& lpos, const BoundaryCheck& bcheck) const if (bcheck.bcType == 0 || bcheck.nSigmas == 0 || m_valueStore[RadialBounds::bv_rMin] != 0 || m_valueStore[RadialBounds::bv_halfPhiSector] != M_PI) - return RadialBounds::inside(lpos, bcheck.toleranceLoc0, bcheck.toleranceLoc1); + return RadialBounds::inside( + lpos, bcheck.toleranceLoc0, bcheck.toleranceLoc1); // a fast FALSE sincosCache scResult = bcheck.FastSinCos(lpos(1, 0)); @@ -359,7 +360,7 @@ RadialBounds::inside(const Vector2D& lpos, const BoundaryCheck& bcheck) const && (lCovarianceCar(1, 1) - lCovarianceCar(0, 0)) != 0) ? .5 * bcheck.FastArcTan(2 * lCovarianceCar(1, 0) - / (lCovarianceCar(1, 1) - lCovarianceCar(0, 0))) + / (lCovarianceCar(1, 1) - lCovarianceCar(0, 0))) : 0.; scResult = bcheck.FastSinCos(theta); ActsMatrixD<2, 2> rotMatrix; diff --git a/Core/include/ACTS/Surfaces/RectangleBounds.hpp b/Core/include/ACTS/Surfaces/RectangleBounds.hpp index 35c52435c1f49f024900c09b6485cbd1ad6f8a07..cea065021c5035d46d658b033f526bec29a58d7d 100644 --- a/Core/include/ACTS/Surfaces/RectangleBounds.hpp +++ b/Core/include/ACTS/Surfaces/RectangleBounds.hpp @@ -171,11 +171,13 @@ RectangleBounds::inside(const Vector2D& lpos, const BoundaryCheck& bcheck) const // compute KDOP and axes for surface polygon std::vector<KDOP> elementKDOP(4); std::vector<Vector2D> elementP(4); - float theta = ((*bcheck.lCovariance)(1, 0) != 0 - && ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0)) != 0) + float theta + = ((*bcheck.lCovariance)(1, 0) != 0 + && ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0)) != 0) ? .5 - * bcheck.FastArcTan(2 * (*bcheck.lCovariance)(1, 0) - / ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0))) + * bcheck.FastArcTan( + 2 * (*bcheck.lCovariance)(1, 0) + / ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0))) : 0.; sincosCache scResult = bcheck.FastSinCos(theta); ActsMatrixD<2, 2> rotMatrix; diff --git a/Core/include/ACTS/Surfaces/StrawSurface.hpp b/Core/include/ACTS/Surfaces/StrawSurface.hpp index 783b8286e7199a960008806a6763bba92a43b7dc..d78209d4b415a3dbae6c1f05d77d10f1bfa61557 100644 --- a/Core/include/ACTS/Surfaces/StrawSurface.hpp +++ b/Core/include/ACTS/Surfaces/StrawSurface.hpp @@ -26,7 +26,7 @@ class DetectorElementBase; /// /// Class for a StrawSurface in the TrackingGeometry /// to describe dirft tube and straw like detectors. -/// +/// /// @image html LineSurface.png /// class StrawSurface : public LineSurface @@ -75,7 +75,8 @@ public: /// @param htrans is the additional transform applied after copying StrawSurface(const StrawSurface& slsf, const Transform3D& htrans) : LineSurface(slsf, htrans) - {} + { + } /// Destructor virtual ~StrawSurface(); diff --git a/Core/include/ACTS/Surfaces/Surface.hpp b/Core/include/ACTS/Surfaces/Surface.hpp index 8c47483244ebde2ab8d794be82e65e3956a12243..35fac4ac637530d3a7bf3cbc133036e85d1a97e4 100644 --- a/Core/include/ACTS/Surfaces/Surface.hpp +++ b/Core/include/ACTS/Surfaces/Surface.hpp @@ -307,7 +307,7 @@ public: Intersection intersectionEstimate(const T& pars, bool forceDir = false, - const BoundaryCheck& bcheck = false) const + const BoundaryCheck& bcheck = false) const { return intersectionEstimate( pars.position(), pars.momentum().unit(), forceDir, bcheck); diff --git a/Core/include/ACTS/Surfaces/TrapezoidBounds.hpp b/Core/include/ACTS/Surfaces/TrapezoidBounds.hpp index 12add03428c95fa9a8782c1a42eb14d3f7081833..7b8ac5dbf6ea330ddb58555406c8b8d576a9cdf0 100644 --- a/Core/include/ACTS/Surfaces/TrapezoidBounds.hpp +++ b/Core/include/ACTS/Surfaces/TrapezoidBounds.hpp @@ -322,11 +322,13 @@ TrapezoidBounds::inside(const Vector2D& lpos, const BoundaryCheck& bcheck) const // compute KDOP and axes for surface polygon std::vector<KDOP> elementKDOP(3); std::vector<Vector2D> elementP(4); - float theta = ((*bcheck.lCovariance)(1, 0) != 0 - && ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0)) != 0) + float theta + = ((*bcheck.lCovariance)(1, 0) != 0 + && ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0)) != 0) ? .5 - * bcheck.FastArcTan(2 * (*bcheck.lCovariance)(1, 0) - / ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0))) + * bcheck.FastArcTan( + 2 * (*bcheck.lCovariance)(1, 0) + / ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0))) : 0.; sincosCache scResult = bcheck.FastSinCos(theta); ActsMatrixD<2, 2> rotMatrix; diff --git a/Core/include/ACTS/Surfaces/TriangleBounds.hpp b/Core/include/ACTS/Surfaces/TriangleBounds.hpp index fc22e252b1ee92f13386984e0d267c8f9ac04ff8..c0492ed3362ea3bd45c0761fca829cc318732afe 100644 --- a/Core/include/ACTS/Surfaces/TriangleBounds.hpp +++ b/Core/include/ACTS/Surfaces/TriangleBounds.hpp @@ -197,7 +197,8 @@ inline bool TriangleBounds::inside(const Vector2D& lpos, const BoundaryCheck& bcheck) const { if (bcheck.bcType == 0) - return TriangleBounds::inside(lpos, bcheck.toleranceLoc0, bcheck.toleranceLoc1); + return TriangleBounds::inside( + lpos, bcheck.toleranceLoc0, bcheck.toleranceLoc1); /// @todo check for quick limit test /// double max_ell = (*bcheck.lCovariance)(0, 0) > (*bcheck.lCovariance)(1, 1) @@ -212,11 +213,13 @@ TriangleBounds::inside(const Vector2D& lpos, const BoundaryCheck& bcheck) const // compute KDOP and axes for surface polygon std::vector<KDOP> elementKDOP(3); std::vector<Vector2D> elementP(3); - double theta = ((*bcheck.lCovariance)(1, 0) != 0 - && ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0)) != 0) + double theta + = ((*bcheck.lCovariance)(1, 0) != 0 + && ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0)) != 0) ? .5 - * bcheck.FastArcTan(2 * (*bcheck.lCovariance)(1, 0) - / ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0))) + * bcheck.FastArcTan( + 2 * (*bcheck.lCovariance)(1, 0) + / ((*bcheck.lCovariance)(1, 1) - (*bcheck.lCovariance)(0, 0))) : 0.; sincosCache scResult = bcheck.FastSinCos(theta); ActsMatrixD<2, 2> rotMatrix; diff --git a/Core/src/Surfaces/BoundaryCheck.cpp b/Core/src/Surfaces/BoundaryCheck.cpp index 4a50fc62ed41e357950f2aa4ecc945ef12529e9d..ebdebf681e4852df156261dfaca1b24a67b0e0f6 100644 --- a/Core/src/Surfaces/BoundaryCheck.cpp +++ b/Core/src/Surfaces/BoundaryCheck.cpp @@ -24,7 +24,8 @@ Acts::BoundaryCheck::BoundaryCheck(bool sCheck) , nSigmas(-1) , lCovariance(nullptr) , bcType(absolute) -{} +{ +} Acts::BoundaryCheck::BoundaryCheck(bool chkL0, bool chkL1, @@ -49,7 +50,7 @@ Acts::BoundaryCheck::BoundaryCheck(const ActsSymMatrixD<2>& lCov, , toleranceLoc0(0.) , toleranceLoc1(0.) , nSigmas(nsig) - , lCovariance(std::make_unique< ActsSymMatrixD<2> >(lCov)) + , lCovariance(std::make_unique<ActsSymMatrixD<2>>(lCov)) , bcType(chi2corr) { } @@ -63,21 +64,22 @@ Acts::BoundaryCheck::BoundaryCheck(const BoundaryCheck& bCheck) , lCovariance(nullptr) , bcType(bCheck.bcType) { - lCovariance = bCheck.lCovariance ? - std::make_unique< ActsSymMatrixD<2> >(*bCheck.lCovariance) : nullptr; + lCovariance = bCheck.lCovariance + ? std::make_unique<ActsSymMatrixD<2>>(*bCheck.lCovariance) + : nullptr; } -Acts::BoundaryCheck& Acts::BoundaryCheck::operator=(const BoundaryCheck& bCheck) +Acts::BoundaryCheck& +Acts::BoundaryCheck::operator=(const BoundaryCheck& bCheck) { - if (this != &bCheck){ - checkLoc0 = bCheck.checkLoc0; - checkLoc1 = bCheck.checkLoc1; - toleranceLoc0 = bCheck.toleranceLoc0; - toleranceLoc1 = bCheck.toleranceLoc1; - nSigmas = bCheck.nSigmas; - lCovariance = nullptr; - bcType = bCheck.bcType; + if (this != &bCheck) { + checkLoc0 = bCheck.checkLoc0; + checkLoc1 = bCheck.checkLoc1; + toleranceLoc0 = bCheck.toleranceLoc0; + toleranceLoc1 = bCheck.toleranceLoc1; + nSigmas = bCheck.nSigmas; + lCovariance = nullptr; + bcType = bCheck.bcType; } return (*this); -} - +} diff --git a/Core/src/Surfaces/ConeBounds.cpp b/Core/src/Surfaces/ConeBounds.cpp index f902446fa9eefdd89776199ce41091e8020e042c..575b953744f23f5541d5f683d60d7252f73e7453 100644 --- a/Core/src/Surfaces/ConeBounds.cpp +++ b/Core/src/Surfaces/ConeBounds.cpp @@ -24,11 +24,11 @@ Acts::ConeBounds::ConeBounds(double alpha, , m_sinAlpha(0.) , m_cosAlpha(0.) { - m_valueStore.at(ConeBounds::bv_alpha) = alpha; - m_valueStore.at(ConeBounds::bv_minZ) = symm ? -TDD_max_bound_value : 0.; - m_valueStore.at(ConeBounds::bv_maxZ) = TDD_max_bound_value; - m_valueStore.at(ConeBounds::bv_averagePhi) = avphi; - m_valueStore.at(ConeBounds::bv_halfPhiSector) = halfphi; + m_valueStore[ConeBounds::bv_alpha] = alpha; + m_valueStore[ConeBounds::bv_minZ] = symm ? -TDD_max_bound_value : 0.; + m_valueStore[ConeBounds::bv_maxZ] = TDD_max_bound_value; + m_valueStore[ConeBounds::bv_averagePhi] = avphi; + m_valueStore[ConeBounds::bv_halfPhiSector] = halfphi; initCache(); } @@ -42,11 +42,11 @@ Acts::ConeBounds::ConeBounds(double alpha, , m_sinAlpha(0.) , m_cosAlpha(0.) { - m_valueStore.at(ConeBounds::bv_alpha) = alpha; - m_valueStore.at(ConeBounds::bv_minZ) = zmin; - m_valueStore.at(ConeBounds::bv_maxZ) = zmax; - m_valueStore.at(ConeBounds::bv_averagePhi) = avphi; - m_valueStore.at(ConeBounds::bv_halfPhiSector) = halfphi; + m_valueStore[ConeBounds::bv_alpha] = alpha; + m_valueStore[ConeBounds::bv_minZ] = zmin; + m_valueStore[ConeBounds::bv_maxZ] = zmax; + m_valueStore[ConeBounds::bv_averagePhi] = avphi; + m_valueStore[ConeBounds::bv_halfPhiSector] = halfphi; initCache(); } @@ -82,20 +82,20 @@ Acts::ConeBounds::distanceToBoundary(const Acts::Vector2D& pos) const // then it won't work // find the minimum distance along the z direction - double toMinZ = m_valueStore.at(ConeBounds::bv_minZ) - pos[Acts::eLOC_Z]; - double toMaxZ = pos[Acts::eLOC_Z] - m_valueStore.at(ConeBounds::bv_maxZ); + double toMinZ = m_valueStore[ConeBounds::bv_minZ] - pos[Acts::eLOC_Z]; + double toMaxZ = pos[Acts::eLOC_Z] - m_valueStore[ConeBounds::bv_maxZ]; double toZ = (std::abs(toMinZ) < std::abs(toMaxZ)) ? toMinZ : toMaxZ; // NB this works only if the localPos is in the same hemisphere as // the cone (i.e. if the localPos has z < 0 and the cone only // defined for z > z_min where z_min > 0, this is wrong) - double zDist = sqrt(toZ * toZ * (1. + m_tanAlpha * m_tanAlpha)); + double zDist = std::sqrt(toZ * toZ * (1. + m_tanAlpha * m_tanAlpha)); if (toZ < 0.) // positive if outside the cone only zDist = -zDist; // if the cone is complete, or pos is in the same phi range as the // cone piece then its just the distance along the cone. - if (m_valueStore.at(ConeBounds::bv_halfPhiSector) >= M_PI) return zDist; + if (m_valueStore[ConeBounds::bv_halfPhiSector] >= M_PI) return zDist; // we have a conical segment, so find also the phi distance // Note that here we take the phi distance as the distance from @@ -104,13 +104,13 @@ Acts::ConeBounds::distanceToBoundary(const Acts::Vector2D& pos) const // cone) double posR = pos[Acts::eLOC_Z] * m_tanAlpha; double deltaPhi = pos[Acts::eLOC_RPHI] / posR - - m_valueStore.at(ConeBounds::bv_averagePhi); // from center + - m_valueStore[ConeBounds::bv_averagePhi]; // from center if (deltaPhi > M_PI) deltaPhi = 2 * M_PI - deltaPhi; if (deltaPhi < -M_PI) deltaPhi = 2 * M_PI + deltaPhi; // straight line distance (goes off cone) double phiDist = 2 * posR - * sin(.5 * (deltaPhi - m_valueStore.at(ConeBounds::bv_halfPhiSector))); + * sin(.5 * (deltaPhi - m_valueStore[ConeBounds::bv_halfPhiSector])); // if inside the cone, return the smaller length (since both are // negative, the *larger* of the 2 is the *smaller* distance) @@ -127,7 +127,7 @@ Acts::ConeBounds::distanceToBoundary(const Acts::Vector2D& pos) const // otherwise, return both (this should be the distance to the corner // closest to the cone - return sqrt(zDist * zDist + phiDist * phiDist); + return std::sqrt(zDist * zDist + phiDist * phiDist); } std::ostream& diff --git a/Core/src/Surfaces/ConeSurface.cpp b/Core/src/Surfaces/ConeSurface.cpp index 0e9c21416f9130e27dc4fa6407415a79505fac75..2c75af18437dc78dd9655c3d275ff23694e2eb28 100644 --- a/Core/src/Surfaces/ConeSurface.cpp +++ b/Core/src/Surfaces/ConeSurface.cpp @@ -123,11 +123,9 @@ Acts::ConeSurface::globalToLocal(const Vector3D& gpos, const Vector3D&, Vector2D& lpos) const { - Vector3D loc3Dframe - = m_transform ? (transform().inverse() * gpos) : gpos; - double r = loc3Dframe.z() * bounds().tanAlpha(); - lpos = Vector2D(r * atan2(loc3Dframe.y(), loc3Dframe.x()), - loc3Dframe.z()); + Vector3D loc3Dframe = m_transform ? (transform().inverse() * gpos) : gpos; + double r = loc3Dframe.z() * bounds().tanAlpha(); + lpos = Vector2D(r * atan2(loc3Dframe.y(), loc3Dframe.x()), loc3Dframe.z()); // now decide on the quility of the transformation double inttol = r * 0.0001; inttol = (inttol < 0.01) ? 0.01 : 0.01; // ? diff --git a/Core/src/Surfaces/CylinderSurface.cpp b/Core/src/Surfaces/CylinderSurface.cpp index e5f71c4e564916bcedf8adec7025d89d6423a5c9..f3a36facb319ea521690563e53fb71e2d757b8f1 100644 --- a/Core/src/Surfaces/CylinderSurface.cpp +++ b/Core/src/Surfaces/CylinderSurface.cpp @@ -214,8 +214,8 @@ Acts::CylinderSurface::intersectionEstimate(const Acts::Vector3D& gpos, Vector3D sol1raw(point1 + t1 * direction); Vector3D sol2raw(point1 + t2 * direction); // now reorder and return - Vector3D solution(0, 0, 0); - double path = 0.; + Vector3D solution(0, 0, 0); + double path = 0.; // first check the validity of the direction bool isValid = true; diff --git a/Core/src/Surfaces/DiamondBounds.cpp b/Core/src/Surfaces/DiamondBounds.cpp index decdc20bd4a68b25b2fea6c20e610a20bff3b5ea..dbba0f21ba994a3cb7b8d6940f226231f33bf381 100644 --- a/Core/src/Surfaces/DiamondBounds.cpp +++ b/Core/src/Surfaces/DiamondBounds.cpp @@ -58,9 +58,9 @@ Acts::DiamondBounds::operator=(const DiamondBounds& diabo) { if (this != &diabo) { PlanarBounds::m_valueStore = diabo.m_valueStore; - m_alpha1 = diabo.m_alpha1; - m_alpha2 = diabo.m_alpha2; - m_boundingBox = diabo.m_boundingBox; + m_alpha1 = diabo.m_alpha1; + m_alpha2 = diabo.m_alpha2; + m_boundingBox = diabo.m_boundingBox; } return *this; } diff --git a/Core/src/Surfaces/DiscSurface.cpp b/Core/src/Surfaces/DiscSurface.cpp index 62db8ff69c5492aaef1dbf1c6e351cfe50659727..4029d622a7458241a7e042f0880ad26fa84850c7 100644 --- a/Core/src/Surfaces/DiscSurface.cpp +++ b/Core/src/Surfaces/DiscSurface.cpp @@ -151,8 +151,8 @@ Acts::DiscSurface::isOnSurface(const Vector3D& glopo, { Vector3D loc3Dframe = (transform().inverse()) * glopo; if (std::abs(loc3Dframe.z()) > (s_onSurfaceTolerance)) return false; - return ( - bcheck - ? bounds().inside(Vector2D(loc3Dframe.perp(), loc3Dframe.phi()), bcheck) - : true); + return (bcheck + ? bounds().inside(Vector2D(loc3Dframe.perp(), loc3Dframe.phi()), + bcheck) + : true); } diff --git a/Core/src/Surfaces/LineSurface.cpp b/Core/src/Surfaces/LineSurface.cpp index b44b8b6a16b301894a686057a7c037e5d46d69a1..1ab2c6a2946012011f2f9b90334b8fab204f38b4 100644 --- a/Core/src/Surfaces/LineSurface.cpp +++ b/Core/src/Surfaces/LineSurface.cpp @@ -148,7 +148,7 @@ Acts::LineSurface::intersectionEstimate(const Vector3D& gpos, bool isValid = forceDir ? (lambda0 > 0.) : true; // evaluate validaty in terms of bounds Vector3D result = (ma + lambda0 * ea); - isValid = bcheck ? (isValid && isOnSurface(result, bcheck)) : isValid; + isValid = bcheck ? (isValid && isOnSurface(result, bcheck)) : isValid; // return the result return Intersection(result, lambda0, isValid); } diff --git a/Core/src/Surfaces/PlaneSurface.cpp b/Core/src/Surfaces/PlaneSurface.cpp index c0429b1a423075ac3a0222d5cb6a4e62671e869a..e44162f65119d880ec7ae0602c2b43b87609c5f1 100644 --- a/Core/src/Surfaces/PlaneSurface.cpp +++ b/Core/src/Surfaces/PlaneSurface.cpp @@ -113,6 +113,7 @@ Acts::PlaneSurface::isOnSurface(const Vector3D& glopo, /// the chance that there is no transform is almost 0, let's apply it Vector3D loc3Dframe = (transform().inverse()) * glopo; if (std::abs(loc3Dframe.z()) > s_onSurfaceTolerance) return false; - return (bcheck ? bounds().inside(Vector2D(loc3Dframe.x(), loc3Dframe.y()), bcheck) - : true); + return ( + bcheck ? bounds().inside(Vector2D(loc3Dframe.x(), loc3Dframe.y()), bcheck) + : true); }