From bafedb1d1725a592e92becf452db5bf12434b661 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 18 Dec 2024 16:02:31 +0100 Subject: [PATCH] chore: Make use of algebra shorthands --- Core/include/Acts/Definitions/Algebra.hpp | 4 ++-- .../Acts/EventData/GenericBoundTrackParameters.hpp | 6 +++--- .../Acts/EventData/MultiTrajectoryBackendConcept.hpp | 6 +++--- .../Acts/EventData/TrackStateProxyConcept.hpp | 4 ++-- .../EventData/detail/MultiTrajectoryTestsCommon.hpp | 2 +- .../include/Acts/EventData/detail/TestSourceLink.hpp | 6 +++--- Core/include/Acts/MagneticField/ConstantBField.hpp | 2 +- .../Acts/MagneticField/InterpolatedBFieldMap.hpp | 2 +- .../Acts/MagneticField/MagneticFieldProvider.hpp | 2 +- Core/include/Acts/MagneticField/MultiRangeBField.hpp | 2 +- Core/include/Acts/MagneticField/NullBField.hpp | 2 +- Core/include/Acts/MagneticField/SolenoidBField.hpp | 2 +- .../Acts/Propagator/EigenStepperDefaultExtension.hpp | 8 ++++---- .../Acts/Propagator/EigenStepperDenseExtension.hpp | 8 ++++---- Core/include/Acts/Surfaces/CylinderBounds.hpp | 2 +- Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp | 2 +- Core/include/Acts/Utilities/VectorHelpers.hpp | 4 ++-- Core/src/MagneticField/MultiRangeBField.cpp | 2 +- Core/src/MagneticField/SolenoidBField.cpp | 2 +- Core/src/Surfaces/AnnulusBounds.cpp | 2 +- Core/src/Surfaces/CylinderBounds.cpp | 4 ++-- Core/src/Surfaces/DiscTrapezoidBounds.cpp | 4 ++-- Core/src/Utilities/SpacePointUtility.cpp | 10 ++++------ Core/src/Vertexing/AdaptiveGridTrackDensity.cpp | 2 +- Core/src/Vertexing/AdaptiveMultiVertexFitter.cpp | 4 ++-- .../ActsExamples/MagneticField/ScalableBField.hpp | 2 +- Examples/Io/Root/src/VertexNTupleWriter.cpp | 4 ++-- .../Acts/Plugins/DD4hep/DD4hepFieldAdapter.hpp | 2 +- Plugins/DD4hep/src/DD4hepFieldAdapter.cpp | 2 +- Tests/Benchmarks/AnnulusBoundsBenchmark.cpp | 2 +- Tests/UnitTests/Core/Geometry/VolumeTests.cpp | 2 +- .../MagneticField/InterpolatedBFieldMapTests.cpp | 2 +- .../Propagator/BoundToCurvilinearConversionTests.cpp | 6 +++--- Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp | 2 +- Tests/UnitTests/Core/Utilities/HelpersTests.cpp | 12 ++++++------ .../Core/Vertexing/ImpactPointEstimatorTests.cpp | 2 +- 36 files changed, 65 insertions(+), 67 deletions(-) diff --git a/Core/include/Acts/Definitions/Algebra.hpp b/Core/include/Acts/Definitions/Algebra.hpp index 5684ab44c73..d81f987f7ba 100644 --- a/Core/include/Acts/Definitions/Algebra.hpp +++ b/Core/include/Acts/Definitions/Algebra.hpp @@ -77,8 +77,8 @@ using Translation2 = Eigen::Translation; using Translation3 = Eigen::Translation; // linear (rotation) matrices -using RotationMatrix2 = ActsMatrix<2, 2>; -using RotationMatrix3 = ActsMatrix<3, 3>; +using RotationMatrix2 = SquareMatrix2; +using RotationMatrix3 = SquareMatrix3; // pure rotation defined by a rotation angle around a rotation axis using AngleAxis3 = Eigen::AngleAxis; diff --git a/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp b/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp index 22567d8adf5..bd2d2063831 100644 --- a/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp +++ b/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp @@ -123,10 +123,10 @@ class GenericBoundTrackParameters { /// Parameters vector. const ParametersVector& parameters() const { return m_params; } /// Vector of spatial impact parameters (i.e., d0 and z0) - ActsVector<2> spatialImpactParameters() const { return m_params.head<2>(); } + Vector2 spatialImpactParameters() const { return m_params.head<2>(); } /// Vector of spatial and temporal impact parameters (i.e., d0, z0, and t) - ActsVector<3> impactParameters() const { - ActsVector<3> ip; + Vector3 impactParameters() const { + Vector3 ip; ip.template head<2>() = m_params.template head<2>(); ip(2) = m_params(eBoundTime); return ip; diff --git a/Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp b/Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp index e7c6a6d3fdf..876a799cb9d 100644 --- a/Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp +++ b/Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp @@ -56,7 +56,7 @@ concept CommonMultiTrajectoryBackend = { cv.template calibrated_impl<2>(istate) - } -> std::same_as>>; + } -> std::same_as>; { cv.template calibratedCovariance_impl<2>(istate) @@ -86,7 +86,7 @@ concept ConstMultiTrajectoryBackend = { v.template calibrated_impl<2>(istate) - } -> std::same_as>>; + } -> std::same_as>; { v.template calibratedCovariance_impl<2>(istate) @@ -107,7 +107,7 @@ concept MutableMultiTrajectoryBackend = { v.template calibrated_impl<2>(istate) - } -> std::same_as>>; + } -> std::same_as>; { v.template calibratedCovariance_impl<2>(istate) diff --git a/Core/include/Acts/EventData/TrackStateProxyConcept.hpp b/Core/include/Acts/EventData/TrackStateProxyConcept.hpp index 4b8a713f864..047a04c3c2d 100644 --- a/Core/include/Acts/EventData/TrackStateProxyConcept.hpp +++ b/Core/include/Acts/EventData/TrackStateProxyConcept.hpp @@ -28,10 +28,10 @@ using Covariance = Eigen::Map; using ConstParameters = Eigen::Map; using ConstCovariance = Eigen::Map; -using Measurement = Eigen::Map>; +using Measurement = Eigen::Map; using MeasurementCovariance = Eigen::Map>; -using ConstMeasurement = Eigen::Map>; +using ConstMeasurement = Eigen::Map; using ConstMeasurementCovariance = Eigen::Map>; using DynamicMeasurement = diff --git a/Core/include/Acts/EventData/detail/MultiTrajectoryTestsCommon.hpp b/Core/include/Acts/EventData/detail/MultiTrajectoryTestsCommon.hpp index 598eef039c8..1668642e867 100644 --- a/Core/include/Acts/EventData/detail/MultiTrajectoryTestsCommon.hpp +++ b/Core/include/Acts/EventData/detail/MultiTrajectoryTestsCommon.hpp @@ -1235,7 +1235,7 @@ class MultiTrajectoryTestsCommon { auto [par2, cov2] = generateBoundParametersCovariance(rng, {}); ts.allocateCalibrated(3); - BOOST_CHECK_EQUAL(ts.template calibrated<3>(), ActsVector<3>::Zero()); + BOOST_CHECK_EQUAL(ts.template calibrated<3>(), Vector3::Zero()); BOOST_CHECK_EQUAL(ts.template calibratedCovariance<3>(), ActsSquareMatrix<3>::Zero()); diff --git a/Core/include/Acts/EventData/detail/TestSourceLink.hpp b/Core/include/Acts/EventData/detail/TestSourceLink.hpp index 9a6350e7df4..72f6bbba126 100644 --- a/Core/include/Acts/EventData/detail/TestSourceLink.hpp +++ b/Core/include/Acts/EventData/detail/TestSourceLink.hpp @@ -41,7 +41,7 @@ struct TestSourceLink final { std::size_t sourceId = 0u; // use eBoundSize to indicate unused indices std::array indices = {eBoundSize, eBoundSize}; - Acts::ActsVector<2> parameters; + Acts::Vector2 parameters; Acts::ActsSquareMatrix<2> covariance; /// Construct a source link for a 1d measurement. @@ -52,10 +52,10 @@ struct TestSourceLink final { sourceId(sid), indices{idx, eBoundSize}, parameters(val, 0), - covariance(Acts::ActsVector<2>(var, 0).asDiagonal()) {} + covariance(Acts::Vector2(var, 0).asDiagonal()) {} /// Construct a source link for a 2d measurement. TestSourceLink(BoundIndices idx0, BoundIndices idx1, - const Acts::ActsVector<2>& params, + const Acts::Vector2& params, const Acts::ActsSquareMatrix<2>& cov, GeometryIdentifier gid = GeometryIdentifier(), std::size_t sid = 0u) diff --git a/Core/include/Acts/MagneticField/ConstantBField.hpp b/Core/include/Acts/MagneticField/ConstantBField.hpp index 7586cbcbace..c83afecd752 100644 --- a/Core/include/Acts/MagneticField/ConstantBField.hpp +++ b/Core/include/Acts/MagneticField/ConstantBField.hpp @@ -51,7 +51,7 @@ class ConstantBField final : public MagneticFieldProvider { /// @note currently the derivative is not calculated /// @todo return derivative Result getFieldGradient( - const Vector3& position, ActsMatrix<3, 3>& derivative, + const Vector3& position, SquareMatrix3& derivative, MagneticFieldProvider::Cache& cache) const override { (void)position; (void)derivative; diff --git a/Core/include/Acts/MagneticField/InterpolatedBFieldMap.hpp b/Core/include/Acts/MagneticField/InterpolatedBFieldMap.hpp index 92cdc0090c7..cc41690334d 100644 --- a/Core/include/Acts/MagneticField/InterpolatedBFieldMap.hpp +++ b/Core/include/Acts/MagneticField/InterpolatedBFieldMap.hpp @@ -314,7 +314,7 @@ class InterpolatedBFieldMap : public InterpolatedMagneticField { /// @note Cache is not used currently /// @todo return derivative Result getFieldGradient( - const Vector3& position, ActsMatrix<3, 3>& derivative, + const Vector3& position, SquareMatrix3& derivative, MagneticFieldProvider::Cache& cache) const final { (void)derivative; return getField(position, cache); diff --git a/Core/include/Acts/MagneticField/MagneticFieldProvider.hpp b/Core/include/Acts/MagneticField/MagneticFieldProvider.hpp index 44596b73d6e..be162775d5b 100644 --- a/Core/include/Acts/MagneticField/MagneticFieldProvider.hpp +++ b/Core/include/Acts/MagneticField/MagneticFieldProvider.hpp @@ -50,7 +50,7 @@ class MagneticFieldProvider { /// @param [in,out] cache Field provider specific cache object /// @return magnetic field vector virtual Result getFieldGradient(const Vector3& position, - ActsMatrix<3, 3>& derivative, + SquareMatrix3& derivative, Cache& cache) const = 0; virtual ~MagneticFieldProvider(); diff --git a/Core/include/Acts/MagneticField/MultiRangeBField.hpp b/Core/include/Acts/MagneticField/MultiRangeBField.hpp index 60b90097161..7f7e0186d2b 100644 --- a/Core/include/Acts/MagneticField/MultiRangeBField.hpp +++ b/Core/include/Acts/MagneticField/MultiRangeBField.hpp @@ -61,7 +61,7 @@ class MultiRangeBField final : public MagneticFieldProvider { /// /// @warning This is not currently implemented. Result getFieldGradient( - const Vector3& position, ActsMatrix<3, 3>& /*unused*/, + const Vector3& position, SquareMatrix3& /*unused*/, MagneticFieldProvider::Cache& cache) const override; }; } // namespace Acts diff --git a/Core/include/Acts/MagneticField/NullBField.hpp b/Core/include/Acts/MagneticField/NullBField.hpp index d3c24ee59f3..e627c3aeb18 100644 --- a/Core/include/Acts/MagneticField/NullBField.hpp +++ b/Core/include/Acts/MagneticField/NullBField.hpp @@ -43,7 +43,7 @@ class NullBField final : public MagneticFieldProvider { /// @note currently the derivative is not calculated /// @todo return derivative Result getFieldGradient( - const Vector3& position, ActsMatrix<3, 3>& derivative, + const Vector3& position, SquareMatrix3& derivative, MagneticFieldProvider::Cache& cache) const override { (void)position; (void)derivative; diff --git a/Core/include/Acts/MagneticField/SolenoidBField.hpp b/Core/include/Acts/MagneticField/SolenoidBField.hpp index b2162203eec..1236c736395 100644 --- a/Core/include/Acts/MagneticField/SolenoidBField.hpp +++ b/Core/include/Acts/MagneticField/SolenoidBField.hpp @@ -116,7 +116,7 @@ class SolenoidBField final : public MagneticFieldProvider { /// @note currently the derivative is not calculated /// @todo return derivative Result getFieldGradient( - const Vector3& position, ActsMatrix<3, 3>& derivative, + const Vector3& position, SquareMatrix3& derivative, MagneticFieldProvider::Cache& cache) const override; private: diff --git a/Core/include/Acts/Propagator/EigenStepperDefaultExtension.hpp b/Core/include/Acts/Propagator/EigenStepperDefaultExtension.hpp index cb7939534f5..c48bd9bbcc2 100644 --- a/Core/include/Acts/Propagator/EigenStepperDefaultExtension.hpp +++ b/Core/include/Acts/Propagator/EigenStepperDefaultExtension.hpp @@ -175,10 +175,10 @@ struct EigenStepperDefaultExtension { auto dGdT = D.block<3, 3>(4, 4); auto dGdL = D.block<3, 1>(4, 7); - ActsMatrix<3, 3> dk1dT = ActsMatrix<3, 3>::Zero(); - ActsMatrix<3, 3> dk2dT = ActsMatrix<3, 3>::Identity(); - ActsMatrix<3, 3> dk3dT = ActsMatrix<3, 3>::Identity(); - ActsMatrix<3, 3> dk4dT = ActsMatrix<3, 3>::Identity(); + SquareMatrix3 dk1dT = SquareMatrix3::Zero(); + SquareMatrix3 dk2dT = SquareMatrix3::Identity(); + SquareMatrix3 dk3dT = SquareMatrix3::Identity(); + SquareMatrix3 dk4dT = SquareMatrix3::Identity(); Vector3 dk1dL = Vector3::Zero(); Vector3 dk2dL = Vector3::Zero(); diff --git a/Core/include/Acts/Propagator/EigenStepperDenseExtension.hpp b/Core/include/Acts/Propagator/EigenStepperDenseExtension.hpp index a3d88ea1997..935e747f3aa 100644 --- a/Core/include/Acts/Propagator/EigenStepperDenseExtension.hpp +++ b/Core/include/Acts/Propagator/EigenStepperDenseExtension.hpp @@ -263,10 +263,10 @@ struct EigenStepperDenseExtension { auto dGdT = D.block<3, 3>(4, 4); auto dGdL = D.block<3, 1>(4, 7); - ActsMatrix<3, 3> dk1dT = ActsMatrix<3, 3>::Zero(); - ActsMatrix<3, 3> dk2dT = ActsMatrix<3, 3>::Identity(); - ActsMatrix<3, 3> dk3dT = ActsMatrix<3, 3>::Identity(); - ActsMatrix<3, 3> dk4dT = ActsMatrix<3, 3>::Identity(); + SquareMatrix3 dk1dT = SquareMatrix3::Zero(); + SquareMatrix3 dk2dT = SquareMatrix3::Identity(); + SquareMatrix3 dk3dT = SquareMatrix3::Identity(); + SquareMatrix3 dk4dT = SquareMatrix3::Identity(); Vector3 dk1dL = Vector3::Zero(); Vector3 dk2dL = Vector3::Zero(); diff --git a/Core/include/Acts/Surfaces/CylinderBounds.hpp b/Core/include/Acts/Surfaces/CylinderBounds.hpp index d144c8b995b..11e011059b9 100644 --- a/Core/include/Acts/Surfaces/CylinderBounds.hpp +++ b/Core/include/Acts/Surfaces/CylinderBounds.hpp @@ -145,7 +145,7 @@ class CylinderBounds : public SurfaceBounds { Vector2 shifted(const Vector2& lposition) const; /// Return the jacobian into the polar coordinate - ActsMatrix<2, 2> jacobian() const; + SquareMatrix2 jacobian() const; }; inline std::vector CylinderBounds::values() const { diff --git a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp index 32c63c2aef6..afb39f41802 100644 --- a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp +++ b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp @@ -150,7 +150,7 @@ class DiscTrapezoidBounds : public DiscBounds { /// into its Cartesian representation /// /// @param lposition The local position in polar coordinates - ActsMatrix<2, 2> jacobianToLocalCartesian(const Vector2& lposition) const; + SquareMatrix2 jacobianToLocalCartesian(const Vector2& lposition) const; }; inline double DiscTrapezoidBounds::rMin() const { diff --git a/Core/include/Acts/Utilities/VectorHelpers.hpp b/Core/include/Acts/Utilities/VectorHelpers.hpp index bec3e874cf9..e2c78619a3f 100644 --- a/Core/include/Acts/Utilities/VectorHelpers.hpp +++ b/Core/include/Acts/Utilities/VectorHelpers.hpp @@ -178,8 +178,8 @@ inline double cast(const Vector3& position, BinningValue bval) { /// @param [in] m Matrix that will be used for cross products /// @param [in] v Vector for cross products /// @return Constructed matrix -inline ActsMatrix<3, 3> cross(const ActsMatrix<3, 3>& m, const Vector3& v) { - ActsMatrix<3, 3> r; +inline SquareMatrix3 cross(const SquareMatrix3& m, const Vector3& v) { + SquareMatrix3 r; r.col(0) = m.col(0).cross(v); r.col(1) = m.col(1).cross(v); r.col(2) = m.col(2).cross(v); diff --git a/Core/src/MagneticField/MultiRangeBField.cpp b/Core/src/MagneticField/MultiRangeBField.cpp index 8899b50d802..f1553413dd2 100644 --- a/Core/src/MagneticField/MultiRangeBField.cpp +++ b/Core/src/MagneticField/MultiRangeBField.cpp @@ -71,7 +71,7 @@ Result MultiRangeBField::getField( } Result MultiRangeBField::getFieldGradient( - const Vector3& position, ActsMatrix<3, 3>& /*unused*/, + const Vector3& position, SquareMatrix3& /*unused*/, MagneticFieldProvider::Cache& cache) const { return getField(position, cache); } diff --git a/Core/src/MagneticField/SolenoidBField.cpp b/Core/src/MagneticField/SolenoidBField.cpp index 44cb12d3403..27548fea7c2 100644 --- a/Core/src/MagneticField/SolenoidBField.cpp +++ b/Core/src/MagneticField/SolenoidBField.cpp @@ -58,7 +58,7 @@ Acts::Vector2 Acts::SolenoidBField::getField(const Vector2& position) const { } Acts::Result Acts::SolenoidBField::getFieldGradient( - const Vector3& position, ActsMatrix<3, 3>& /*derivative*/, + const Vector3& position, SquareMatrix3& /*derivative*/, MagneticFieldProvider::Cache& /*cache*/) const { return Result::success(getField(position)); } diff --git a/Core/src/Surfaces/AnnulusBounds.cpp b/Core/src/Surfaces/AnnulusBounds.cpp index 593184816ac..0296517d6d7 100644 --- a/Core/src/Surfaces/AnnulusBounds.cpp +++ b/Core/src/Surfaces/AnnulusBounds.cpp @@ -278,7 +278,7 @@ bool Acts::AnnulusBounds::inside( double B = cosDPhiPhiStrip; double C = -sinDPhiPhiStrip; - ActsMatrix<2, 2> jacobianStripPCToModulePC; + SquareMatrix2 jacobianStripPCToModulePC; jacobianStripPCToModulePC(0, 0) = (B * O_x + C * O_y + r_strip) / sqrtA; jacobianStripPCToModulePC(0, 1) = r_strip * (B * O_y + O_x * sinDPhiPhiStrip) / sqrtA; diff --git a/Core/src/Surfaces/CylinderBounds.cpp b/Core/src/Surfaces/CylinderBounds.cpp index c538b5c170b..443998b3b4e 100644 --- a/Core/src/Surfaces/CylinderBounds.cpp +++ b/Core/src/Surfaces/CylinderBounds.cpp @@ -35,8 +35,8 @@ Acts::Vector2 Acts::CylinderBounds::shifted( lposition[Acts::eBoundLoc1]}; } -Acts::ActsMatrix<2, 2> Acts::CylinderBounds::jacobian() const { - ActsMatrix<2, 2> j; +Acts::SquareMatrix2 Acts::CylinderBounds::jacobian() const { + SquareMatrix2 j; j(0, eBoundLoc0) = 1 / get(eR); j(0, eBoundLoc1) = 0; j(1, eBoundLoc0) = 0; diff --git a/Core/src/Surfaces/DiscTrapezoidBounds.cpp b/Core/src/Surfaces/DiscTrapezoidBounds.cpp index ed02bac17de..3a234edbd9c 100644 --- a/Core/src/Surfaces/DiscTrapezoidBounds.cpp +++ b/Core/src/Surfaces/DiscTrapezoidBounds.cpp @@ -39,9 +39,9 @@ Acts::Vector2 Acts::DiscTrapezoidBounds::toLocalCartesian( std::cos(lposition[eBoundLoc1] - get(eAveragePhi))}; } -Acts::ActsMatrix<2, 2> Acts::DiscTrapezoidBounds::jacobianToLocalCartesian( +Acts::SquareMatrix2 Acts::DiscTrapezoidBounds::jacobianToLocalCartesian( const Acts::Vector2& lposition) const { - ActsMatrix<2, 2> jacobian; + SquareMatrix2 jacobian; jacobian(0, eBoundLoc0) = std::sin(lposition[eBoundLoc1] - get(eAveragePhi)); jacobian(1, eBoundLoc0) = std::cos(lposition[eBoundLoc1] - get(eAveragePhi)); jacobian(0, eBoundLoc1) = diff --git a/Core/src/Utilities/SpacePointUtility.cpp b/Core/src/Utilities/SpacePointUtility.cpp index 6f662fe20bd..3da404653ca 100644 --- a/Core/src/Utilities/SpacePointUtility.cpp +++ b/Core/src/Utilities/SpacePointUtility.cpp @@ -82,10 +82,9 @@ SpacePointUtility::globalCoords( jacXyzToRhoZ(0, ePos1) = scale * y; jacXyzToRhoZ(1, ePos2) = 1; // compute Jacobian from local coordinates to rho/z - ActsMatrix<2, 2> jac = - jacXyzToRhoZ * rotLocalToGlobal.block<3, 2>(ePos0, ePos0); + SquareMatrix2 jac = jacXyzToRhoZ * rotLocalToGlobal.block<3, 2>(ePos0, ePos0); // compute rho/z variance - ActsVector<2> var = (jac * localCov * jac.transpose()).diagonal(); + Vector2 var = (jac * localCov * jac.transpose()).diagonal(); auto gcov = Vector2(var[0], var[1]); @@ -145,10 +144,9 @@ Vector2 SpacePointUtility::rhoZCovariance(const GeometryContext& gctx, jacXyzToRhoZ(0, ePos1) = scale * y; jacXyzToRhoZ(1, ePos2) = 1; // compute Jacobian from local coordinates to rho/z - ActsMatrix<2, 2> jac = - jacXyzToRhoZ * rotLocalToGlobal.block<3, 2>(ePos0, ePos0); + SquareMatrix2 jac = jacXyzToRhoZ * rotLocalToGlobal.block<3, 2>(ePos0, ePos0); // compute rho/z variance - ActsVector<2> var = (jac * localCov * jac.transpose()).diagonal(); + Vector2 var = (jac * localCov * jac.transpose()).diagonal(); auto gcov = Vector2(var[0], var[1]); diff --git a/Core/src/Vertexing/AdaptiveGridTrackDensity.cpp b/Core/src/Vertexing/AdaptiveGridTrackDensity.cpp index 31daae4b039..81ff9712c2e 100644 --- a/Core/src/Vertexing/AdaptiveGridTrackDensity.cpp +++ b/Core/src/Vertexing/AdaptiveGridTrackDensity.cpp @@ -181,7 +181,7 @@ AdaptiveGridTrackDensity::getMaxZTPositionAndWidth( AdaptiveGridTrackDensity::DensityMap AdaptiveGridTrackDensity::addTrack( const BoundTrackParameters& trk, DensityMap& mainDensityMap) const { - ActsVector<3> impactParams = trk.impactParameters(); + Vector3 impactParams = trk.impactParameters(); ActsSquareMatrix<3> cov = trk.impactParameterCovariance().value(); std::uint32_t spatialTrkGridSize = diff --git a/Core/src/Vertexing/AdaptiveMultiVertexFitter.cpp b/Core/src/Vertexing/AdaptiveMultiVertexFitter.cpp index 8cb6e6d8e93..589a1637cbf 100644 --- a/Core/src/Vertexing/AdaptiveMultiVertexFitter.cpp +++ b/Core/src/Vertexing/AdaptiveMultiVertexFitter.cpp @@ -44,8 +44,8 @@ Acts::Result Acts::AdaptiveMultiVertexFitter::fit( // and the linearization point of the tracks. If it is too large, // we relinearize the tracks and recalculate their 3D impact // parameters. - ActsVector<2> xyDiff = vtxInfo.oldPosition.template head<2>() - - vtxInfo.linPoint.template head<2>(); + Vector2 xyDiff = vtxInfo.oldPosition.template head<2>() - + vtxInfo.linPoint.template head<2>(); if (xyDiff.norm() > m_cfg.maxDistToLinPoint) { // Set flag for relinearization vtxInfo.relinearize = true; diff --git a/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBField.hpp b/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBField.hpp index aa799319e29..d6b8781170a 100644 --- a/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBField.hpp +++ b/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBField.hpp @@ -72,7 +72,7 @@ class ScalableBField final : public Acts::MagneticFieldProvider { /// @note currently the derivative is not calculated /// @todo return derivative Acts::Result getFieldGradient( - const Acts::Vector3& /*position*/, Acts::ActsMatrix<3, 3>& /*derivative*/, + const Acts::Vector3& /*position*/, Acts::SquareMatrix3& /*derivative*/, MagneticFieldProvider::Cache& gCache) const override { Cache& cache = gCache.as(); return Acts::Result::success(m_BField * cache.scalor); diff --git a/Examples/Io/Root/src/VertexNTupleWriter.cpp b/Examples/Io/Root/src/VertexNTupleWriter.cpp index 6304af1cb8d..affd046b564 100644 --- a/Examples/Io/Root/src/VertexNTupleWriter.cpp +++ b/Examples/Io/Root/src/VertexNTupleWriter.cpp @@ -836,7 +836,7 @@ ProcessCode VertexNTupleWriter::writeT( if (paramsAtVtx.has_value()) { Acts::Vector3 recoMom = paramsAtVtx->parameters().segment(Acts::eBoundPhi, 3); - const Acts::ActsMatrix<3, 3>& momCov = + const Acts::SquareMatrix3& momCov = paramsAtVtx->covariance()->template block<3, 3>(Acts::eBoundPhi, Acts::eBoundPhi); innerRecoPhi.push_back(recoMom[0]); @@ -889,7 +889,7 @@ ProcessCode VertexNTupleWriter::writeT( if (paramsAtVtxFitted.has_value()) { Acts::Vector3 recoMomFitted = paramsAtVtxFitted->parameters().segment(Acts::eBoundPhi, 3); - const Acts::ActsMatrix<3, 3>& momCovFitted = + const Acts::SquareMatrix3& momCovFitted = paramsAtVtxFitted->covariance()->block<3, 3>(Acts::eBoundPhi, Acts::eBoundPhi); innerRecoPhiFitted.push_back(recoMomFitted[0]); diff --git a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepFieldAdapter.hpp b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepFieldAdapter.hpp index 6f7b8077348..38cca4855bc 100644 --- a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepFieldAdapter.hpp +++ b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepFieldAdapter.hpp @@ -31,7 +31,7 @@ class DD4hepFieldAdapter : public Acts::MagneticFieldProvider { MagneticFieldProvider::Cache& cache) const override; Result getFieldGradient( - const Vector3& position, ActsMatrix<3, 3>& derivative, + const Vector3& position, SquareMatrix3& derivative, MagneticFieldProvider::Cache& cache) const override; private: diff --git a/Plugins/DD4hep/src/DD4hepFieldAdapter.cpp b/Plugins/DD4hep/src/DD4hepFieldAdapter.cpp index ad8ce3c2bda..236a0dfdd27 100644 --- a/Plugins/DD4hep/src/DD4hepFieldAdapter.cpp +++ b/Plugins/DD4hep/src/DD4hepFieldAdapter.cpp @@ -51,7 +51,7 @@ Result DD4hepFieldAdapter::getField( } Result DD4hepFieldAdapter::getFieldGradient( - const Vector3& /*position*/, ActsMatrix<3, 3>& /*derivative*/, + const Vector3& /*position*/, SquareMatrix3& /*derivative*/, MagneticFieldProvider::Cache& /*cache*/) const { return Result::failure(MagneticFieldError::NotImplemented); } diff --git a/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp b/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp index fcfddd42adb..4d89df9bb41 100644 --- a/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp +++ b/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp @@ -52,7 +52,7 @@ int main(int /*argc*/, char** /*argv[]*/) { auto random_point = [&]() -> Vector2 { return {xDist(rng), yDist(rng)}; }; // for covariance based check, set up one; - ActsMatrix<2, 2> cov; + SquareMatrix2 cov; cov << 1.0, 0, 0, 0.05; BoundaryTolerance bcAbs = BoundaryTolerance::None(); diff --git a/Tests/UnitTests/Core/Geometry/VolumeTests.cpp b/Tests/UnitTests/Core/Geometry/VolumeTests.cpp index 599870f1a12..8c10abc18c2 100644 --- a/Tests/UnitTests/Core/Geometry/VolumeTests.cpp +++ b/Tests/UnitTests/Core/Geometry/VolumeTests.cpp @@ -31,7 +31,7 @@ BOOST_AUTO_TEST_CASE(VolumeTest) { Vector3 translation{1_mm, 2_mm, 3_mm}; // Build a translation - ActsMatrix<3, 3> rotation = RotationMatrix3::Identity(); + SquareMatrix3 rotation = RotationMatrix3::Identity(); double rotationAngle = 60_degree; Vector3 xPos(cos(rotationAngle), 0., sin(rotationAngle)); Vector3 yPos(0., 1., 0.); diff --git a/Tests/UnitTests/Core/MagneticField/InterpolatedBFieldMapTests.cpp b/Tests/UnitTests/Core/MagneticField/InterpolatedBFieldMapTests.cpp index 9e246b6c326..ec06fba2493 100644 --- a/Tests/UnitTests/Core/MagneticField/InterpolatedBFieldMapTests.cpp +++ b/Tests/UnitTests/Core/MagneticField/InterpolatedBFieldMapTests.cpp @@ -117,7 +117,7 @@ BOOST_AUTO_TEST_CASE(InterpolatedBFieldMap_rz) { CHECK_CLOSE_REL(c.getField(transformPos(pos)), BField::value({{perp(pos), pos.z()}}), 1e-6); - ActsMatrix<3, 3> deriv; + SquareMatrix3 deriv; pos << 1, 1, -5.5; // this position is outside the grid BOOST_CHECK(!b.isInside(pos)); diff --git a/Tests/UnitTests/Core/Propagator/BoundToCurvilinearConversionTests.cpp b/Tests/UnitTests/Core/Propagator/BoundToCurvilinearConversionTests.cpp index e44e0014fcd..435f4d45bdb 100644 --- a/Tests/UnitTests/Core/Propagator/BoundToCurvilinearConversionTests.cpp +++ b/Tests/UnitTests/Core/Propagator/BoundToCurvilinearConversionTests.cpp @@ -137,7 +137,7 @@ T_Matrix matrixRatio(const T_Matrix &a, const T_Matrix &b) { struct TestData { enum ESurfaceType { kPlane, kPolarDisk, kCylinder }; - TestData(Vector3 &&a_surface_center, ActsMatrix<3, 3> &&a_surface_rot, + TestData(Vector3 &&a_surface_center, SquareMatrix3 &&a_surface_rot, ESurfaceType a_surface_type, BoundVector &&a_param_vec, BoundSquareMatrix &&a_param_cov, Vector3 &&a_bfield) : surface_center(std::move(a_surface_center)), @@ -148,7 +148,7 @@ struct TestData { bfield(std::move(a_bfield)) {} Vector3 surface_center; - ActsMatrix<3, 3> surface_rot; + SquareMatrix3 surface_rot; ESurfaceType surface_type; BoundVector param_vec; BoundSquareMatrix param_cov; @@ -169,7 +169,7 @@ void test_bound_to_curvilinear(const std::vector &test_data_list, // create bound parameters from test data const Vector3 &surface_center = test_data.surface_center; - const ActsMatrix<3, 3> &surface_rot = test_data.surface_rot; + const SquareMatrix3 &surface_rot = test_data.surface_rot; const BoundVector ¶m_vec = test_data.param_vec; const BoundSquareMatrix &cov = test_data.param_cov; diff --git a/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp b/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp index 249f822eb54..343190311a3 100644 --- a/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp @@ -995,7 +995,7 @@ BOOST_AUTO_TEST_CASE(Material) { createMeasurements(simPropagator, geoCtx, magCtx, parametersMeasurements, resMapAllPixel, rng); - const Acts::ActsVector<2> scatterOffset = {100_mm, 100_mm}; + const Acts::Vector2 scatterOffset = {100_mm, 100_mm}; const std::size_t indexMaterialSurface = 3; for (std::size_t iMeas = indexMaterialSurface; iMeas < nSurfaces; iMeas++) { // This only works, because our detector is evenly spaced diff --git a/Tests/UnitTests/Core/Utilities/HelpersTests.cpp b/Tests/UnitTests/Core/Utilities/HelpersTests.cpp index a2a719fc535..c849366e12f 100644 --- a/Tests/UnitTests/Core/Utilities/HelpersTests.cpp +++ b/Tests/UnitTests/Core/Utilities/HelpersTests.cpp @@ -77,11 +77,11 @@ BOOST_AUTO_TEST_CASE(theta_eta_test_helper) { BOOST_AUTO_TEST_CASE(cross_test_helper) { { Vector3 v(1, 2, 3); - ActsMatrix<3, 3> mat; + SquareMatrix3 mat; mat << 1, 2, 3, 4, 5, 6, 7, 8, 9; - ActsMatrix<3, 3> act = cross(mat, v); - ActsMatrix<3, 3> exp; + SquareMatrix3 act = cross(mat, v); + SquareMatrix3 exp; exp << -2, -1, 0, 4, 2, 0, -2, -1, 0; CHECK_CLOSE_ABS(act, exp, 1e-9); @@ -89,7 +89,7 @@ BOOST_AUTO_TEST_CASE(cross_test_helper) { } BOOST_AUTO_TEST_CASE(toString_test_helper) { - ActsMatrix<3, 3> mat; + SquareMatrix3 mat; mat << 1, 2, 3, 4, 5, 6, 7, 8, 9; std::string out; out = toString(mat); @@ -172,8 +172,8 @@ BOOST_AUTO_TEST_CASE(test_matrix_dimension_switch) { } using MatrixProductTypes = - std::tuple, ActsMatrix<3, 3>>, - std::pair, ActsMatrix<4, 4>>, + std::tuple, + std::pair, std::pair, ActsMatrix<8, 8>>, std::pair, ActsMatrix<7, 4>>>; diff --git a/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp b/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp index d26ba186e84..d1f59da82ce 100644 --- a/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp @@ -305,7 +305,7 @@ BOOST_DATA_TEST_CASE(TimeAtPca, tracksWithoutIPs* vertices, t0, phi, theta, p, geoContext, rParams, vtxPos, state) .value(); - ActsVector<4> distVec = distAndMom.first; + Vector4 distVec = distAndMom.first; Vector3 momDir = distAndMom.second; // Check quantities: