diff --git a/Core/ActsVersion.hpp.in b/Core/ActsVersion.hpp.in index 4dc1ba7acb7..5cbc4c9e6a0 100644 --- a/Core/ActsVersion.hpp.in +++ b/Core/ActsVersion.hpp.in @@ -43,7 +43,6 @@ struct VersionInfo { static VersionInfo fromLibrary(); bool operator==(const VersionInfo& other) const; - bool operator!=(const VersionInfo& other) const { return !(*this == other); } friend std::ostream& operator<<(std::ostream& os, const VersionInfo& vi); diff --git a/Core/include/Acts/Definitions/Direction.hpp b/Core/include/Acts/Definitions/Direction.hpp index 9254b35a40c..5e7f0c94ea2 100644 --- a/Core/include/Acts/Definitions/Direction.hpp +++ b/Core/include/Acts/Definitions/Direction.hpp @@ -41,7 +41,7 @@ class Direction final { /// @param scalar is the signed value /// /// @return a direction enum - static inline constexpr Direction fromScalar(ActsScalar scalar) { + static constexpr Direction fromScalar(ActsScalar scalar) { assert(scalar != 0); return scalar >= 0 ? Value::Positive : Value::Negative; } @@ -53,8 +53,7 @@ class Direction final { /// @param scalar is the signed value /// /// @return a direction enum - static inline constexpr Direction fromScalarZeroAsPositive( - ActsScalar scalar) { + static constexpr Direction fromScalarZeroAsPositive(ActsScalar scalar) { return scalar >= 0 ? Value::Positive : Value::Negative; } @@ -62,7 +61,7 @@ class Direction final { /// std::array /// /// @param index is the direction at input - static inline constexpr Direction fromIndex(std::size_t index) { + static constexpr Direction fromIndex(std::size_t index) { if (index == 0u) { return Value::Negative; } @@ -73,7 +72,7 @@ class Direction final { /// objects in std::array /// /// @return either 0 or 1 - inline constexpr std::size_t index() const { + constexpr std::size_t index() const { if (m_value == Value::Negative) { return 0u; } @@ -83,28 +82,24 @@ class Direction final { /// Turns the direction into a signed value /// /// @return a signed value - inline constexpr int sign() const { return static_cast(m_value); } + constexpr int sign() const { return static_cast(m_value); } /// Reverse the direction /// /// @return an opposite direction - inline constexpr Direction invert() const { + constexpr Direction invert() const { return (m_value == Value::Positive) ? Value::Negative : Value::Positive; } std::string toString() const; - inline constexpr Direction() = default; - inline constexpr Direction(Value value) : m_value(value) {} + constexpr Direction() = default; + constexpr Direction(Value value) : m_value(value) {} - inline constexpr bool operator==(Direction other) const { + constexpr bool operator==(Direction other) const { return m_value == other.m_value; } - inline constexpr bool operator!=(Direction other) const { - return m_value != other.m_value; - } - private: Value m_value = Value::Positive; }; @@ -113,15 +108,15 @@ std::ostream& operator<<(std::ostream& os, Direction dir); // Direction * T -inline constexpr int operator*(Direction dir, int value) { +constexpr int operator*(Direction dir, int value) { return dir.sign() * value; } -inline constexpr float operator*(Direction dir, float value) { +constexpr float operator*(Direction dir, float value) { return dir.sign() * value; } -inline constexpr double operator*(Direction dir, double value) { +constexpr double operator*(Direction dir, double value) { return dir.sign() * value; } @@ -131,15 +126,15 @@ inline Acts::Vector3 operator*(Direction dir, const Acts::Vector3& value) { // T * Direction -inline constexpr int operator*(int value, Direction dir) { +constexpr int operator*(int value, Direction dir) { return value * dir.sign(); } -inline constexpr float operator*(float value, Direction dir) { +constexpr float operator*(float value, Direction dir) { return value * dir.sign(); } -inline constexpr double operator*(double value, Direction dir) { +constexpr double operator*(double value, Direction dir) { return value * dir.sign(); } @@ -149,17 +144,17 @@ inline Acts::Vector3 operator*(const Acts::Vector3& value, Direction dir) { // T *= Direction -inline constexpr int operator*=(int& value, Direction dir) { +constexpr int operator*=(int& value, Direction dir) { value *= dir.sign(); return value; } -inline constexpr float operator*=(float& value, Direction dir) { +constexpr float operator*=(float& value, Direction dir) { value *= dir.sign(); return value; } -inline constexpr double operator*=(double& value, Direction dir) { +constexpr double operator*=(double& value, Direction dir) { value *= dir.sign(); return value; } diff --git a/Core/include/Acts/Definitions/PdgParticle.hpp b/Core/include/Acts/Definitions/PdgParticle.hpp index 28f7d248493..70c33b06e3a 100644 --- a/Core/include/Acts/Definitions/PdgParticle.hpp +++ b/Core/include/Acts/Definitions/PdgParticle.hpp @@ -36,7 +36,7 @@ enum PdgParticle : std::int32_t { }; /// Convert an anti-particle to its particle and leave particles as-is. -static constexpr inline PdgParticle makeAbsolutePdgParticle(PdgParticle pdg) { +static constexpr PdgParticle makeAbsolutePdgParticle(PdgParticle pdg) { const auto value = static_cast(pdg); return static_cast((0 <= value) ? value : -value); } diff --git a/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp b/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp index 3d256630f76..ca1bff36734 100644 --- a/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp +++ b/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp @@ -282,11 +282,7 @@ class GenericBoundTrackParameters { (lhs.m_surface == rhs.m_surface) && (lhs.m_particleHypothesis == rhs.m_particleHypothesis); } - /// Compare two bound track parameters for bitwise in-equality. - friend bool operator!=(const GenericBoundTrackParameters& lhs, - const GenericBoundTrackParameters& rhs) { - return !(lhs == rhs); - } + /// Print information to the output stream. friend std::ostream& operator<<(std::ostream& os, const GenericBoundTrackParameters& tp) { diff --git a/Core/include/Acts/EventData/GenericParticleHypothesis.hpp b/Core/include/Acts/EventData/GenericParticleHypothesis.hpp index 38c70409dc6..437eb20cac2 100644 --- a/Core/include/Acts/EventData/GenericParticleHypothesis.hpp +++ b/Core/include/Acts/EventData/GenericParticleHypothesis.hpp @@ -133,11 +133,6 @@ class GenericParticleHypothesis { return (lhs.m_absPdg == rhs.m_absPdg) && (lhs.m_mass == rhs.m_mass) && (lhs.m_chargeType == rhs.m_chargeType); } - friend bool operator!=(const GenericParticleHypothesis& lhs, - const GenericParticleHypothesis& rhs) { - return (lhs.m_absPdg != rhs.m_absPdg) || (lhs.m_mass != rhs.m_mass) || - (lhs.m_chargeType != rhs.m_chargeType); - } }; } // namespace Acts diff --git a/Core/include/Acts/EventData/MultiTrajectory.hpp b/Core/include/Acts/EventData/MultiTrajectory.hpp index 0499f66bc6a..2b53e485ce4 100644 --- a/Core/include/Acts/EventData/MultiTrajectory.hpp +++ b/Core/include/Acts/EventData/MultiTrajectory.hpp @@ -103,8 +103,6 @@ class TrackStateRange { return false; } - bool operator!=(const Iterator& other) const { return !(*this == other); } - ProxyType operator*() const { return *proxy; } ProxyType operator*() { return *proxy; } }; diff --git a/Core/include/Acts/EventData/SourceLink.hpp b/Core/include/Acts/EventData/SourceLink.hpp index fb245a929e5..0094258956a 100644 --- a/Core/include/Acts/EventData/SourceLink.hpp +++ b/Core/include/Acts/EventData/SourceLink.hpp @@ -86,10 +86,6 @@ struct SourceLinkAdapterIterator { return m_iterator == other.m_iterator; } - bool operator!=(const SourceLinkAdapterIterator& other) const { - return !(*this == other); - } - Acts::SourceLink operator*() const { return Acts::SourceLink{*m_iterator}; } auto operator-(const SourceLinkAdapterIterator& other) const { diff --git a/Core/include/Acts/EventData/SpacePointProxyIterator.hpp b/Core/include/Acts/EventData/SpacePointProxyIterator.hpp index 53dbfea75bb..93794195d04 100644 --- a/Core/include/Acts/EventData/SpacePointProxyIterator.hpp +++ b/Core/include/Acts/EventData/SpacePointProxyIterator.hpp @@ -36,11 +36,7 @@ class SpacePointProxyIterator { SpacePointProxyIterator operator--(int); bool operator==(const SpacePointProxyIterator& other) const; - bool operator!=(const SpacePointProxyIterator& other) const; - bool operator<(const SpacePointProxyIterator& other) const; - bool operator>(const SpacePointProxyIterator& other) const; - bool operator<=(const SpacePointProxyIterator& other) const; - bool operator>=(const SpacePointProxyIterator& other) const; + auto operator<=>(const SpacePointProxyIterator& other) const; SpacePointProxyIterator& operator+=(const std::size_t offset); SpacePointProxyIterator& operator-=(const std::size_t offset); diff --git a/Core/include/Acts/EventData/SpacePointProxyIterator.ipp b/Core/include/Acts/EventData/SpacePointProxyIterator.ipp index 06f7dcb664e..5318c3b6f28 100644 --- a/Core/include/Acts/EventData/SpacePointProxyIterator.ipp +++ b/Core/include/Acts/EventData/SpacePointProxyIterator.ipp @@ -48,37 +48,12 @@ template bool SpacePointProxyIterator::operator==( const SpacePointProxyIterator& other) const { return m_container == other.m_container && m_index == other.m_index; - ; } template -bool SpacePointProxyIterator::operator!=( +auto SpacePointProxyIterator::operator<=>( const SpacePointProxyIterator& other) const { - return !(*this == other); -} - -template -bool SpacePointProxyIterator::operator<( - const SpacePointProxyIterator& other) const { - return m_index < other.m_index; -} - -template -bool SpacePointProxyIterator::operator>( - const SpacePointProxyIterator& other) const { - return m_index > other.m_index; -} - -template -bool SpacePointProxyIterator::operator<=( - const SpacePointProxyIterator& other) const { - return m_index <= other.m_index; -} - -template -bool SpacePointProxyIterator::operator>=( - const SpacePointProxyIterator& other) const { - return m_index >= other.m_index; + return m_index <=> other.m_index; } template diff --git a/Core/include/Acts/EventData/TrackProxy.hpp b/Core/include/Acts/EventData/TrackProxy.hpp index 81bc0f41715..8323878dd3c 100644 --- a/Core/include/Acts/EventData/TrackProxy.hpp +++ b/Core/include/Acts/EventData/TrackProxy.hpp @@ -68,24 +68,8 @@ class TrackProxyIterator { return m_container == other.m_container && m_itrack == other.m_itrack; } - bool operator!=(const TrackProxyIterator& other) const { - return !(*this == other); - } - - bool operator<(const TrackProxyIterator& other) const { - return m_itrack < other.m_itrack; - } - - bool operator>(const TrackProxyIterator& other) const { - return m_itrack > other.m_itrack; - } - - bool operator<=(const TrackProxyIterator& other) const { - return m_itrack <= other.m_itrack; - } - - bool operator>=(const TrackProxyIterator& other) const { - return m_itrack >= other.m_itrack; + auto operator<=>(const TrackProxyIterator& other) const { + return m_itrack <=> other.m_itrack; } ProxyType operator*() const { return m_container->getTrack(m_itrack); } diff --git a/Core/include/Acts/EventData/detail/DynamicKeyIterator.hpp b/Core/include/Acts/EventData/detail/DynamicKeyIterator.hpp index 95fb5ef18c4..03aa2cb47bb 100644 --- a/Core/include/Acts/EventData/detail/DynamicKeyIterator.hpp +++ b/Core/include/Acts/EventData/detail/DynamicKeyIterator.hpp @@ -44,10 +44,6 @@ class DynamicKeyIterator { return m_it == other.m_it; } - bool operator!=(const DynamicKeyIterator& other) const { - return m_it != other.m_it; - } - value_type operator*() const { return m_it->first; } private: diff --git a/Core/include/Acts/EventData/detail/TestSourceLink.hpp b/Core/include/Acts/EventData/detail/TestSourceLink.hpp index aadd8e4dc91..e9e4d4d1e80 100644 --- a/Core/include/Acts/EventData/detail/TestSourceLink.hpp +++ b/Core/include/Acts/EventData/detail/TestSourceLink.hpp @@ -72,12 +72,13 @@ struct TestSourceLink final { TestSourceLink(TestSourceLink&&) = default; TestSourceLink& operator=(const TestSourceLink&) = default; TestSourceLink& operator=(TestSourceLink&&) = default; + bool operator==(const TestSourceLink& rhs) const { return (m_geometryId == rhs.m_geometryId) && (sourceId == rhs.sourceId) && (indices == rhs.indices) && (parameters == rhs.parameters) && (covariance == rhs.covariance); } - bool operator!=(const TestSourceLink& rhs) const { return !(*this == rhs); } + std::ostream& print(std::ostream& os) const { os << "TestsSourceLink(geometryId=" << m_geometryId << ",sourceId=" << sourceId; diff --git a/Core/include/Acts/Geometry/Extent.hpp b/Core/include/Acts/Geometry/Extent.hpp index ac9a01e2386..c353f999330 100644 --- a/Core/include/Acts/Geometry/Extent.hpp +++ b/Core/include/Acts/Geometry/Extent.hpp @@ -82,14 +82,6 @@ struct ExtentEnvelope { return lhs.m_values == rhs.m_values; } - /// Comparison operator between envelope sets - /// @param lhs the left hand side - /// @param rhs the right hand side - /// @return true if the envelopes are not equal - friend bool operator!=(const ExtentEnvelope& lhs, const ExtentEnvelope& rhs) { - return !(lhs.m_values == rhs.m_values); - } - private: std::array m_values{}; }; @@ -108,9 +100,6 @@ class Extent { /// Define a comparison operator bool operator==(const Extent& e) const; - /// Define a comparison operator - bool operator!=(const Extent& e) const { return (!operator==(e)); } - /// Extend with a position vertex /// /// @param vtx the vertex to be used for extending diff --git a/Core/include/Acts/Geometry/GeometryIdentifier.hpp b/Core/include/Acts/Geometry/GeometryIdentifier.hpp index d28be53ef75..b77f0d8753a 100644 --- a/Core/include/Acts/Geometry/GeometryIdentifier.hpp +++ b/Core/include/Acts/Geometry/GeometryIdentifier.hpp @@ -126,7 +126,7 @@ class GeometryIdentifier { /// Set the masked bits to id in the encoded value. constexpr GeometryIdentifier& setBits(Value mask, Value id) { m_value = (m_value & ~mask) | ((id << extractShift(mask)) & mask); - // return *this here so we need to write less lines in the set... methods + // return *this here that we need to write fewer lines in the setXXX methods return *this; } @@ -134,10 +134,7 @@ class GeometryIdentifier { GeometryIdentifier rhs) { return lhs.m_value == rhs.m_value; } - friend constexpr bool operator!=(GeometryIdentifier lhs, - GeometryIdentifier rhs) { - return lhs.m_value != rhs.m_value; - } + friend constexpr bool operator<(GeometryIdentifier lhs, GeometryIdentifier rhs) { return lhs.m_value < rhs.m_value; diff --git a/Core/include/Acts/Geometry/Volume.hpp b/Core/include/Acts/Geometry/Volume.hpp index 3a6a592ffb0..91712f87a0e 100644 --- a/Core/include/Acts/Geometry/Volume.hpp +++ b/Core/include/Acts/Geometry/Volume.hpp @@ -116,7 +116,6 @@ class Volume : public GeometryObject { BinningValue bValue) const override; bool operator==(const Volume& other) const; - bool operator!=(const Volume& other) const; /// Produces a 3D visualization of this volume /// @param helper The visualization helper describing the output format diff --git a/Core/include/Acts/Material/Material.hpp b/Core/include/Acts/Material/Material.hpp index 2984a26a18d..02aab3d22e9 100644 --- a/Core/include/Acts/Material/Material.hpp +++ b/Core/include/Acts/Material/Material.hpp @@ -117,9 +117,6 @@ class Material { (lhs.m_ar == rhs.m_ar) && (lhs.m_z == rhs.m_z) && (lhs.m_molarRho == rhs.m_molarRho); } - friend constexpr bool operator!=(const Material& lhs, const Material& rhs) { - return !(lhs == rhs); - } }; std::ostream& operator<<(std::ostream& os, const Material& material); diff --git a/Core/include/Acts/Material/MaterialSlab.hpp b/Core/include/Acts/Material/MaterialSlab.hpp index 1942498daba..4bf37b8d1c5 100644 --- a/Core/include/Acts/Material/MaterialSlab.hpp +++ b/Core/include/Acts/Material/MaterialSlab.hpp @@ -85,10 +85,6 @@ class MaterialSlab { return (lhs.m_material == rhs.m_material) && (lhs.m_thickness == rhs.m_thickness); } - friend constexpr bool operator!=(const MaterialSlab& lhs, - const MaterialSlab& rhs) { - return !(lhs == rhs); - } }; std::ostream& operator<<(std::ostream& os, const MaterialSlab& materialSlab); diff --git a/Core/include/Acts/Propagator/ConstrainedStep.hpp b/Core/include/Acts/Propagator/ConstrainedStep.hpp index 4eb2517a17d..32f49fae6f5 100644 --- a/Core/include/Acts/Propagator/ConstrainedStep.hpp +++ b/Core/include/Acts/Propagator/ConstrainedStep.hpp @@ -156,7 +156,7 @@ class ConstrainedStep { } private: - inline static constexpr auto kNotSet = std::numeric_limits::max(); + static constexpr auto kNotSet = std::numeric_limits::max(); /// the step size tuple std::array m_values = {kNotSet, kNotSet, kNotSet}; diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp index 357d6b7b4bb..d8555b5bd64 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp @@ -428,7 +428,6 @@ class MultiEigenStepperLoop : public EigenStepper { // clang-format off auto& operator++() { ++it; return *this; } - auto operator!=(const Iterator& other) const { return it != other.it; } auto operator==(const Iterator& other) const { return it == other.it; } auto operator*() const { return ComponentProxy(*it, s); } // clang-format on @@ -463,7 +462,6 @@ class MultiEigenStepperLoop : public EigenStepper { // clang-format off auto& operator++() { ++it; return *this; } - auto operator!=(const ConstIterator& other) const { return it != other.it; } auto operator==(const ConstIterator& other) const { return it == other.it; } auto operator*() const { return ConstComponentProxy{*it}; } // clang-format on diff --git a/Core/include/Acts/Seeding/BinnedGroupIterator.hpp b/Core/include/Acts/Seeding/BinnedGroupIterator.hpp index bdd23d442ff..b16119110f8 100644 --- a/Core/include/Acts/Seeding/BinnedGroupIterator.hpp +++ b/Core/include/Acts/Seeding/BinnedGroupIterator.hpp @@ -83,10 +83,6 @@ class BinnedGroupIterator { /// @param [in] other The BinnedGroupIterator we are comparing against this one /// @return The result of the comparison bool operator==(const BinnedGroupIterator& other) const; - /// @brief (In-)Equality operator - /// @param [in] other The BinnedGroupIterator we are comparing against this one - /// @return The result of the comparison - bool operator!=(const BinnedGroupIterator& other) const; /// @brief Increment the iterator by one (pre) /// @return The incremented iterator diff --git a/Core/include/Acts/Seeding/BinnedGroupIterator.ipp b/Core/include/Acts/Seeding/BinnedGroupIterator.ipp index c41444b1014..334a6a743ec 100644 --- a/Core/include/Acts/Seeding/BinnedGroupIterator.ipp +++ b/Core/include/Acts/Seeding/BinnedGroupIterator.ipp @@ -30,12 +30,6 @@ bool Acts::BinnedGroupIterator::operator==( return m_group.ptr == other.m_group.ptr && m_gridItr == other.m_gridItr; } -template -bool Acts::BinnedGroupIterator::operator!=( - const Acts::BinnedGroupIterator& other) const { - return !(*this == other); -} - template Acts::BinnedGroupIterator& Acts::BinnedGroupIterator::operator++() { diff --git a/Core/include/Acts/Surfaces/Surface.hpp b/Core/include/Acts/Surfaces/Surface.hpp index d2f62e0bf31..d07fe6e51d4 100644 --- a/Core/include/Acts/Surfaces/Surface.hpp +++ b/Core/include/Acts/Surfaces/Surface.hpp @@ -165,11 +165,6 @@ class Surface : public virtual GeometryObject, /// @param other source surface for the comparison virtual bool operator==(const Surface& other) const; - /// Comparison (non-equality) operator - /// - /// @param sf Source surface for the comparison - virtual bool operator!=(const Surface& sf) const; - public: /// Return method for the Surface type to avoid dynamic casts virtual SurfaceType type() const = 0; diff --git a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp index b97cbb1a93b..40555986ce4 100644 --- a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp +++ b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp @@ -863,79 +863,57 @@ class CombinatorialKalmanFilter { auto currentBranch = result.activeBranches.back(); TrackIndexType prevTip = currentBranch.tipIndex(); - // Add a state only if there already is measurement on this branch - if (currentBranch.nMeasurements() > 0) { - ACTS_VERBOSE( - "Record hole or passive material state on surface since we " - "already have measurements on the branch"); - - // No source links on surface, add either hole or passive material - // TrackState. No storage allocation for uncalibrated/calibrated - // measurement and filtered parameter - auto stateMask = PM::Predicted | PM::Jacobian; - - // Transport the covariance to a curvilinear surface - stepper.transportCovarianceToCurvilinear(state.stepping); + // No source links on surface, add either hole or passive material + // TrackState. No storage allocation for uncalibrated/calibrated + // measurement and filtered parameter + auto stateMask = PM::Predicted | PM::Jacobian; - // Update state and stepper with pre material effects - materialInteractor(surface, state, stepper, navigator, - MaterialUpdateStage::PreUpdate); + // Transport the covariance to a curvilinear surface + stepper.transportCovarianceToCurvilinear(state.stepping); - // Transport & bind the state to the current surface - auto boundStateRes = - stepper.boundState(state.stepping, *surface, false); - if (!boundStateRes.ok()) { - return boundStateRes.error(); - } - auto& boundState = *boundStateRes; - auto& [boundParams, jacobian, pathLength] = boundState; - boundParams.covariance() = state.stepping.cov; - - // Add a hole or material track state - TrackIndexType currentTip = addNonSourcelinkState( - stateMask, boundState, result, isSensitive, prevTip); - auto nonSourcelinkState = - result.trackStates->getTrackState(currentTip); - currentBranch.tipIndex() = currentTip; - if (isSensitive) { - currentBranch.nHoles()++; - } + // Update state and stepper with pre material effects + materialInteractor(surface, state, stepper, navigator, + MaterialUpdateStage::PreUpdate); - BranchStopperResult branchStopperResult = - m_extensions.branchStopper(currentBranch, nonSourcelinkState); + // Transport & bind the state to the current surface + auto boundStateRes = + stepper.boundState(state.stepping, *surface, false); + if (!boundStateRes.ok()) { + return boundStateRes.error(); + } + auto& boundState = *boundStateRes; + auto& [boundParams, jacobian, pathLength] = boundState; + boundParams.covariance() = state.stepping.cov; - // Check the branch - if (branchStopperResult == BranchStopperResult::Continue) { - // Remembered the active branch and its state - } else { - // No branch on this surface - nBranchesOnSurface = 0; - if (branchStopperResult == BranchStopperResult::StopAndKeep) { - storeLastActiveBranch(result); - } - // Remove the branch from list - result.activeBranches.pop_back(); - } + // Add a hole or material track state to the multitrajectory + TrackIndexType currentTip = addNonSourcelinkState( + stateMask, boundState, result, isSensitive, prevTip); + auto nonSourcelinkState = result.trackStates->getTrackState(currentTip); + currentBranch.tipIndex() = currentTip; - // Update state and stepper with post material effects - materialInteractor(surface, state, stepper, navigator, - MaterialUpdateStage::PostUpdate); - } else if (isMaterial) { - // Since we did not find a measurement yet we don't create a track - // state but still need to do the material update - ACTS_VERBOSE("Handle material without creating a track state"); + if (isSensitive) { + currentBranch.nHoles()++; + } - // Transport the covariance to a curvilinear surface - stepper.transportCovarianceToCurvilinear(state.stepping); + BranchStopperResult branchStopperResult = + m_extensions.branchStopper(currentBranch, nonSourcelinkState); - // Update state and stepper with full material effects - materialInteractor(surface, state, stepper, navigator, - MaterialUpdateStage::FullUpdate); + // Check the branch + if (branchStopperResult == BranchStopperResult::Continue) { + // Remembered the active branch and its state } else { - ACTS_VERBOSE( - "Skipping surface as there are no measurements on the branch yet " - "and it does not have material"); + // No branch on this surface + nBranchesOnSurface = 0; + if (branchStopperResult == BranchStopperResult::StopAndKeep) { + storeLastActiveBranch(result); + } + // Remove the branch from list + result.activeBranches.pop_back(); } + + // Update state and stepper with post material effects + materialInteractor(surface, state, stepper, navigator, + MaterialUpdateStage::PostUpdate); } else { // Neither measurement nor material on surface, this branch is still // valid. Count the branch on current surface @@ -1166,31 +1144,13 @@ class CombinatorialKalmanFilter { auto currentBranch = result.activeBranches.back(); TrackIndexType currentTip = currentBranch.tipIndex(); - ACTS_VERBOSE("Find track with entry index = " - << currentTip << " and there are nMeasurements = " - << currentBranch.nMeasurements() + ACTS_VERBOSE("Storing track " + << currentBranch.index() << " with tip index " << currentTip + << ". nMeasurements = " << currentBranch.nMeasurements() << ", nOutliers = " << currentBranch.nOutliers() - << ", nHoles = " << currentBranch.nHoles() << " on track"); - - std::optional lastMeasurement; - for (const auto& trackState : currentBranch.trackStatesReversed()) { - if (trackState.typeFlags().test(TrackStateFlag::MeasurementFlag) && - !trackState.typeFlags().test(TrackStateFlag::OutlierFlag)) { - lastMeasurement = trackState; - break; - } - } + << ", nHoles = " << currentBranch.nHoles()); - if (lastMeasurement.has_value()) { - currentBranch.tipIndex() = lastMeasurement->index(); - result.collectedTracks.push_back(currentBranch); - ACTS_VERBOSE("Last measurement found on track with entry index = " - << currentTip << " and measurement index = " - << lastMeasurement->index()); - } else { - ACTS_VERBOSE( - "No measurement found on track with entry index = " << currentTip); - } + result.collectedTracks.push_back(currentBranch); } CombinatorialKalmanFilterExtensions m_extensions; diff --git a/Core/include/Acts/Utilities/Axis.hpp b/Core/include/Acts/Utilities/Axis.hpp index 21bcd885466..1591ff9e90a 100644 --- a/Core/include/Acts/Utilities/Axis.hpp +++ b/Core/include/Acts/Utilities/Axis.hpp @@ -66,8 +66,6 @@ class NeighborHoodIndices { return (m_current == it.m_current) && (m_wrapped == it.m_wrapped); } - bool operator!=(const iterator& it) const { return !(*this == it); } - private: std::size_t m_current = 0, m_end1 = 0, m_begin2 = 0; bool m_wrapped = false; diff --git a/Core/include/Acts/Utilities/GridIterator.hpp b/Core/include/Acts/Utilities/GridIterator.hpp index f70c02785a0..0e73498c1b5 100644 --- a/Core/include/Acts/Utilities/GridIterator.hpp +++ b/Core/include/Acts/Utilities/GridIterator.hpp @@ -73,27 +73,10 @@ class GridGlobalIterator { /// @param [in] other The other GridGlobalIterator to be compared against this one /// @return The result of the comparison bool operator==(const GridGlobalIterator& other) const; - /// @brief (In-)Equality operator + /// @brief Comparison (<=>) operator /// @param [in] other The other GridGlobalIterator to be compared against this one /// @return The result of the comparison - bool operator!=(const GridGlobalIterator& other) const; - - /// @brief Comparison (<) opetator - /// @param [in] other The other GridGlobalIterator to be compared against this one - /// @return The result of the comparison - bool operator<(const GridGlobalIterator& other) const; - /// @brief Comparison (>) opetator - /// @param [in] other The other GridGlobalIterator to be compared against this one - /// @return The result of the comparison - bool operator>(const GridGlobalIterator& other) const; - /// @brief Comparison (<=) opetator - /// @param [in] other The other GridGlobalIterator to be compared against this one - /// @return The result of the comparison - bool operator<=(const GridGlobalIterator& other) const; - /// @brief Comparison (>=) opetator - /// @param [in] other The other GridGlobalIterator to be compared against this one - /// @return The result of the comparison - bool operator>=(const GridGlobalIterator& other) const; + auto operator<=>(const GridGlobalIterator& other) const; /// @brief Increment this iterator with an offset /// @param [in] offset The increment value @@ -238,10 +221,6 @@ class GridLocalIterator { /// @param [in] other The other GridLocalIterator to be compared against this one /// @return The result of the comparison bool operator==(const Acts::GridLocalIterator& other) const; - /// @brief (In-)Equality operator - /// @param [in] other The other GridLocalIterator to be compared against this one - /// @return The result of the comparison - bool operator!=(const Acts::GridLocalIterator& other) const; /// @brief Return stored value at given local position /// @return The stored value in the grid from that given local position diff --git a/Core/include/Acts/Utilities/GridIterator.ipp b/Core/include/Acts/Utilities/GridIterator.ipp index f4fc9d325f9..44f5911eeef 100644 --- a/Core/include/Acts/Utilities/GridIterator.ipp +++ b/Core/include/Acts/Utilities/GridIterator.ipp @@ -37,39 +37,12 @@ bool GridGlobalIterator::operator==( } template -bool GridGlobalIterator::operator!=( - const GridGlobalIterator& other) const { - return !(*this == other); -} - -template -bool GridGlobalIterator::operator<( - const GridGlobalIterator& other) const { - // This operator only makes sense if the two iterators we are comparing - // are using the same grid - assert(m_grid.ptr == other.m_grid.ptr); - return m_idx < other.m_idx; -} - -template -bool GridGlobalIterator::operator>( +auto GridGlobalIterator::operator<=>( const GridGlobalIterator& other) const { // This operator only makes sense if the two iterators we are comparing // are using the same grid assert(m_grid.ptr == other.m_grid.ptr); - return m_idx > other.m_idx; -} - -template -bool GridGlobalIterator::operator<=( - const GridGlobalIterator& other) const { - return !(*this > other); -} - -template -bool GridGlobalIterator::operator>=( - const GridGlobalIterator& other) const { - return !(*this < other); + return m_idx <=> other.m_idx; } template @@ -222,12 +195,6 @@ bool Acts::GridLocalIterator::operator==( return true; } -template -bool Acts::GridLocalIterator::operator!=( - const Acts::GridLocalIterator& other) const { - return !(*this == other); -} - template const typename Acts::GridLocalIterator::value_type& Acts::GridLocalIterator::operator*() const { diff --git a/Core/include/Acts/Utilities/MultiIndex.hpp b/Core/include/Acts/Utilities/MultiIndex.hpp index 06babe66438..48265ecb5dc 100644 --- a/Core/include/Acts/Utilities/MultiIndex.hpp +++ b/Core/include/Acts/Utilities/MultiIndex.hpp @@ -139,12 +139,11 @@ class MultiIndex { friend constexpr bool operator<(MultiIndex lhs, MultiIndex rhs) { return lhs.m_value < rhs.m_value; } + friend constexpr bool operator==(MultiIndex lhs, MultiIndex rhs) { return lhs.m_value == rhs.m_value; } - friend constexpr bool operator!=(MultiIndex lhs, MultiIndex rhs) { - return lhs.m_value != rhs.m_value; - } + friend inline std::ostream& operator<<(std::ostream& os, MultiIndex idx) { // one level is always defined os << idx.level(0u); diff --git a/Core/include/Acts/Utilities/TrackHelpers.hpp b/Core/include/Acts/Utilities/TrackHelpers.hpp index 11589981b9b..69e91b5a738 100644 --- a/Core/include/Acts/Utilities/TrackHelpers.hpp +++ b/Core/include/Acts/Utilities/TrackHelpers.hpp @@ -368,13 +368,14 @@ Result extrapolateTracksToReferenceSurface( /// Helper function to calculate a number of track level quantities and store /// them on the track itself -/// @note The input track needs to be mutable, so @c ReadOnly=false -/// @tparam track_container_t the track container backend -/// @tparam track_state_container_t the track state container backend -/// @tparam holder_t the holder type for the track container backends +/// @tparam track_proxy_t The track proxy type /// @param track A mutable track proxy to operate on template -void calculateTrackQuantities(track_proxy_t track) { +void calculateTrackQuantities(track_proxy_t track) + requires(!track_proxy_t::ReadOnly) +{ + using ConstTrackStateProxy = typename track_proxy_t::ConstTrackStateProxy; + track.chi2() = 0; track.nDoF() = 0; @@ -383,8 +384,8 @@ void calculateTrackQuantities(track_proxy_t track) { track.nSharedHits() = 0; track.nOutliers() = 0; - for (const auto &trackState : track.trackStatesReversed()) { - auto typeFlags = trackState.typeFlags(); + for (ConstTrackStateProxy trackState : track.trackStatesReversed()) { + ConstTrackStateType typeFlags = trackState.typeFlags(); if (typeFlags.test(Acts::TrackStateFlag::HoleFlag)) { track.nHoles()++; @@ -401,6 +402,97 @@ void calculateTrackQuantities(track_proxy_t track) { } } +/// Helper function to trim track states from the front of a track +/// @tparam track_proxy_t the track proxy type +/// @param track the track to trim +/// @param trimHoles whether to trim holes +/// @param trimOutliers whether to trim outliers +/// @param trimMaterial whether to trim pure material states +template +void trimTrackFront(track_proxy_t track, bool trimHoles, bool trimOutliers, + bool trimMaterial) + requires(!track_proxy_t::ReadOnly) +{ + using TrackStateProxy = typename track_proxy_t::TrackStateProxy; + + // TODO specialize if track is forward linked + + std::optional front; + + for (TrackStateProxy trackState : track.trackStatesReversed()) { + TrackStateType typeFlags = trackState.typeFlags(); + if (trimHoles && typeFlags.test(TrackStateFlag::HoleFlag)) { + continue; + } + if (trimOutliers && typeFlags.test(TrackStateFlag::OutlierFlag)) { + continue; + } + if (trimMaterial && typeFlags.test(TrackStateFlag::MaterialFlag) && + !typeFlags.test(TrackStateFlag::MeasurementFlag)) { + continue; + } + + front = trackState; + } + + if (front.has_value()) { + front.value().previous() = TrackStateProxy::kInvalid; + } +} + +/// Helper function to trim track states from the back of a track +/// @tparam track_proxy_t the track proxy type +/// @param track the track to trim +/// @param trimHoles whether to trim holes +/// @param trimOutliers whether to trim outliers +/// @param trimMaterial whether to trim pure material states +template +void trimTrackBack(track_proxy_t track, bool trimHoles, bool trimOutliers, + bool trimMaterial) + requires(!track_proxy_t::ReadOnly) +{ + using TrackStateProxy = typename track_proxy_t::TrackStateProxy; + + std::optional back; + + for (TrackStateProxy trackState : track.trackStatesReversed()) { + back = trackState; + + TrackStateType typeFlags = trackState.typeFlags(); + if (trimHoles && typeFlags.test(TrackStateFlag::HoleFlag)) { + continue; + } + if (trimOutliers && typeFlags.test(TrackStateFlag::OutlierFlag)) { + continue; + } + if (trimMaterial && typeFlags.test(TrackStateFlag::MaterialFlag) && + !typeFlags.test(TrackStateFlag::MeasurementFlag)) { + continue; + } + + break; + } + + if (back.has_value()) { + track.tipIndex() = back.value().index(); + } +} + +/// Helper function to trim track states from the front and back of a track +/// @tparam track_proxy_t the track proxy type +/// @param track the track to trim +/// @param trimHoles whether to trim holes +/// @param trimOutliers whether to trim outliers +/// @param trimMaterial whether to trim pure material states +template +void trimTrack(track_proxy_t track, bool trimHoles, bool trimOutliers, + bool trimMaterial) + requires(!track_proxy_t::ReadOnly) +{ + trimTrackFront(track, trimHoles, trimOutliers, trimMaterial); + trimTrackBack(track, trimHoles, trimOutliers, trimMaterial); +} + } // namespace Acts namespace std { diff --git a/Core/include/Acts/Utilities/TransformRange.hpp b/Core/include/Acts/Utilities/TransformRange.hpp index 1ff8bcad6da..fc435e58567 100644 --- a/Core/include/Acts/Utilities/TransformRange.hpp +++ b/Core/include/Acts/Utilities/TransformRange.hpp @@ -192,12 +192,6 @@ struct TransformRangeIterator { return m_iterator == other.m_iterator; } - /// Compare two iterators for inequality - /// @param other The other iterator to compare to - bool operator!=(const TransformRangeIterator& other) const { - return m_iterator != other.m_iterator; - } - private: iterator_t m_iterator; }; diff --git a/Core/include/Acts/Utilities/TypeList.hpp b/Core/include/Acts/Utilities/TypeList.hpp index 020aba4ed46..fc28ece94a0 100644 --- a/Core/include/Acts/Utilities/TypeList.hpp +++ b/Core/include/Acts/Utilities/TypeList.hpp @@ -31,7 +31,7 @@ struct getSize> : std::integral_constant {}; template -constexpr inline std::size_t size{getSize()}; +constexpr std::size_t size{getSize()}; /// @} /// Access the first type diff --git a/Core/include/Acts/Utilities/detail/grid_helper.hpp b/Core/include/Acts/Utilities/detail/grid_helper.hpp index 10e2db679d9..e39c556f29f 100644 --- a/Core/include/Acts/Utilities/detail/grid_helper.hpp +++ b/Core/include/Acts/Utilities/detail/grid_helper.hpp @@ -95,8 +95,6 @@ class GlobalNeighborHoodIndices { return *this; } - bool operator!=(const iterator& it) { return !(*this == it); } - bool isEqual(const iterator& b) const { if (b.m_parent == nullptr) { return m_localIndicesIter[0] == m_parent->m_localIndices[0].end(); diff --git a/Core/include/Acts/Vertexing/TrackAtVertex.hpp b/Core/include/Acts/Vertexing/TrackAtVertex.hpp index 7072ab422d0..9d702b807a9 100644 --- a/Core/include/Acts/Vertexing/TrackAtVertex.hpp +++ b/Core/include/Acts/Vertexing/TrackAtVertex.hpp @@ -38,6 +38,8 @@ struct InputTrack { return m_ptr == other; } + bool operator<(const InputTrack& other) const { return m_ptr < other.m_ptr; } + template const T* as() const { using ptr_t = const T*; @@ -52,10 +54,6 @@ struct InputTrack { return os; } - friend bool operator<(const InputTrack& lhs, const InputTrack& rhs) { - return lhs.m_ptr < rhs.m_ptr; - } - friend struct std::hash; static BoundTrackParameters extractParameters(const InputTrack& track) { diff --git a/Core/src/Definitions/ParticleData.cpp b/Core/src/Definitions/ParticleData.cpp index 7254dd11dfe..97ae6e48eca 100644 --- a/Core/src/Definitions/ParticleData.cpp +++ b/Core/src/Definitions/ParticleData.cpp @@ -51,12 +51,12 @@ static inline auto findByPdg(std::int32_t pdg, const ColumnContainer& column) return column[*index]; } -static constexpr inline float extractCharge(float value) { +static constexpr float extractCharge(float value) { // convert three charge to regular charge in native units return (value / 3.0f) * Acts::UnitConstants::e; } -static constexpr inline float extractMass(float value) { +static constexpr float extractMass(float value) { return value * Acts::UnitConstants::MeV; } diff --git a/Core/src/Geometry/Volume.cpp b/Core/src/Geometry/Volume.cpp index fd521e11a58..3701abc837b 100644 --- a/Core/src/Geometry/Volume.cpp +++ b/Core/src/Geometry/Volume.cpp @@ -127,10 +127,6 @@ bool Volume::operator==(const Volume& other) const { (*m_volumeBounds == *other.m_volumeBounds); } -bool Volume::operator!=(const Volume& other) const { - return !(*this == other); -} - void Volume::visualize(IVisualization3D& helper, const GeometryContext& gctx, const ViewConfig& viewConfig) const { auto bSurfaces = volumeBounds().orientedSurfaces(transform()); diff --git a/Core/src/Surfaces/Surface.cpp b/Core/src/Surfaces/Surface.cpp index 8cb1c8a7b19..79fdc9d9463 100644 --- a/Core/src/Surfaces/Surface.cpp +++ b/Core/src/Surfaces/Surface.cpp @@ -235,10 +235,6 @@ std::string Acts::Surface::toString(const GeometryContext& gctx) const { return ss.str(); } -bool Acts::Surface::operator!=(const Acts::Surface& sf) const { - return !(operator==(sf)); -} - Acts::Vector3 Acts::Surface::center(const GeometryContext& gctx) const { // fast access via transform matrix (and not translation()) auto tMatrix = transform(gctx).matrix(); diff --git a/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp b/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp index 056b2145270..74c13f9a5dd 100644 --- a/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp +++ b/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp @@ -126,6 +126,8 @@ class TrackFindingAlgorithm final : public IAlgorithm { bool stayOnSeed = false; /// Compute shared hit information bool computeSharedHits = false; + /// Whether to trim the tracks + bool trimTracks = true; // Pixel and strip volume ids to be used for maxPixel/StripHoles cuts std::set pixelVolumes; diff --git a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp index 7d0fbf5753a..81e850d297e 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp @@ -419,6 +419,10 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const { } }); + // trim the track if requested + if (m_cfg.trimTracks) { + Acts::trimTrack(track, true, true, true); + } Acts::calculateTrackQuantities(track); if (m_trackSelector.has_value() && !m_trackSelector->isValidTrack(track)) { diff --git a/Examples/Framework/include/ActsExamples/EventData/IndexSourceLink.hpp b/Examples/Framework/include/ActsExamples/EventData/IndexSourceLink.hpp index aaaac49d78a..75481f504f1 100644 --- a/Examples/Framework/include/ActsExamples/EventData/IndexSourceLink.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/IndexSourceLink.hpp @@ -60,10 +60,6 @@ class IndexSourceLink final { return (lhs.geometryId() == rhs.geometryId()) && (lhs.m_index == rhs.m_index); } - friend bool operator!=(const IndexSourceLink& lhs, - const IndexSourceLink& rhs) { - return !(lhs == rhs); - } }; struct IndexSourceLinkSurfaceAccessor { diff --git a/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp b/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp index 0fbc6c95cc6..fc3aacc84e7 100644 --- a/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp @@ -160,10 +160,6 @@ class MeasurementContainer { return m_index == other.m_index; } - bool operator!=(const IteratorImpl& other) const { - return !(*this == other); - } - private: Container& m_container; Index m_index; diff --git a/Examples/Framework/include/ActsExamples/EventData/SimVertex.hpp b/Examples/Framework/include/ActsExamples/EventData/SimVertex.hpp index 761c19ead93..3936b28f5ba 100644 --- a/Examples/Framework/include/ActsExamples/EventData/SimVertex.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/SimVertex.hpp @@ -63,19 +63,18 @@ class SimVertexBarcode { friend constexpr bool operator<(SimVertexBarcode lhs, SimVertexBarcode rhs) { return lhs.m_id < rhs.m_id; } + friend constexpr bool operator==(SimVertexBarcode lhs, SimVertexBarcode rhs) { return lhs.m_id == rhs.m_id; } - friend constexpr bool operator!=(SimVertexBarcode lhs, SimVertexBarcode rhs) { - return lhs.m_id != rhs.m_id; - } + friend inline std::ostream& operator<<(std::ostream& os, SimVertexBarcode idx) { return os << idx.m_id; } }; -/// A simultated vertex e.g. from a physics process. +/// A simulated vertex e.g. from a physics process. struct SimVertex { using Scalar = Acts::ActsScalar; using Vector4 = Acts::ActsVector<4>; diff --git a/Examples/Framework/include/ActsExamples/Utilities/GroupBy.hpp b/Examples/Framework/include/ActsExamples/Utilities/GroupBy.hpp index ecaed376a3e..d5465c67bd3 100644 --- a/Examples/Framework/include/ActsExamples/Utilities/GroupBy.hpp +++ b/Examples/Framework/include/ActsExamples/Utilities/GroupBy.hpp @@ -92,10 +92,6 @@ class GroupBy { const GroupEndIterator& rhs) { return lhs.m_groupBegin == rhs; } - friend constexpr bool operator!=(const GroupIterator& lhs, - const GroupEndIterator& rhs) { - return !(lhs == rhs); - } }; /// Construct the group-by proxy for an iterator range. @@ -119,7 +115,7 @@ class GroupBy { /// complexity in the group size. It does not assume any ordering of the /// underlying container and is a cache-friendly access pattern. constexpr Iterator findEndOfGroup(Iterator start) const { - // check for end so we can safely dereference the start iterator. + // check for end that we can safely dereference the start iterator. if (start == m_end) { return start; } diff --git a/Examples/Python/python/acts/examples/reconstruction.py b/Examples/Python/python/acts/examples/reconstruction.py index 11300d14d5d..e47b435e72b 100644 --- a/Examples/Python/python/acts/examples/reconstruction.py +++ b/Examples/Python/python/acts/examples/reconstruction.py @@ -146,8 +146,9 @@ "stripVolumes", "maxPixelHoles", "maxStripHoles", + "trimTracks", ], - defaults=[15.0, 25.0, 10, None, None, None, None, None, None, None], + defaults=[15.0, 25.0, 10, None, None, None, None, None, None, None, None], ) AmbiguityResolutionConfig = namedtuple( @@ -1534,6 +1535,7 @@ def addCKFTracks( stripVolumes=ckfConfig.stripVolumes, maxPixelHoles=ckfConfig.maxPixelHoles, maxStripHoles=ckfConfig.maxStripHoles, + trimTracks=ckfConfig.trimTracks, ), ) s.addAlgorithm(trackFinder) diff --git a/Examples/Python/src/TrackFinding.cpp b/Examples/Python/src/TrackFinding.cpp index bae0eb7f80a..1473ded385b 100644 --- a/Examples/Python/src/TrackFinding.cpp +++ b/Examples/Python/src/TrackFinding.cpp @@ -341,6 +341,7 @@ void addTrackFinding(Context& ctx) { ACTS_PYTHON_MEMBER(stripVolumes); ACTS_PYTHON_MEMBER(maxPixelHoles); ACTS_PYTHON_MEMBER(maxStripHoles); + ACTS_PYTHON_MEMBER(trimTracks); ACTS_PYTHON_STRUCT_END(); } diff --git a/Examples/Python/tests/root_file_hashes.txt b/Examples/Python/tests/root_file_hashes.txt index 54ffad36b9d..7d86645f683 100644 --- a/Examples/Python/tests/root_file_hashes.txt +++ b/Examples/Python/tests/root_file_hashes.txt @@ -41,11 +41,11 @@ test_ckf_tracks_example[generic-truth_estimated]__tracksummary_ckf.root: 5a973ec test_ckf_tracks_example[generic-truth_estimated]__performance_seeding.root: 1facb05c066221f6361b61f015cdf0918e94d9f3fce2269ec7b6a4dffeb2bc7e test_ckf_tracks_example[generic-truth_smeared]__trackstates_ckf.root: b10f61d3b68ecc3d1910a17aeadd01a1e23b31b6418935809d1f12e95eac607a test_ckf_tracks_example[generic-truth_smeared]__tracksummary_ckf.root: 69733ede1fc08370b5c0d0535f274b59bb51217239bd6645ff62ec9dadaa1f41 -test_ckf_tracks_example[odd-full_seeding]__trackstates_ckf.root: 6b9b97545e9c4c833547adcd54c78235165e7e184d52548ecb5f16c421f41b37 -test_ckf_tracks_example[odd-full_seeding]__tracksummary_ckf.root: 5144c31f9f5281f1c287de978035c2584e9c7b1d46aece6afaecd5c1c86b0020 +test_ckf_tracks_example[odd-full_seeding]__trackstates_ckf.root: 33a68b20005a92b88bf7d01179a4b4fe3c1476a2019176904356924c0ad68f4b +test_ckf_tracks_example[odd-full_seeding]__tracksummary_ckf.root: 749a53533fed3d550c2e37f504bac5a8ab5c5cdf60d5055dcd545aa44613601a test_ckf_tracks_example[odd-full_seeding]__performance_seeding_trees.root: 43c58577aafe07645e5660c4f43904efadf91d8cda45c5c04c248bbe0f59814f test_ckf_tracks_example[odd-truth_estimated]__trackstates_ckf.root: 7750f58b970c79dc3c937482e2a6e4576bc5d495fd6e4576d63ac2882d8283d4 -test_ckf_tracks_example[odd-truth_estimated]__tracksummary_ckf.root: 3754817f9cf0972b92147e80bf36b2dc79a9c96e161b236a483a2104d2e33cd6 +test_ckf_tracks_example[odd-truth_estimated]__tracksummary_ckf.root: f5d5d5521e367dd2e26365b896b079279a5a8b97b7e11d38eb0eb317740ad4dd test_ckf_tracks_example[odd-truth_estimated]__performance_seeding.root: 1a36b7017e59f1c08602ef3c2cb0483c51df248f112e3780c66594110719c575 test_ckf_tracks_example[odd-truth_smeared]__trackstates_ckf.root: 33398059bf968f7279d4cc706f3b914fcf6f010ae82c43df8875785bda6f7cbe test_ckf_tracks_example[odd-truth_smeared]__tracksummary_ckf.root: 3d01335a51fb03c78a174c8b11d473b38ba9c4ed3d6cba201b3925f463411708 diff --git a/Fatras/include/ActsFatras/Utilities/LandauDistribution.hpp b/Fatras/include/ActsFatras/Utilities/LandauDistribution.hpp index 1baa37e1625..837fa7e94f4 100644 --- a/Fatras/include/ActsFatras/Utilities/LandauDistribution.hpp +++ b/Fatras/include/ActsFatras/Utilities/LandauDistribution.hpp @@ -33,7 +33,7 @@ class LandauDistribution { /// Construct from parameters. param_type(double location_, double scale_) : location(location_), scale(scale_) {} - // Explicitlely defaulted construction and assignment + // Explicitly defaulted construction and assignment param_type() = default; param_type(const param_type &) = default; param_type(param_type &&) = default; @@ -44,9 +44,6 @@ class LandauDistribution { friend bool operator==(const param_type &lhs, const param_type &rhs) { return (lhs.location == rhs.location) && (lhs.scale == rhs.scale); } - friend bool operator!=(const param_type &lhs, const param_type &rhs) { - return !(lhs == rhs); - } }; /// The type of the generated values. using result_type = double; @@ -91,10 +88,6 @@ class LandauDistribution { const LandauDistribution &rhs) { return lhs.m_cfg == rhs.m_cfg; } - friend bool operator!=(const LandauDistribution &lhs, - const LandauDistribution &rhs) { - return !(lhs == rhs); - } private: param_type m_cfg; diff --git a/Plugins/ExaTrkX/include/Acts/Plugins/ExaTrkX/detail/CantorEdge.hpp b/Plugins/ExaTrkX/include/Acts/Plugins/ExaTrkX/detail/CantorEdge.hpp index 05a029ab550..0543d564dda 100644 --- a/Plugins/ExaTrkX/include/Acts/Plugins/ExaTrkX/detail/CantorEdge.hpp +++ b/Plugins/ExaTrkX/include/Acts/Plugins/ExaTrkX/detail/CantorEdge.hpp @@ -41,16 +41,8 @@ class CantorEdge { } T value() const { return m_value; } -}; - -template -bool operator==(const CantorEdge &a, const CantorEdge &b) { - return a.value() == b.value(); -} -template -bool operator<(const CantorEdge &a, const CantorEdge &b) { - return a.value() < b.value(); -} + auto operator<=>(const CantorEdge& other) const = default; +}; } // namespace Acts::detail diff --git a/Tests/Benchmarks/SourceLinkBenchmark.cpp b/Tests/Benchmarks/SourceLinkBenchmark.cpp index acfb27bc138..ad7849302a1 100644 --- a/Tests/Benchmarks/SourceLinkBenchmark.cpp +++ b/Tests/Benchmarks/SourceLinkBenchmark.cpp @@ -43,10 +43,6 @@ class BenchmarkSourceLink final { return (lhs.geometryId() == rhs.geometryId()) && (lhs.m_index == rhs.m_index); } - friend bool operator!=(const BenchmarkSourceLink& lhs, - const BenchmarkSourceLink& rhs) { - return !(lhs == rhs); - } }; int main(int /*argc*/, char** /*argv[]*/) { diff --git a/Tests/UnitTests/Core/Propagator/BoundToCurvilinearConversionTests.cpp b/Tests/UnitTests/Core/Propagator/BoundToCurvilinearConversionTests.cpp index 3ab839d96b1..c8be9f1e57e 100644 --- a/Tests/UnitTests/Core/Propagator/BoundToCurvilinearConversionTests.cpp +++ b/Tests/UnitTests/Core/Propagator/BoundToCurvilinearConversionTests.cpp @@ -91,7 +91,7 @@ FreeToPathMatrix computeFreeToPathDerivatives( return path_length_deriv; } template -inline constexpr Eigen::Matrix makeMatrix( +constexpr Eigen::Matrix makeMatrix( std::initializer_list elements) { // static_assert( elements.size() == Rows*Cols ) if (!(elements.size() == Rows * Cols)) { @@ -110,7 +110,7 @@ inline constexpr Eigen::Matrix makeMatrix( return matrix; } template -inline constexpr Eigen::Matrix makeVector( +constexpr Eigen::Matrix makeVector( std::initializer_list elements) { return makeMatrix(elements); } diff --git a/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp b/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp index 800f8d88ac7..cc2c208bc13 100644 --- a/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp +++ b/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp @@ -134,8 +134,6 @@ struct TestContainerAccessor { return m_iterator == other.m_iterator; } - bool operator!=(const Iterator& other) const { return !(*this == other); } - Acts::SourceLink operator*() const { const auto& sl = m_iterator->second; return Acts::SourceLink{sl}; diff --git a/Tests/UnitTests/Core/Utilities/TrackHelpersTests.cpp b/Tests/UnitTests/Core/Utilities/TrackHelpersTests.cpp index fcba710499c..ba6580b05f8 100644 --- a/Tests/UnitTests/Core/Utilities/TrackHelpersTests.cpp +++ b/Tests/UnitTests/Core/Utilities/TrackHelpersTests.cpp @@ -9,49 +9,101 @@ #include #include "Acts/EventData/TrackContainer.hpp" +#include "Acts/EventData/TrackStateType.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" #include "Acts/EventData/VectorTrackContainer.hpp" #include "Acts/Utilities/TrackHelpers.hpp" +#include +#include + namespace Acts::Test { +namespace { + +template +auto createTestTrack(TrackContainer& tc, const FlagsPerState& flagsPerState) { + auto t = tc.makeTrack(); + + for (const auto& flags : flagsPerState) { + auto ts = t.appendTrackState(); + for (auto f : flags) { + ts.typeFlags().set(f); + } + } + + return t; +} + +} // namespace + BOOST_AUTO_TEST_SUITE(Utilities) BOOST_AUTO_TEST_CASE(CalculateQuantities) { TrackContainer tc{VectorTrackContainer{}, VectorMultiTrajectory{}}; - auto t = tc.makeTrack(); + auto t = createTestTrack(tc, std::vector>{ + {MeasurementFlag}, + {OutlierFlag}, + {MeasurementFlag, SharedHitFlag}, + {HoleFlag}, + {OutlierFlag}, + {HoleFlag}, + {MeasurementFlag, SharedHitFlag}, + {OutlierFlag}, + }); + + calculateTrackQuantities(t); - auto ts = t.appendTrackState(); - ts.typeFlags().set(MeasurementFlag); + BOOST_CHECK_EQUAL(t.nHoles(), 2); + BOOST_CHECK_EQUAL(t.nMeasurements(), 3); + BOOST_CHECK_EQUAL(t.nOutliers(), 3); + BOOST_CHECK_EQUAL(t.nSharedHits(), 2); +} - ts = t.appendTrackState(); - ts.typeFlags().set(OutlierFlag); +BOOST_AUTO_TEST_CASE(TrimTrack) { + TrackContainer tc{VectorTrackContainer{}, VectorMultiTrajectory{}}; + auto t = createTestTrack(tc, std::vector>{ + {HoleFlag}, + {MeasurementFlag}, + {OutlierFlag}, + {MeasurementFlag, SharedHitFlag}, + {HoleFlag}, + {OutlierFlag}, + {HoleFlag}, + {MeasurementFlag}, + {OutlierFlag}, + }); - ts = t.appendTrackState(); - ts.typeFlags().set(MeasurementFlag); - ts.typeFlags().set(SharedHitFlag); + calculateTrackQuantities(t); - ts = t.appendTrackState(); - ts.typeFlags().set(HoleFlag); + BOOST_CHECK_EQUAL(t.nHoles(), 3); + BOOST_CHECK_EQUAL(t.nMeasurements(), 3); + BOOST_CHECK_EQUAL(t.nOutliers(), 3); + BOOST_CHECK_EQUAL(t.nSharedHits(), 1); - ts = t.appendTrackState(); - ts.typeFlags().set(OutlierFlag); + trimTrackFront(t, true, true, true); + calculateTrackQuantities(t); - ts = t.appendTrackState(); - ts.typeFlags().set(HoleFlag); + BOOST_CHECK_EQUAL(t.nHoles(), 2); + BOOST_CHECK_EQUAL(t.nMeasurements(), 3); + BOOST_CHECK_EQUAL(t.nOutliers(), 3); + BOOST_CHECK_EQUAL(t.nSharedHits(), 1); - ts = t.appendTrackState(); - ts.typeFlags().set(MeasurementFlag); - ts.typeFlags().set(SharedHitFlag); + trimTrackBack(t, true, true, true); + calculateTrackQuantities(t); - ts = t.appendTrackState(); - ts.typeFlags().set(OutlierFlag); + BOOST_CHECK_EQUAL(t.nHoles(), 2); + BOOST_CHECK_EQUAL(t.nMeasurements(), 3); + BOOST_CHECK_EQUAL(t.nOutliers(), 2); + BOOST_CHECK_EQUAL(t.nSharedHits(), 1); + trimTrack(t, true, true, true); calculateTrackQuantities(t); + BOOST_CHECK_EQUAL(t.nHoles(), 2); BOOST_CHECK_EQUAL(t.nMeasurements(), 3); - BOOST_CHECK_EQUAL(t.nOutliers(), 3); - BOOST_CHECK_EQUAL(t.nSharedHits(), 2); + BOOST_CHECK_EQUAL(t.nOutliers(), 2); + BOOST_CHECK_EQUAL(t.nSharedHits(), 1); } BOOST_AUTO_TEST_SUITE_END()