From 9d980d9e936f3f7894c7bbab0fa29ca0c1c7a028 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Thu, 8 Aug 2024 11:25:44 +0200 Subject: [PATCH 1/2] bump clang-format to v18.1.8 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b9b73432170..908c2c8e2aa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/mirrors-clang-format - rev: 'v14.0.0' + rev: 'v18.1.8' hooks: - id: clang-format types_or: [file] From 50000064cb355da96d6b63f441b38059b7bc9623 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Thu, 8 Aug 2024 11:26:21 +0200 Subject: [PATCH 2/2] reformat with clang-format 18 --- .../Detector/DetectorVolumeVisitorConcept.hpp | 4 +- Core/include/Acts/EventData/ChargeConcept.hpp | 2 +- .../Acts/EventData/MultiTrajectory.hpp | 104 +++++--- .../MultiTrajectoryBackendConcept.hpp | 124 ++++----- Core/include/Acts/EventData/ProxyAccessor.hpp | 4 +- .../include/Acts/EventData/TrackContainer.hpp | 112 ++++---- .../TrackContainerBackendConcept.hpp | 74 +++--- Core/include/Acts/EventData/TrackProxy.hpp | 163 +++++++----- .../Acts/EventData/TrackStateProxy.hpp | 120 ++++++--- .../Acts/EventData/TrackStateProxyConcept.hpp | 245 +++++++++--------- .../Acts/EventData/VectorMultiTrajectory.hpp | 8 +- .../Geometry/TrackingVolumeVisitorConcept.hpp | 2 +- Core/include/Acts/Propagator/EigenStepper.ipp | 5 +- .../Acts/Propagator/MaterialInteractor.hpp | 8 +- .../Acts/Propagator/MultiEigenStepperLoop.ipp | 5 +- Core/include/Acts/Propagator/Propagator.ipp | 25 +- .../Acts/Propagator/StandardAborters.hpp | 4 +- Core/include/Acts/Seeding/SeedFinderGbts.ipp | 12 +- .../Acts/Seeding/detail/UtilityFunctions.hpp | 23 +- Core/include/Acts/Surfaces/SurfaceConcept.hpp | 46 ++-- .../Acts/Surfaces/SurfaceVisitorConcept.hpp | 4 +- .../TrackFitting/GlobalChiSquareFitter.hpp | 4 +- .../Acts/TrackFitting/KalmanFitter.hpp | 8 +- Core/include/Acts/Utilities/Any.hpp | 16 +- Core/include/Acts/Utilities/AxisFwd.hpp | 10 +- Core/include/Acts/Utilities/Delegate.hpp | 2 +- Core/include/Acts/Utilities/GridIterator.hpp | 4 +- Core/include/Acts/Utilities/KDTree.hpp | 5 +- .../Utilities/detail/MPL/type_collector.hpp | 5 +- .../Acts/Vertexing/SingleSeedVertexFinder.ipp | 16 +- Core/src/EventData/VectorMultiTrajectory.cpp | 5 +- Core/src/Geometry/LayerCreator.cpp | 5 +- .../Vertexing/AdaptiveMultiVertexFitter.cpp | 4 +- .../Digitization/src/ModuleClusters.cpp | 2 +- .../ActsExamples/Geant4/Geant4Manager.hpp | 4 +- .../TrackFinding/src/GbtsSeedingAlgorithm.cpp | 18 +- .../Framework/src/Framework/Sequencer.cpp | 7 +- Examples/Io/Root/src/RootBFieldWriter.cpp | 6 +- .../include/Acts/Plugins/Python/Utilities.hpp | 5 +- Examples/Python/src/Generators.cpp | 13 +- Examples/Python/src/Json.cpp | 23 +- Examples/Python/src/TrackFinding.cpp | 29 ++- Plugins/FpeMonitoring/src/FpeMonitor.cpp | 14 +- .../Acts/Plugins/Onnx/SeedClassifier.hpp | 2 +- .../Tests/CommonHelpers/LineSurfaceStub.hpp | 15 +- .../CuboidalDetectorFromBlueprintTests.cpp | 2 +- .../Material/VolumeMaterialMapperTests.cpp | 4 +- .../Core/Surfaces/SurfaceBoundsTests.cpp | 8 +- .../Core/TrackFitting/FitterTestsCommon.hpp | 2 +- .../TrackFitting/GainMatrixUpdaterTests.cpp | 6 +- .../TrackFitting/GsfComponentMergingTests.cpp | 4 +- .../Core/Utilities/AlgebraHelpersTests.cpp | 26 +- .../Json/MaterialMapJsonConverterTests.cpp | 4 +- 53 files changed, 744 insertions(+), 628 deletions(-) diff --git a/Core/include/Acts/Detector/DetectorVolumeVisitorConcept.hpp b/Core/include/Acts/Detector/DetectorVolumeVisitorConcept.hpp index 6a27c2c5a8a..95998fdb716 100644 --- a/Core/include/Acts/Detector/DetectorVolumeVisitorConcept.hpp +++ b/Core/include/Acts/Detector/DetectorVolumeVisitorConcept.hpp @@ -18,12 +18,12 @@ class DetectorVolume; template concept DetectorVolumeVisitor = requires(T v) { - {v(std::declval())}; + { v(std::declval()) }; }; template concept MutableDetectorVolumeVisitor = requires(T v) { - {v(std::declval())}; + { v(std::declval()) }; }; } // namespace Acts diff --git a/Core/include/Acts/EventData/ChargeConcept.hpp b/Core/include/Acts/EventData/ChargeConcept.hpp index cd8122be028..4b0540ac407 100644 --- a/Core/include/Acts/EventData/ChargeConcept.hpp +++ b/Core/include/Acts/EventData/ChargeConcept.hpp @@ -21,7 +21,7 @@ namespace Acts { template concept ChargeConcept = requires(C c, C c2, float f, double d) { - {C{f}}; + { C{f} }; { c == c2 } -> std::same_as; { c != c2 } -> std::same_as; diff --git a/Core/include/Acts/EventData/MultiTrajectory.hpp b/Core/include/Acts/EventData/MultiTrajectory.hpp index 00eea920dcc..d5766844403 100644 --- a/Core/include/Acts/EventData/MultiTrajectory.hpp +++ b/Core/include/Acts/EventData/MultiTrajectory.hpp @@ -226,7 +226,9 @@ class MultiTrajectory { /// @note Only available if the MultiTrajectory is not read-only /// @param istate The index to access /// @return Read-write proxy to the stored track state - TrackStateProxy getTrackState(IndexType istate) requires(!ReadOnly) { + TrackStateProxy getTrackState(IndexType istate) + requires(!ReadOnly) + { return {*this, istate}; } @@ -238,7 +240,9 @@ class MultiTrajectory { /// @param iprevious index of the previous state, kInvalid if first /// @return Index of the newly added track state IndexType addTrackState(TrackStatePropMask mask = TrackStatePropMask::All, - IndexType iprevious = kInvalid) requires(!ReadOnly) { + IndexType iprevious = kInvalid) + requires(!ReadOnly) + { return self().addTrackState_impl(mask, iprevious); } @@ -248,7 +252,9 @@ class MultiTrajectory { /// @return a track state proxy to the newly added track state TrackStateProxy makeTrackState( TrackStatePropMask mask = TrackStatePropMask::All, - IndexType iprevious = kInvalid) requires(!ReadOnly) { + IndexType iprevious = kInvalid) + requires(!ReadOnly) + { return getTrackState(addTrackState(mask, iprevious)); } @@ -274,7 +280,9 @@ class MultiTrajectory { /// points, this can have an impact on the other components. /// @note Only available if the MultiTrajectory is not read-only template - void applyBackwards(IndexType iendpoint, F&& callable) requires(!ReadOnly) { + void applyBackwards(IndexType iendpoint, F&& callable) + requires(!ReadOnly) + { static_assert(detail_lt::VisitorConcept, "Callable needs to satisfy VisitorConcept"); @@ -324,7 +332,9 @@ class MultiTrajectory { /// @param iendpoint Trajectory entry point to start from /// @return Iterator pair to iterate over /// @note Mutable version - auto reverseTrackStateRange(IndexType iendpoint) requires(!ReadOnly) { + auto reverseTrackStateRange(IndexType iendpoint) + requires(!ReadOnly) + { using range_t = detail_lt::TrackStateRange; if (iendpoint == kInvalid) { @@ -356,7 +366,9 @@ class MultiTrajectory { /// @param istartpoint Trajectory state index for the innermost track /// state to start from /// @return Iterator pair to iterate over - auto forwardTrackStateRange(IndexType istartpoint) requires(!ReadOnly) { + auto forwardTrackStateRange(IndexType istartpoint) + requires(!ReadOnly) + { using range_t = detail_lt::TrackStateRange; if (istartpoint == kInvalid) { @@ -382,7 +394,9 @@ class MultiTrajectory { /// compatibility with backends. /// @note Only available if the MultiTrajectory is not read-only template - void addColumn(std::string_view key) requires(!ReadOnly) { + void addColumn(std::string_view key) + requires(!ReadOnly) + { self().template addColumn_impl(key); } @@ -395,7 +409,11 @@ class MultiTrajectory { /// Clear the @c MultiTrajectory. Leaves the underlying storage untouched /// @note Only available if the MultiTrajectory is not read-only - void clear() requires(!ReadOnly) { self().clear_impl(); } + void clear() + requires(!ReadOnly) + { + self().clear_impl(); + } /// Returns the number of track states contained /// @return The number of track states @@ -424,8 +442,9 @@ class MultiTrajectory { /// Retrieve a parameter proxy instance for parameters at a given index /// @param parIdx Index into the parameter column /// @return Mutable proxy - typename TrackStateProxy::Parameters parameters(IndexType parIdx) requires( - !ReadOnly) { + typename TrackStateProxy::Parameters parameters(IndexType parIdx) + requires(!ReadOnly) + { return self().parameters_impl(parIdx); } @@ -439,8 +458,9 @@ class MultiTrajectory { /// Retrieve a covariance proxy instance for a covariance at a given index /// @param covIdx Index into the covariance column /// @return Mutable proxy - typename TrackStateProxy::Covariance covariance(IndexType covIdx) requires( - !ReadOnly) { + typename TrackStateProxy::Covariance covariance(IndexType covIdx) + requires(!ReadOnly) + { return self().covariance_impl(covIdx); } @@ -454,8 +474,9 @@ class MultiTrajectory { /// Retrieve a jacobian proxy instance for a jacobian at a given index /// @param istate The track state /// @return Mutable proxy - typename TrackStateProxy::Covariance jacobian(IndexType istate) requires( - !ReadOnly) { + typename TrackStateProxy::Covariance jacobian(IndexType istate) + requires(!ReadOnly) + { return self().jacobian_impl(istate); } @@ -473,7 +494,9 @@ class MultiTrajectory { /// @return Mutable proxy template typename TrackStateProxy::template Calibrated calibrated( - IndexType istate) requires(!ReadOnly) { + IndexType istate) + requires(!ReadOnly) + { return self().template calibrated_impl(istate); } @@ -495,7 +518,9 @@ class MultiTrajectory { /// @return Mutable proxy template typename TrackStateProxy::template CalibratedCovariance - calibratedCovariance(IndexType istate) requires(!ReadOnly) { + calibratedCovariance(IndexType istate) + requires(!ReadOnly) + { return self().template calibratedCovariance_impl(istate); } @@ -504,7 +529,9 @@ class MultiTrajectory { /// @param istate The track state /// @return Mutable proxy typename TrackStateProxy::EffectiveCalibrated effectiveCalibrated( - IndexType istate) requires(!ReadOnly) { + IndexType istate) + requires(!ReadOnly) + { // This abuses an incorrectly sized vector / matrix to access the // data pointer! This works (don't use the matrix as is!), but be // careful! @@ -530,7 +557,9 @@ class MultiTrajectory { /// @param istate The track state /// @return Mutable proxy typename TrackStateProxy::EffectiveCalibratedCovariance - effectiveCalibratedCovariance(IndexType istate) requires(!ReadOnly) { + effectiveCalibratedCovariance(IndexType istate) + requires(!ReadOnly) + { // This abuses an incorrectly sized vector / matrix to access the // data pointer! This works (don't use the matrix as is!), but be // careful! @@ -581,15 +610,18 @@ class MultiTrajectory { /// @note The track states both need to be stored in the /// same @c MultiTrajectory instance void shareFrom(IndexType iself, IndexType iother, - TrackStatePropMask shareSource, - TrackStatePropMask shareTarget) requires(!ReadOnly) { + TrackStatePropMask shareSource, TrackStatePropMask shareTarget) + requires(!ReadOnly) + { self().shareFrom_impl(iself, iother, shareSource, shareTarget); } /// Unset an optional track state component /// @param target The component to unset /// @param istate The track state index to operate on - void unset(TrackStatePropMask target, IndexType istate) requires(!ReadOnly) { + void unset(TrackStatePropMask target, IndexType istate) + requires(!ReadOnly) + { self().unset_impl(target, istate); } @@ -597,8 +629,9 @@ class MultiTrajectory { /// @note Only available if the track state container is not read-only /// @param istate The track state index to alter /// @param mask The bitmask that instructs which components to allocate - void addTrackStateComponents(IndexType istate, - TrackStatePropMask mask) requires(!ReadOnly) { + void addTrackStateComponents(IndexType istate, TrackStatePropMask mask) + requires(!ReadOnly) + { self().addTrackStateComponents_impl(istate, mask); } @@ -608,7 +641,9 @@ class MultiTrajectory { /// @param istate The track state index to operate on /// @return Mutable reference to the component given by @p key template - T& component(IndexType istate) requires(!ReadOnly) { + T& component(IndexType istate) + requires(!ReadOnly) + { assert(checkOptional(key, istate)); return *std::any_cast(self().component_impl(key, istate)); } @@ -619,7 +654,9 @@ class MultiTrajectory { /// @param istate The track state index to operate on /// @return Mutable reference to the component given by @p key template - T& component(HashedString key, IndexType istate) requires(!ReadOnly) { + T& component(HashedString key, IndexType istate) + requires(!ReadOnly) + { assert(checkOptional(key, istate)); return *std::any_cast(self().component_impl(key, istate)); } @@ -660,8 +697,9 @@ class MultiTrajectory { // This function will move to an rvalue reference in the next major version template - void setUncalibratedSourceLink( - IndexType istate, source_link_t&& sourceLink) requires(!ReadOnly) { + void setUncalibratedSourceLink(IndexType istate, source_link_t&& sourceLink) + requires(!ReadOnly) + { self().setUncalibratedSourceLink_impl( istate, std::forward(sourceLink)); } @@ -674,16 +712,18 @@ class MultiTrajectory { return self().referenceSurface_impl(istate); } - void setReferenceSurface( - IndexType istate, - std::shared_ptr surface) requires(!ReadOnly) { + void setReferenceSurface(IndexType istate, + std::shared_ptr surface) + requires(!ReadOnly) + { self().setReferenceSurface_impl(istate, std::move(surface)); } private: template - void copyDynamicFrom(IndexType dstIdx, const T& src, - IndexType srcIdx) requires(!ReadOnly) { + void copyDynamicFrom(IndexType dstIdx, const T& src, IndexType srcIdx) + requires(!ReadOnly) + { const auto& dynamicKeys = src.self().dynamicKeys_impl(); for (const auto key : dynamicKeys) { std::any srcPtr = src.self().component_impl(key, srcIdx); diff --git a/Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp b/Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp index a3c068b7269..7898a336754 100644 --- a/Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp +++ b/Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp @@ -30,8 +30,8 @@ using ConstCovariance = Eigen::Map; template concept RangeLike = requires(R r) { - {r.begin()}; - {r.end()}; + { r.begin() }; + { r.end() }; requires std::forward_iterator; requires std::forward_iterator; @@ -40,101 +40,103 @@ concept RangeLike = requires(R r) { } // namespace detail template -concept CommonMultiTrajectoryBackend = requires(const T& cv, HashedString key, - TrackIndexType istate) { - { cv.calibratedSize_impl(istate) } -> std::same_as; +concept CommonMultiTrajectoryBackend = + requires(const T& cv, HashedString key, TrackIndexType istate) { + { cv.calibratedSize_impl(istate) } -> std::same_as; - { cv.getUncalibratedSourceLink_impl(istate) } -> std::same_as; + { cv.getUncalibratedSourceLink_impl(istate) } -> std::same_as; - { cv.referenceSurface_impl(istate) } -> std::same_as; + { cv.referenceSurface_impl(istate) } -> std::same_as; - { cv.parameters_impl(istate) } -> std::same_as; + { cv.parameters_impl(istate) } -> std::same_as; - { cv.covariance_impl(istate) } -> std::same_as; + { cv.covariance_impl(istate) } -> std::same_as; - { cv.jacobian_impl(istate) } -> std::same_as; + { cv.jacobian_impl(istate) } -> std::same_as; - { - cv.template calibrated_impl<2>(istate) - } -> std::same_as>>; + { + cv.template calibrated_impl<2>(istate) + } -> std::same_as>>; - { - cv.template calibratedCovariance_impl<2>(istate) - } -> std::same_as>>; + { + cv.template calibratedCovariance_impl<2>(istate) + } -> std::same_as>>; - { cv.has_impl(key, istate) } -> std::same_as; + { cv.has_impl(key, istate) } -> std::same_as; - { cv.size_impl() } -> std::same_as; + { cv.size_impl() } -> std::same_as; - { cv.component_impl(key, istate) } -> std::same_as; + { cv.component_impl(key, istate) } -> std::same_as; - { cv.hasColumn_impl(key) } -> std::same_as; + { cv.hasColumn_impl(key) } -> std::same_as; - {cv.dynamicKeys_impl()}; - requires detail::RangeLike; -}; + { cv.dynamicKeys_impl() }; + requires detail::RangeLike; + }; template -concept ConstMultiTrajectoryBackend = CommonMultiTrajectoryBackend && +concept ConstMultiTrajectoryBackend = + CommonMultiTrajectoryBackend && requires(T v, HashedString key, TrackIndexType istate) { - { v.parameters_impl(istate) } -> std::same_as; + { v.parameters_impl(istate) } -> std::same_as; - { v.covariance_impl(istate) } -> std::same_as; + { v.covariance_impl(istate) } -> std::same_as; - { v.jacobian_impl(istate) } -> std::same_as; + { v.jacobian_impl(istate) } -> std::same_as; - { - v.template calibrated_impl<2>(istate) - } -> std::same_as>>; + { + v.template calibrated_impl<2>(istate) + } -> std::same_as>>; - { - v.template calibratedCovariance_impl<2>(istate) - } -> std::same_as>>; -}; + { + v.template calibratedCovariance_impl<2>(istate) + } -> std::same_as>>; + }; template -concept MutableMultiTrajectoryBackend = CommonMultiTrajectoryBackend && +concept MutableMultiTrajectoryBackend = + CommonMultiTrajectoryBackend && requires(T v, HashedString key, TrackIndexType istate, TrackStatePropMask mask, std::string col, std::size_t dim, SourceLink sl, std::shared_ptr surface) { - { v.parameters_impl(istate) } -> std::same_as; + { v.parameters_impl(istate) } -> std::same_as; - { v.covariance_impl(istate) } -> std::same_as; + { v.covariance_impl(istate) } -> std::same_as; - { v.jacobian_impl(istate) } -> std::same_as; + { v.jacobian_impl(istate) } -> std::same_as; - { - v.template calibrated_impl<2>(istate) - } -> std::same_as>>; + { + v.template calibrated_impl<2>(istate) + } -> std::same_as>>; - { - v.template calibratedCovariance_impl<2>(istate) - } -> std::same_as>>; + { + v.template calibratedCovariance_impl<2>(istate) + } -> std::same_as>>; - { v.addTrackState_impl() } -> std::same_as; + { v.addTrackState_impl() } -> std::same_as; - {v.shareFrom_impl(istate, istate, mask, mask)}; + { v.shareFrom_impl(istate, istate, mask, mask) }; - {v.unset_impl(mask, istate)}; + { v.unset_impl(mask, istate) }; - {v.clear_impl()}; + { v.clear_impl() }; - // As far as I know there's no good way to assert that there's a generic - // template function - {v.template addColumn_impl(col)}; - {v.template addColumn_impl(col)}; - {v.template addColumn_impl(col)}; - {v.template addColumn_impl(col)}; - {v.template addColumn_impl(col)}; - {v.template addColumn_impl(col)}; + // As far as I know there's no good way to assert that there's a generic + // template function + { v.template addColumn_impl(col) }; + { v.template addColumn_impl(col) }; + { v.template addColumn_impl(col) }; + { v.template addColumn_impl(col) }; + { v.template addColumn_impl(col) }; + { v.template addColumn_impl(col) }; - {v.allocateCalibrated_impl(istate, dim)}; + { v.allocateCalibrated_impl(istate, dim) }; - {v.setUncalibratedSourceLink_impl(istate, std::move(sl))}; + { v.setUncalibratedSourceLink_impl(istate, std::move(sl)) }; - {v.setReferenceSurface_impl(istate, surface)}; + { v.setReferenceSurface_impl(istate, surface) }; - {v.copyDynamicFrom_impl(istate, key, std::declval())}; -}; + { v.copyDynamicFrom_impl(istate, key, std::declval()) }; + }; } // namespace Acts diff --git a/Core/include/Acts/EventData/ProxyAccessor.hpp b/Core/include/Acts/EventData/ProxyAccessor.hpp index 745c3c076b2..6e6ffec53ae 100644 --- a/Core/include/Acts/EventData/ProxyAccessor.hpp +++ b/Core/include/Acts/EventData/ProxyAccessor.hpp @@ -22,7 +22,7 @@ concept MutableProxyType = requires(T t, HashedString key) { { t.template component(key) - } -> std::same_as>; + } -> std::same_as>; }; template @@ -32,7 +32,7 @@ concept ConstProxyType = requires(T t, HashedString key) { }; template -concept ProxyType = (MutableProxyType || ConstProxyType)&&requires { +concept ProxyType = (MutableProxyType || ConstProxyType) && requires { typename T::ConstProxyType; requires ConstProxyType; diff --git a/Core/include/Acts/EventData/TrackContainer.hpp b/Core/include/Acts/EventData/TrackContainer.hpp index d2cf6c24ec2..24702870bdb 100644 --- a/Core/include/Acts/EventData/TrackContainer.hpp +++ b/Core/include/Acts/EventData/TrackContainer.hpp @@ -107,8 +107,8 @@ class TrackContainer { /// You need to ensure suitable lifetime /// @param container the track container backend /// @param traj the track state container backend - TrackContainer(auto& container, auto& traj) requires( - detail::is_same_template::value) + TrackContainer(auto& container, auto& traj) + requires(detail::is_same_template::value) : m_container{&container}, m_traj{&traj} {} /// Constructor from const references to a track container backend and to a @@ -117,9 +117,10 @@ class TrackContainer { /// You need to ensure suitable lifetime /// @param container the track container backend /// @param traj the track state container backend - TrackContainer(const auto& container, const auto& traj) requires( - detail::is_same_template::value&& - ReadOnly&& TrackStateReadOnly) + TrackContainer(const auto& container, const auto& traj) + requires(detail::is_same_template::value && + ReadOnly && TrackStateReadOnly) : m_container{&container}, m_traj{&traj} {} /// @} @@ -135,15 +136,15 @@ class TrackContainer { /// Get a const track proxy for a track index /// @param itrack the track index in the container /// @return A const track proxy for the index - ConstTrackProxy getTrack(IndexType itrack) const { - return {*this, itrack}; - } + ConstTrackProxy getTrack(IndexType itrack) const { return {*this, itrack}; } /// Get a mutable track proxy for a track index /// @note Only available if the track container is not read-only /// @param itrack the track index in the container /// @return A mutable track proxy for the index - TrackProxy getTrack(IndexType itrack) requires(!ReadOnly) { + TrackProxy getTrack(IndexType itrack) + requires(!ReadOnly) + { return {*this, itrack}; } @@ -151,7 +152,9 @@ class TrackContainer { /// allocates memory. You can combine this with @c getTrack to obtain a track proxy /// @note Only available if the track container is not read-only /// @return the index to the newly added track - IndexType addTrack() requires(!ReadOnly) { + IndexType addTrack() + requires(!ReadOnly) + { auto track = getTrack(m_container->addTrack_impl()); track.tipIndex() = kInvalid; return track.index(); @@ -161,7 +164,9 @@ class TrackContainer { /// This effectively calls @c addTrack and @c getTrack /// @note Only available if the track container is not read-only /// @return a track proxy to the newly added track - TrackProxy makeTrack() requires(!ReadOnly) { + TrackProxy makeTrack() + requires(!ReadOnly) + { return getTrack(addTrack()); } @@ -170,14 +175,18 @@ class TrackContainer { /// @note This invalidates track proxies that point to tracks with larger /// indices than @p itrack! /// @param itrack The index of the track to remove - void removeTrack(IndexType itrack) requires(!ReadOnly) { + void removeTrack(IndexType itrack) + requires(!ReadOnly) + { m_container->removeTrack_impl(itrack); } /// Get a mutable iterator to the first track in the container /// @note Only available if the track container is not read-only /// @return a mutable iterator to the first track - auto begin() requires(!ReadOnly) { + auto begin() + requires(!ReadOnly) + { return detail_tc::TrackProxyIterator, TrackProxy, false>{*this, 0}; } @@ -185,7 +194,9 @@ class TrackContainer { /// Get a past-the-end iterator for this container /// @note Only available if the track container is not read-only /// @return a past-the-end iterator - auto end() requires(!ReadOnly) { + auto end() + requires(!ReadOnly) + { return detail_tc::TrackProxyIterator, TrackProxy, false>{*this, size()}; } @@ -217,7 +228,9 @@ class TrackContainer { /// @note Only available if the track container is not read-only /// @param key the name of the column to be added template - constexpr void addColumn(std::string_view key) requires(!ReadOnly) { + constexpr void addColumn(std::string_view key) + requires(!ReadOnly) + { m_container->template addColumn_impl(key); } @@ -241,8 +254,9 @@ class TrackContainer { /// @tparam other_track_container_t Type of the other track container /// @param other The other track container template - void ensureDynamicColumns(const other_track_container_t& other) requires( - !ReadOnly) { + void ensureDynamicColumns(const other_track_container_t& other) + requires(!ReadOnly) + { container().ensureDynamicColumns_impl(other.container()); } @@ -257,66 +271,69 @@ class TrackContainer { /// Get a mutable reference to the track container backend /// @note Only available if the track container is not read-only /// @return a mutable reference to the backend - auto& container() requires(!ReadOnly) { + auto& container() + requires(!ReadOnly) + { return *m_container; } /// Get a const reference to the track container backend /// @return a const reference to the backend - const auto& container() const { - return *m_container; - } + const auto& container() const { return *m_container; } /// Get a mutable reference to the track state container backend /// @note Only available if the track container is not read-only /// @return a mutable reference to the backend - auto& trackStateContainer() requires(!ReadOnly) { + auto& trackStateContainer() + requires(!ReadOnly) + { return *m_traj; } /// Retrieve the holder of the track state container /// @return The track state container including it's holder /// @note Only available if the track container is not read-only - auto& trackStateContainerHolder() requires(!ReadOnly) { + auto& trackStateContainerHolder() + requires(!ReadOnly) + { return m_traj; } /// Get a const reference to the track state container backend /// @return a const reference to the backend - const auto& trackStateContainer() const { - return *m_traj; - } + const auto& trackStateContainer() const { return *m_traj; } /// Retrieve the holder of the track state container /// @return The track state container including it's holder - const auto& trackStateContainerHolder() const { - return m_traj; - } + const auto& trackStateContainerHolder() const { return m_traj; } /// @} /// Get the size (number of tracks) of the track container /// @return the sixe - constexpr IndexType size() const { - return m_container->size_impl(); - } + constexpr IndexType size() const { return m_container->size_impl(); } /// Clear the content of the track container /// @note Only available if the track container is not read-only - void clear() requires(!ReadOnly) { + void clear() + requires(!ReadOnly) + { m_container->clear(); m_traj->clear(); } protected: template - constexpr T& component(IndexType itrack) requires(!ReadOnly) { + constexpr T& component(IndexType itrack) + requires(!ReadOnly) + { return *std::any_cast(container().component_impl(key, itrack)); } template - constexpr T& component(HashedString key, - IndexType itrack) requires(!ReadOnly) { + constexpr T& component(HashedString key, IndexType itrack) + requires(!ReadOnly) + { return *std::any_cast(container().component_impl(key, itrack)); } @@ -330,8 +347,9 @@ class TrackContainer { return *std::any_cast(container().component_impl(key, itrack)); } - constexpr typename TrackProxy::Parameters parameters( - IndexType itrack) requires(!ReadOnly) { + constexpr typename TrackProxy::Parameters parameters(IndexType itrack) + requires(!ReadOnly) + { return container().parameters(itrack); } @@ -340,8 +358,9 @@ class TrackContainer { return container().parameters(itrack); } - constexpr typename TrackProxy::Covariance covariance( - IndexType itrack) requires(!ReadOnly) { + constexpr typename TrackProxy::Covariance covariance(IndexType itrack) + requires(!ReadOnly) + { return container().covariance(itrack); } @@ -350,7 +369,9 @@ class TrackContainer { return container().covariance(itrack); } - auto reverseTrackStateRange(IndexType itrack) requires(!ReadOnly) { + auto reverseTrackStateRange(IndexType itrack) + requires(!ReadOnly) + { auto tip = component(itrack); return m_traj->reverseTrackStateRange(tip); } @@ -360,7 +381,9 @@ class TrackContainer { return m_traj->reverseTrackStateRange(tip); } - auto forwardTrackStateRange(IndexType itrack) requires(!ReadOnly) { + auto forwardTrackStateRange(IndexType itrack) + requires(!ReadOnly) + { auto stem = component(itrack); if (stem == kInvalid) { throw std::invalid_argument{"Track has no stem index"}; @@ -378,8 +401,9 @@ class TrackContainer { private: template - void copyDynamicFrom(IndexType dstIdx, const T& src, - IndexType srcIdx) requires(!ReadOnly) { + void copyDynamicFrom(IndexType dstIdx, const T& src, IndexType srcIdx) + requires(!ReadOnly) + { const auto& dynamicKeys = src.dynamicKeys_impl(); for (const auto key : dynamicKeys) { std::any srcPtr = src.component_impl(key, srcIdx); diff --git a/Core/include/Acts/EventData/TrackContainerBackendConcept.hpp b/Core/include/Acts/EventData/TrackContainerBackendConcept.hpp index e599e377226..a66e27c36e2 100644 --- a/Core/include/Acts/EventData/TrackContainerBackendConcept.hpp +++ b/Core/include/Acts/EventData/TrackContainerBackendConcept.hpp @@ -28,65 +28,71 @@ using ConstCovariance = Eigen::Map; } // namespace detail template -concept ConstTrackContainerBackend = requires(const T& cv, HashedString key, - TrackIndexType itrack) { - { cv.size_impl() } -> std::same_as; +concept ConstTrackContainerBackend = + requires(const T& cv, HashedString key, TrackIndexType itrack) { + { cv.size_impl() } -> std::same_as; - { cv.component_impl(key, itrack) } -> std::same_as; + { cv.component_impl(key, itrack) } -> std::same_as; - { cv.parameters(itrack) } -> std::same_as; + { cv.parameters(itrack) } -> std::same_as; - { cv.covariance(itrack) } -> std::same_as; + { cv.covariance(itrack) } -> std::same_as; - { cv.hasColumn_impl(key) } -> std::same_as; + { cv.hasColumn_impl(key) } -> std::same_as; - { cv.referenceSurface_impl(itrack) } -> std::same_as; + { cv.referenceSurface_impl(itrack) } -> std::same_as; - { cv.particleHypothesis_impl(itrack) } -> std::same_as; + { + cv.particleHypothesis_impl(itrack) + } -> std::same_as; - {cv.dynamicKeys_impl()}; - requires detail::RangeLike; -}; + { cv.dynamicKeys_impl() }; + requires detail::RangeLike; + }; template -concept MutableTrackContainerBackend = ConstTrackContainerBackend && +concept MutableTrackContainerBackend = + ConstTrackContainerBackend && requires(T v, HashedString key, TrackIndexType itrack, std::string col, const T& other, std::shared_ptr sharedSurface) { - { v.parameters(itrack) } -> std::same_as; + { v.parameters(itrack) } -> std::same_as; - { v.covariance(itrack) } -> std::same_as; + { v.covariance(itrack) } -> std::same_as; - { v.addTrack_impl() } -> std::same_as; + { v.addTrack_impl() } -> std::same_as; - {v.removeTrack_impl(itrack)}; + { v.removeTrack_impl(itrack) }; - // As far as I know there's no good way to assert that there's a - // generic template function - {v.template addColumn_impl(col)}; - {v.template addColumn_impl(col)}; - {v.template addColumn_impl(col)}; - {v.template addColumn_impl(col)}; - {v.template addColumn_impl(col)}; - {v.template addColumn_impl(col)}; + // As far as I know there's no good way to assert that there's a + // generic template function + { v.template addColumn_impl(col) }; + { v.template addColumn_impl(col) }; + { v.template addColumn_impl(col) }; + { v.template addColumn_impl(col) }; + { v.template addColumn_impl(col) }; + { v.template addColumn_impl(col) }; - {v.copyDynamicFrom_impl(itrack, key, std::declval())}; + { v.copyDynamicFrom_impl(itrack, key, std::declval()) }; - {v.ensureDynamicColumns_impl(other)}; + { v.ensureDynamicColumns_impl(other) }; - {v.reserve(itrack)}; + { v.reserve(itrack) }; - {v.setReferenceSurface_impl(itrack, sharedSurface)}; + { v.setReferenceSurface_impl(itrack, sharedSurface) }; - {v.setParticleHypothesis_impl( - itrack, std::declval())}; + { + v.setParticleHypothesis_impl( + itrack, std::declval()) + }; - {v.clear()}; -}; + { v.clear() }; + }; template struct IsReadOnlyTrackContainer; template -concept TrackContainerBackend = ConstTrackContainerBackend && +concept TrackContainerBackend = + ConstTrackContainerBackend && (IsReadOnlyTrackContainer::value || MutableTrackContainerBackend); } // namespace Acts diff --git a/Core/include/Acts/EventData/TrackProxy.hpp b/Core/include/Acts/EventData/TrackProxy.hpp index e7b9e56f89b..b60d6ca2a22 100644 --- a/Core/include/Acts/EventData/TrackProxy.hpp +++ b/Core/include/Acts/EventData/TrackProxy.hpp @@ -46,14 +46,13 @@ class TrackProxyIterator { using pointer = void; using reference = void; - TrackProxyIterator(container_t& container, - IndexType itrack) requires(!ReadOnly) + TrackProxyIterator(container_t& container, IndexType itrack) + requires(!ReadOnly) : m_container(&container), m_itrack(itrack) {} - TrackProxyIterator(const container_t& container, - IndexType itrack) requires ReadOnly - : m_container(&container), - m_itrack(itrack) {} + TrackProxyIterator(const container_t& container, IndexType itrack) + requires ReadOnly + : m_container(&container), m_itrack(itrack) {} TrackProxyIterator& operator++() { m_itrack++; @@ -90,7 +89,9 @@ class TrackProxyIterator { ProxyType operator*() const { return m_container->getTrack(m_itrack); } - ProxyType operator*() requires(!ReadOnly) { + ProxyType operator*() + requires(!ReadOnly) + { return m_container->getTrack(m_itrack); } @@ -281,7 +282,9 @@ class TrackProxy { /// track container /// @note Only available if the track proxy is not read-only /// @return mutable reference to the tip index - IndexType& tipIndex() requires(!ReadOnly) { + IndexType& tipIndex() + requires(!ReadOnly) + { return component(hashString("tipIndex")); } @@ -290,7 +293,9 @@ class TrackProxy { /// forward-linked. /// @note Only available if the track proxy is not read-only /// @return mutable reference to the stem index - IndexType& stemIndex() requires(!ReadOnly) { + IndexType& stemIndex() + requires(!ReadOnly) + { return component(hashString("stemIndex")); } @@ -304,8 +309,9 @@ class TrackProxy { // looks like a false-positive. clang-tidy believes `srf` is not movable. /// Set a new reference surface for this track /// @param srf The surface to set - void setReferenceSurface(std::shared_ptr srf) requires( - !ReadOnly) { + void setReferenceSurface(std::shared_ptr srf) + requires(!ReadOnly) + { m_container->container().setReferenceSurface_impl(m_index, std::move(srf)); } // NOLINTEND(performance-unnecessary-value-param) @@ -335,7 +341,9 @@ class TrackProxy { /// Mutable version /// @note Only available if the track proxy is not read-only /// @return Proxy vector for the parameters - Parameters parameters() requires(!ReadOnly) { + Parameters parameters() + requires(!ReadOnly) + { return m_container->parameters(m_index); } @@ -343,45 +351,35 @@ class TrackProxy { /// Mutable version /// @note Only available if the track proxy is not read-only /// @return Proxy matrix for the covariance - Covariance covariance() requires(!ReadOnly) { + Covariance covariance() + requires(!ReadOnly) + { return m_container->covariance(m_index); } /// Access the theta parameter of the track at the reference surface /// @return The theta parameter - ActsScalar theta() const { - return parameters()[eBoundTheta]; - } + ActsScalar theta() const { return parameters()[eBoundTheta]; } /// Access the phi parameter of the track at the reference surface /// @return The phi parameter - ActsScalar phi() const { - return parameters()[eBoundPhi]; - } + ActsScalar phi() const { return parameters()[eBoundPhi]; } /// Access the loc0 parameter of the track at the reference surface /// @return The loc0 parameter - ActsScalar loc0() const { - return parameters()[eBoundLoc0]; - } + ActsScalar loc0() const { return parameters()[eBoundLoc0]; } /// Access the loc1 parameter of the track at the reference surface /// @return The loc1 parameter - ActsScalar loc1() const { - return parameters()[eBoundLoc1]; - } + ActsScalar loc1() const { return parameters()[eBoundLoc1]; } /// Access the time parameter of the track at the reference surface /// @return The time parameter - ActsScalar time() const { - return parameters()[eBoundTime]; - } + ActsScalar time() const { return parameters()[eBoundTime]; } /// Access the q/p (curvature) parameter of the track at the reference surface /// @return The q/p parameter - ActsScalar qOverP() const { - return parameters()[eBoundQOverP]; - } + ActsScalar qOverP() const { return parameters()[eBoundQOverP]; } /// Get the particle hypothesis /// @return the particle hypothesis @@ -392,8 +390,9 @@ class TrackProxy { /// Set a new particle hypothesis for this track /// @note Only available if the track proxy is not read-only /// @param particleHypothesis The particle hypothesis to set - void setParticleHypothesis( - const ParticleHypothesis& particleHypothesis) requires(!ReadOnly) { + void setParticleHypothesis(const ParticleHypothesis& particleHypothesis) + requires(!ReadOnly) + { m_container->container().setParticleHypothesis_impl(m_index, particleHypothesis); } @@ -401,9 +400,7 @@ class TrackProxy { /// Get the charge of the tack /// @note this depends on the charge hypothesis /// @return The absolute track momentum - ActsScalar charge() const { - return particleHypothesis().qFromQOP(qOverP()); - } + ActsScalar charge() const { return particleHypothesis().qFromQOP(qOverP()); } /// Get the absolute momentum of the tack /// @return The absolute track momentum @@ -425,9 +422,7 @@ class TrackProxy { /// Get the global momentum vector /// @return the global momentum vector - Vector3 momentum() const { - return absoluteMomentum() * direction(); - } + Vector3 momentum() const { return absoluteMomentum() * direction(); } /// Return the number of track states associated to this track /// @note This is calculated by iterating over the track states which is @@ -448,7 +443,9 @@ class TrackProxy { /// Return the number of measurements for the track. Const version /// @note Only available if the track proxy is not read-only /// @return The number of measurements - unsigned int& nMeasurements() requires(!ReadOnly) { + unsigned int& nMeasurements() + requires(!ReadOnly) + { return component(); } @@ -463,7 +460,9 @@ class TrackProxy { /// Mutable version /// @note Only available if the track proxy is not read-only /// @return The number of holes - unsigned int& nHoles() requires(!ReadOnly) { + unsigned int& nHoles() + requires(!ReadOnly) + { return component(); } @@ -477,7 +476,9 @@ class TrackProxy { /// Mutable version /// @note Only available if the track proxy is not read-only /// @return The number of outliers - unsigned int& nOutliers() requires(!ReadOnly) { + unsigned int& nOutliers() + requires(!ReadOnly) + { return component(); } @@ -491,7 +492,9 @@ class TrackProxy { /// Mutable version /// @note Only available if the track proxy is not read-only /// @return The number of shared hits - unsigned int& nSharedHits() requires(!ReadOnly) { + unsigned int& nSharedHits() + requires(!ReadOnly) + { return component(); } @@ -505,21 +508,23 @@ class TrackProxy { /// Mutable version /// @note Only available if the track proxy is not read-only /// @return The chi squared - float& chi2() requires(!ReadOnly) { + float& chi2() + requires(!ReadOnly) + { return component(); } /// Return the chi squared for the track. Const version /// @return The chi squared - float chi2() const { - return component(); - } + float chi2() const { return component(); } /// Return a mutable reference to the number of degrees of freedom for the /// track. Mutable version /// @note Only available if the track proxy is not read-only /// @return The number of degrees of freedom - unsigned int& nDoF() requires(!ReadOnly) { + unsigned int& nDoF() + requires(!ReadOnly) + { return component(); } @@ -532,9 +537,7 @@ class TrackProxy { /// Return the index of this track in the track container /// @note This is separate from the tip index /// @return the track index - IndexType index() const { - return m_index; - } + IndexType index() const { return m_index; } /// @} @@ -551,7 +554,9 @@ class TrackProxy { /// Return a mutable track state proxy to the outermost track state /// @return The outermost track state proxy - TrackStateProxy outermostTrackState() requires(!ReadOnly) { + TrackStateProxy outermostTrackState() + requires(!ReadOnly) + { return m_container->trackStateContainer().getTrackState(tipIndex()); } @@ -575,7 +580,9 @@ class TrackProxy { /// @note This is only available, if the track is forward linked /// @note Only available if the track proxy is not read-only /// @return The innermost track state proxy - auto innermostTrackState() requires(!ReadOnly) { + auto innermostTrackState() + requires(!ReadOnly) + { using proxy_t = decltype(m_container->trackStateContainer().getTrackState( std::declval())); @@ -601,7 +608,9 @@ class TrackProxy { /// @note Only available if the track proxy is not read-only /// @note This range is from the outside inwards! /// @return Track state range to iterate over - auto trackStatesReversed() requires(!ReadOnly) { + auto trackStatesReversed() + requires(!ReadOnly) + { return m_container->reverseTrackStateRange(m_index); } @@ -626,7 +635,9 @@ class TrackProxy { /// @warning This access direction is only possible if the track states are /// **forward-linked**. /// @return Track state range to iterate over - auto trackStates() requires(!ReadOnly) { + auto trackStates() + requires(!ReadOnly) + { return m_container->forwardTrackStateRange(m_index); } @@ -640,7 +651,9 @@ class TrackProxy { /// Forward connect a track. /// This means setting indices from the inside out on all track states. /// @note Only available if the track proxy is not read-only - void linkForward() requires(!ReadOnly) { + void linkForward() + requires(!ReadOnly) + { IndexType last = kInvalid; for (auto ts : trackStatesReversed()) { ts.template component(hashString("next")) = last; @@ -655,8 +668,9 @@ class TrackProxy { /// @note Only available if the track proxy is not read-only /// @param mask The allocation prop mask for the new track state /// @return The newly added track state - auto appendTrackState( - TrackStatePropMask mask = TrackStatePropMask::All) requires(!ReadOnly) { + auto appendTrackState(TrackStatePropMask mask = TrackStatePropMask::All) + requires(!ReadOnly) + { auto& tsc = m_container->trackStateContainer(); auto ts = tsc.makeTrackState(mask, tipIndex()); tipIndex() = ts.index(); @@ -669,8 +683,9 @@ class TrackProxy { /// @param other The track proxy /// @param copyTrackStates Copy the track state sequence from @p other template - void copyFrom(const track_proxy_t& other, - bool copyTrackStates = true) requires(!ReadOnly) { + void copyFrom(const track_proxy_t& other, bool copyTrackStates = true) + requires(!ReadOnly) + { // @TODO: Add constraint on which track proxies are allowed, // this is only implicit right now @@ -711,7 +726,9 @@ class TrackProxy { /// Creates a *shallow copy* of the track. Track states are not copied, but /// the resulting track points at the same track states as the original. /// @note Only available if the track proxy is not read-only - TrackProxy shallowCopy() requires(!ReadOnly) { + TrackProxy shallowCopy() + requires(!ReadOnly) + { auto ts = container().makeTrack(); ts.copyFrom(*this, false); ts.tipIndex() = tipIndex(); @@ -726,7 +743,9 @@ class TrackProxy { /// @note This is dangerous with branching track state sequences, as it will break them /// @note This also automatically forward-links the track! /// @param invertJacobians Whether to invert the Jacobians of the track states - void reverseTrackStates(bool invertJacobians = false) requires(!ReadOnly) { + void reverseTrackStates(bool invertJacobians = false) + requires(!ReadOnly) + { IndexType current = tipIndex(); IndexType next = kInvalid; IndexType prev = kInvalid; @@ -779,7 +798,9 @@ class TrackProxy { /// @tparam key String key for the component to access /// @return Mutable reference to the component given by @p key template - constexpr T& component() requires(!ReadOnly) { + constexpr T& component() + requires(!ReadOnly) + { return m_container->template component(m_index); } @@ -788,7 +809,9 @@ class TrackProxy { /// @param key String key for the component to access /// @return Mutable reference to the component given by @p key template - constexpr T& component(HashedString key) requires(!ReadOnly) { + constexpr T& component(HashedString key) + requires(!ReadOnly) + { return m_container->template component(key, m_index); } @@ -798,7 +821,9 @@ class TrackProxy { /// @note This might hash the @p key at runtime instead of compile-time /// @return Mutable reference to the component given by @p key template - constexpr T& component(std::string_view key) requires(!ReadOnly) { + constexpr T& component(std::string_view key) + requires(!ReadOnly) + { return m_container->template component(hashString(key), m_index); } @@ -853,15 +878,15 @@ class TrackProxy { /// Return a reference to the track container backend, mutable version. /// @note Only available if the track proxy is not read-only /// @return reference to the track container backend - auto& container() requires(!ReadOnly) { + auto& container() + requires(!ReadOnly) + { return *m_container; } /// Return a reference to the track container backend, const version. /// @return reference to the track container backend - const auto& container() const { - return *m_container; - } + const auto& container() const { return *m_container; } private: TrackProxy(detail_tc::ConstIf, diff --git a/Core/include/Acts/EventData/TrackStateProxy.hpp b/Core/include/Acts/EventData/TrackStateProxy.hpp index eb565de87ca..1e68994fad8 100644 --- a/Core/include/Acts/EventData/TrackStateProxy.hpp +++ b/Core/include/Acts/EventData/TrackStateProxy.hpp @@ -312,7 +312,9 @@ class TrackStateProxy { /// the track sequence /// @note Only available if the track state proxy is not read-only /// @return The index of the previous track state. - IndexType& previous() requires(!ReadOnly) { + IndexType& previous() + requires(!ReadOnly) + { return component(); } @@ -330,14 +332,18 @@ class TrackStateProxy { /// Unset an optional track state component /// @note Only available if the track state proxy is not read-only /// @param target The component to unset - void unset(TrackStatePropMask target) requires(!ReadOnly) { + void unset(TrackStatePropMask target) + requires(!ReadOnly) + { m_traj->self().unset(target, m_istate); } /// Add additional components to the track state /// @note Only available if the track state proxy is not read-only /// @param mask The bitmask that instructs which components to allocate - void addComponents(TrackStatePropMask mask) requires(!ReadOnly) { + void addComponents(TrackStatePropMask mask) + requires(!ReadOnly) + { m_traj->self().addTrackStateComponents_impl(m_istate, mask); } @@ -361,8 +367,9 @@ class TrackStateProxy { /// Set the reference surface to a given value /// @param srf Shared pointer to the surface to set /// @note This overload is only present in case @c ReadOnly is false. - void setReferenceSurface(std::shared_ptr srf) requires( - !ReadOnly) { + void setReferenceSurface(std::shared_ptr srf) + requires(!ReadOnly) + { m_traj->setReferenceSurface(m_istate, std::move(srf)); } // NOLINTEND(performance-unnecessary-value-param) @@ -372,7 +379,9 @@ class TrackStateProxy { /// value directly into the backing store. /// @note this overload is only enabled in case the proxy is not read-only /// @return Mutable reference to the chi2 value - float& chi2() requires(!ReadOnly) { + float& chi2() + requires(!ReadOnly) + { return component(); } @@ -401,7 +410,9 @@ class TrackStateProxy { /// This overloaded is only enabled if not read-only, and returns a mutable /// reference. /// @return reference to the type flags. - TrackStateType typeFlags() requires(!ReadOnly) { + TrackStateType typeFlags() + requires(!ReadOnly) + { return TrackStateType{ component()}; } @@ -455,7 +466,9 @@ class TrackStateProxy { component()); } - Covariance predictedCovariance() requires(!ReadOnly) { + Covariance predictedCovariance() + requires(!ReadOnly) + { assert(has()); return m_traj->self().covariance( component()); @@ -477,7 +490,9 @@ class TrackStateProxy { /// Filtered track parameters vector /// @return The filtered parameters /// @note Mutable version - Parameters filtered() requires(!ReadOnly) { + Parameters filtered() + requires(!ReadOnly) + { assert(has()); return m_traj->self().parameters( component()); @@ -495,7 +510,9 @@ class TrackStateProxy { /// Filtered track parameters covariance matrix /// @return The filtered parameters covariance /// @note Mutable version - Covariance filteredCovariance() requires(!ReadOnly) { + Covariance filteredCovariance() + requires(!ReadOnly) + { assert(has()); return m_traj->self().covariance( component()); @@ -517,7 +534,9 @@ class TrackStateProxy { /// Smoothed track parameters vector /// @return The smoothed parameters /// @note Mutable version - Parameters smoothed() requires(!ReadOnly) { + Parameters smoothed() + requires(!ReadOnly) + { assert(has()); return m_traj->self().parameters( component()); @@ -535,7 +554,9 @@ class TrackStateProxy { /// Smoothed track parameters covariance matrix /// @return the parameter covariance matrix /// @note Mutable version - Covariance smoothedCovariance() requires(!ReadOnly) { + Covariance smoothedCovariance() + requires(!ReadOnly) + { assert(has()); return m_traj->self().covariance( component()); @@ -556,7 +577,9 @@ class TrackStateProxy { /// Returns the jacobian from the previous trackstate to this one /// @return The jacobian matrix /// @note Mutable version - Covariance jacobian() requires(!ReadOnly) { + Covariance jacobian() + requires(!ReadOnly) + { assert(has()); return m_traj->self().jacobian(m_istate); } @@ -623,8 +646,9 @@ class TrackStateProxy { /// @param projector The projector in the form of a dense matrix /// @note @p projector is assumed to only have 0s or 1s as components. template - void setProjector(const Eigen::MatrixBase& projector) requires( - !ReadOnly) { + void setProjector(const Eigen::MatrixBase& projector) + requires(!ReadOnly) + { constexpr int rows = Eigen::MatrixBase::RowsAtCompileTime; constexpr int cols = Eigen::MatrixBase::ColsAtCompileTime; @@ -667,7 +691,9 @@ class TrackStateProxy { /// @note This is mainly to copy explicitly a projector from one state /// to another. If you have a projection matrix, set it with /// `setProjector`. - void setProjectorBitset(ProjectorBitset proj) requires(!ReadOnly) { + void setProjectorBitset(ProjectorBitset proj) + requires(!ReadOnly) + { assert(has()); component() = proj; } @@ -680,8 +706,9 @@ class TrackStateProxy { /// Set an uncalibrated source link /// @param sourceLink The uncalibrated source link to set template - void setUncalibratedSourceLink(source_link_t&& sourceLink) requires( - !ReadOnly) { + void setUncalibratedSourceLink(source_link_t&& sourceLink) + requires(!ReadOnly) + { m_traj->setUncalibratedSourceLink(m_istate, std::forward(sourceLink)); } @@ -690,8 +717,9 @@ class TrackStateProxy { /// @param sourceLink The uncalibrated source link to set /// @note Use the overload with an rvalue reference, this /// overload will be removed ith the next major version - void setUncalibratedSourceLink(const SourceLink& sourceLink) requires( - !ReadOnly) { + void setUncalibratedSourceLink(const SourceLink& sourceLink) + requires(!ReadOnly) + { m_traj->setUncalibratedSourceLink(m_istate, SourceLink{sourceLink}); } @@ -720,7 +748,9 @@ class TrackStateProxy { /// @return The measurement vector /// @note Mutable version template - Calibrated calibrated() requires(!ReadOnly) { + Calibrated calibrated() + requires(!ReadOnly) + { assert(has()); return m_traj->self().template calibrated(m_istate); } @@ -738,7 +768,9 @@ class TrackStateProxy { /// covariance is located in the top left corner, everything else is zeroed. /// @return The measurement covariance matrix template - CalibratedCovariance calibratedCovariance() requires(!ReadOnly) { + CalibratedCovariance calibratedCovariance() + requires(!ReadOnly) + { assert(has()); return m_traj->self().template calibratedCovariance(m_istate); } @@ -746,7 +778,9 @@ class TrackStateProxy { /// Mutable dynamic measurement vector with only the valid dimensions. /// @warning The dynamic vector has a runtime overhead! /// @return The effective calibrated measurement vector - EffectiveCalibrated effectiveCalibrated() requires(!ReadOnly) { + EffectiveCalibrated effectiveCalibrated() + requires(!ReadOnly) + { assert(has()); return m_traj->self().effectiveCalibrated(m_istate); } @@ -811,8 +845,9 @@ class TrackStateProxy { /// @param shareSource Which component to share from /// @param shareTarget Which component to share as. This should be different from /// as @p shareSource, e.g. predicted can be shared as filtered. - void shareFrom(TrackStatePropMask shareSource, - TrackStatePropMask shareTarget) requires(!ReadOnly) { + void shareFrom(TrackStatePropMask shareSource, TrackStatePropMask shareTarget) + requires(!ReadOnly) + { shareFrom(*this, shareSource, shareTarget); } @@ -823,7 +858,9 @@ class TrackStateProxy { /// same @c MultiTrajectory instance template void shareFrom(const TrackStateProxy& other, - TrackStatePropMask component) requires(!ReadOnly) { + TrackStatePropMask component) + requires(!ReadOnly) + { shareFrom(other, component, component); } @@ -836,8 +873,9 @@ class TrackStateProxy { /// or projector. See @c TrackStatePropMask. template void shareFrom(const TrackStateProxy& other, - TrackStatePropMask shareSource, - TrackStatePropMask shareTarget) requires(!ReadOnly) { + TrackStatePropMask shareSource, TrackStatePropMask shareTarget) + requires(!ReadOnly) + { assert(m_traj == other.m_traj && "Cannot share components across MultiTrajectories"); @@ -860,7 +898,9 @@ class TrackStateProxy { template void copyFrom(const track_state_proxy_t& other, TrackStatePropMask mask = TrackStatePropMask::All, - bool onlyAllocated = true) requires(!ReadOnly) { + bool onlyAllocated = true) + requires(!ReadOnly) + { using PM = TrackStatePropMask; if (onlyAllocated) { @@ -1016,7 +1056,9 @@ class TrackStateProxy { /// @tparam key String key for the component to access /// @return Mutable reference to the component given by @p key template - constexpr T& component() requires(!ReadOnly) { + constexpr T& component() + requires(!ReadOnly) + { return m_traj->template component(m_istate); } @@ -1025,7 +1067,9 @@ class TrackStateProxy { /// @param key String key for the component to access /// @return Mutable reference to the component given by @p key template - constexpr T& component(HashedString key) requires(!ReadOnly) { + constexpr T& component(HashedString key) + requires(!ReadOnly) + { return m_traj->template component(key, m_istate); } @@ -1035,7 +1079,9 @@ class TrackStateProxy { /// @note This might hash the @p key at runtime instead of compile-time /// @return Mutable reference to the component given by @p key template - constexpr T& component(std::string_view key) requires(!ReadOnly) { + constexpr T& component(std::string_view key) + requires(!ReadOnly) + { return m_traj->template component(hashString(key), m_istate); } @@ -1071,7 +1117,9 @@ class TrackStateProxy { /// Return a mutable reference to the underlying backend container /// @return A reference to the backend container - MultiTrajectory& trajectory() requires(!ReadOnly) { + MultiTrajectory& trajectory() + requires(!ReadOnly) + { return *m_traj; } @@ -1081,7 +1129,11 @@ class TrackStateProxy { /// Get a mutable reference to the track state container backend /// @return a mutable reference to the backend - auto& container() requires(!ReadOnly) { return *m_traj; } + auto& container() + requires(!ReadOnly) + { + return *m_traj; + } /// Get a const reference to the track state container backend /// @return a const reference to the backend diff --git a/Core/include/Acts/EventData/TrackStateProxyConcept.hpp b/Core/include/Acts/EventData/TrackStateProxyConcept.hpp index 22e3fd1ef5c..c74a46eba32 100644 --- a/Core/include/Acts/EventData/TrackStateProxyConcept.hpp +++ b/Core/include/Acts/EventData/TrackStateProxyConcept.hpp @@ -61,186 +61,197 @@ template concept TrackStateProxyConcept = requires(const T& cv, T v, HashedString key, std::shared_ptr surface) { - { cv.index() } -> std::same_as; + { cv.index() } -> std::same_as; - { cv.previous() } -> std::same_as; + { cv.previous() } -> std::same_as; - { cv.hasPrevious() } -> std::same_as; + { cv.hasPrevious() } -> std::same_as; - { cv.getMask() } -> std::same_as; + { cv.getMask() } -> std::same_as; - { cv.referenceSurface() } -> std::same_as; + { cv.referenceSurface() } -> std::same_as; - { cv.hasReferenceSurface() } -> std::same_as; + { cv.hasReferenceSurface() } -> std::same_as; - { cv.template has() } -> std::same_as; + { cv.template has() } -> std::same_as; - { cv.has(key) } -> std::same_as; + { cv.has(key) } -> std::same_as; - { cv.has("blubb") } -> std::same_as; + { cv.has("blubb") } -> std::same_as; - // Cannot verify for all types, so just check int - { - cv.template component() - } -> std::same_as; + // Cannot verify for all types, so just check int + { + cv.template component() + } -> std::same_as; - { cv.template component(key) } -> std::same_as; + { cv.template component(key) } -> std::same_as; - { cv.parameters() } -> std::same_as; - { cv.covariance() } -> std::same_as; + { cv.parameters() } -> std::same_as; + { cv.covariance() } -> std::same_as; - { cv.predicted() } -> std::same_as; - { cv.predictedCovariance() } -> std::same_as; - { cv.hasPredicted() } -> std::same_as; - { v.hasPredicted() } -> std::same_as; + { cv.predicted() } -> std::same_as; + { cv.predictedCovariance() } -> std::same_as; + { cv.hasPredicted() } -> std::same_as; + { v.hasPredicted() } -> std::same_as; - { cv.filtered() } -> std::same_as; - { cv.filteredCovariance() } -> std::same_as; - { cv.hasFiltered() } -> std::same_as; - { v.hasFiltered() } -> std::same_as; + { cv.filtered() } -> std::same_as; + { cv.filteredCovariance() } -> std::same_as; + { cv.hasFiltered() } -> std::same_as; + { v.hasFiltered() } -> std::same_as; - { cv.smoothed() } -> std::same_as; - { cv.smoothedCovariance() } -> std::same_as; - { cv.hasSmoothed() } -> std::same_as; - { v.hasSmoothed() } -> std::same_as; + { cv.smoothed() } -> std::same_as; + { cv.smoothedCovariance() } -> std::same_as; + { cv.hasSmoothed() } -> std::same_as; + { v.hasSmoothed() } -> std::same_as; - { cv.jacobian() } -> std::same_as; - { cv.hasJacobian() } -> std::same_as; - { v.hasJacobian() } -> std::same_as; + { cv.jacobian() } -> std::same_as; + { cv.hasJacobian() } -> std::same_as; + { v.hasJacobian() } -> std::same_as; - { cv.hasProjector() } -> std::same_as; - { v.hasProjector() } -> std::same_as; + { cv.hasProjector() } -> std::same_as; + { v.hasProjector() } -> std::same_as; - { cv.effectiveProjector() } -> std::same_as; - { v.effectiveProjector() } -> std::same_as; + { cv.effectiveProjector() } -> std::same_as; + { v.effectiveProjector() } -> std::same_as; - { cv.projectorBitset() } -> std::same_as; - { v.projectorBitset() } -> std::same_as; + { cv.projectorBitset() } -> std::same_as; + { v.projectorBitset() } -> std::same_as; - { cv.getUncalibratedSourceLink() } -> std::same_as; - { v.getUncalibratedSourceLink() } -> std::same_as; + { cv.getUncalibratedSourceLink() } -> std::same_as; + { v.getUncalibratedSourceLink() } -> std::same_as; - { cv.hasCalibrated() } -> std::same_as; - { v.hasCalibrated() } -> std::same_as; + { cv.hasCalibrated() } -> std::same_as; + { v.hasCalibrated() } -> std::same_as; - { cv.template calibrated<2>() } -> std::same_as; - { - cv.template calibratedCovariance<2>() - } -> std::same_as; + { cv.template calibrated<2>() } -> std::same_as; + { + cv.template calibratedCovariance<2>() + } -> std::same_as; - { cv.effectiveCalibrated() } -> std::same_as; - { - cv.effectiveCalibratedCovariance() - } -> std::same_as; + { + cv.effectiveCalibrated() + } -> std::same_as; + { + cv.effectiveCalibratedCovariance() + } -> std::same_as; - { cv.calibratedSize() } -> std::same_as; - { v.calibratedSize() } -> std::same_as; + { cv.calibratedSize() } -> std::same_as; + { v.calibratedSize() } -> std::same_as; - { cv.chi2() } -> std::same_as; + { cv.chi2() } -> std::same_as; - { cv.pathLength() } -> std::same_as; + { cv.pathLength() } -> std::same_as; - { cv.typeFlags() } -> std::same_as; -}; + { cv.typeFlags() } -> std::same_as; + }; template -concept ConstTrackStateProxyConcept = TrackStateProxyConcept && - requires(T v, HashedString key) { - // Cannot verify for all types, so just check int - { - v.template component() - } -> std::same_as; +concept ConstTrackStateProxyConcept = + TrackStateProxyConcept && requires(T v, HashedString key) { + // Cannot verify for all types, so just check int + { + v.template component() + } -> std::same_as; - { v.template component(key) } -> std::same_as; + { v.template component(key) } -> std::same_as; - { v.predicted() } -> std::same_as; - { v.predictedCovariance() } -> std::same_as; + { v.predicted() } -> std::same_as; + { v.predictedCovariance() } -> std::same_as; - { v.filtered() } -> std::same_as; - { v.filteredCovariance() } -> std::same_as; + { v.filtered() } -> std::same_as; + { v.filteredCovariance() } -> std::same_as; - { v.smoothed() } -> std::same_as; - { v.smoothedCovariance() } -> std::same_as; + { v.smoothed() } -> std::same_as; + { v.smoothedCovariance() } -> std::same_as; - { v.jacobian() } -> std::same_as; + { v.jacobian() } -> std::same_as; - { v.template calibrated<2>() } -> std::same_as; - { - v.template calibratedCovariance<2>() - } -> std::same_as; + { v.template calibrated<2>() } -> std::same_as; + { + v.template calibratedCovariance<2>() + } -> std::same_as; - { v.effectiveCalibrated() } -> std::same_as; - { - v.effectiveCalibratedCovariance() - } -> std::same_as; + { + v.effectiveCalibrated() + } -> std::same_as; + { + v.effectiveCalibratedCovariance() + } -> std::same_as; - { v.chi2() } -> std::same_as; + { v.chi2() } -> std::same_as; - { v.pathLength() } -> std::same_as; + { v.pathLength() } -> std::same_as; - { v.typeFlags() } -> std::same_as; -}; + { v.typeFlags() } -> std::same_as; + }; template -concept MutableTrackStateProxyConcept = TrackStateProxyConcept && +concept MutableTrackStateProxyConcept = + TrackStateProxyConcept && requires(T v, HashedString key, TrackStatePropMask mask, TrackIndexType index, std::shared_ptr surface, Eigen::Matrix projector, ProjectorBitset projectorBitset, SourceLink sl, std::size_t measdim) { - {v.shareFrom(mask, mask)}; + { v.shareFrom(mask, mask) }; - {v.shareFrom(std::declval(), - mask)}; + { + v.shareFrom( + std::declval(), mask) + }; - {v.shareFrom(std::declval(), mask)}; + { v.shareFrom(std::declval(), mask) }; - // Cannot verify copyFrom compatibility with other backend proxies - {v.copyFrom(std::declval(), - mask)}; + // Cannot verify copyFrom compatibility with other backend proxies + { + v.copyFrom(std::declval(), + mask) + }; - {v.copyFrom(std::declval(), mask)}; + { v.copyFrom(std::declval(), mask) }; - {v.unset(mask)}; + { v.unset(mask) }; - // Cannot verify for all types, so just check int - { v.template component() } -> std::same_as; + // Cannot verify for all types, so just check int + { + v.template component() + } -> std::same_as; - { v.template component(key) } -> std::same_as; + { v.template component(key) } -> std::same_as; - { v.predicted() } -> std::same_as; - { v.predictedCovariance() } -> std::same_as; + { v.predicted() } -> std::same_as; + { v.predictedCovariance() } -> std::same_as; - { v.filtered() } -> std::same_as; - { v.filteredCovariance() } -> std::same_as; + { v.filtered() } -> std::same_as; + { v.filteredCovariance() } -> std::same_as; - { v.smoothed() } -> std::same_as; - { v.smoothedCovariance() } -> std::same_as; + { v.smoothed() } -> std::same_as; + { v.smoothedCovariance() } -> std::same_as; - { v.jacobian() } -> std::same_as; + { v.jacobian() } -> std::same_as; - {v.setProjector(projector)}; + { v.setProjector(projector) }; - {v.setProjectorBitset(projectorBitset)}; + { v.setProjectorBitset(projectorBitset) }; - {v.setUncalibratedSourceLink(sl)}; + { v.setUncalibratedSourceLink(sl) }; - { v.template calibrated<2>() } -> std::same_as; - { - v.template calibratedCovariance<2>() - } -> std::same_as; + { v.template calibrated<2>() } -> std::same_as; + { + v.template calibratedCovariance<2>() + } -> std::same_as; - { v.effectiveCalibrated() } -> std::same_as; - { - v.effectiveCalibratedCovariance() - } -> std::same_as; + { v.effectiveCalibrated() } -> std::same_as; + { + v.effectiveCalibratedCovariance() + } -> std::same_as; - {v.allocateCalibrated(measdim)}; + { v.allocateCalibrated(measdim) }; - { v.chi2() } -> std::same_as; + { v.chi2() } -> std::same_as; - { v.pathLength() } -> std::same_as; + { v.pathLength() } -> std::same_as; - { v.typeFlags() } -> std::same_as; -}; + { v.typeFlags() } -> std::same_as; + }; } // namespace Acts diff --git a/Core/include/Acts/EventData/VectorMultiTrajectory.hpp b/Core/include/Acts/EventData/VectorMultiTrajectory.hpp index fa6d06590bc..8db631b9d33 100644 --- a/Core/include/Acts/EventData/VectorMultiTrajectory.hpp +++ b/Core/include/Acts/EventData/VectorMultiTrajectory.hpp @@ -439,9 +439,7 @@ class VectorMultiTrajectory final return detail_vmt::VectorMultiTrajectoryBase::has_impl(*this, key, istate); } - IndexType size_impl() const { - return m_index.size(); - } + IndexType size_impl() const { return m_index.size(); } void clear_impl(); @@ -569,9 +567,7 @@ class ConstVectorMultiTrajectory final return detail_vmt::VectorMultiTrajectoryBase::has_impl(*this, key, istate); } - IndexType size_impl() const { - return m_index.size(); - } + IndexType size_impl() const { return m_index.size(); } std::any component_impl(HashedString key, IndexType istate) const { return detail_vmt::VectorMultiTrajectoryBase::component_impl( diff --git a/Core/include/Acts/Geometry/TrackingVolumeVisitorConcept.hpp b/Core/include/Acts/Geometry/TrackingVolumeVisitorConcept.hpp index 82f2b7de08a..c79ed610de9 100644 --- a/Core/include/Acts/Geometry/TrackingVolumeVisitorConcept.hpp +++ b/Core/include/Acts/Geometry/TrackingVolumeVisitorConcept.hpp @@ -16,7 +16,7 @@ class TrackingVolume; template concept TrackingVolumeVisitor = requires(T v) { - {v(std::declval())}; + { v(std::declval()) }; }; } // namespace Acts diff --git a/Core/include/Acts/Propagator/EigenStepper.ipp b/Core/include/Acts/Propagator/EigenStepper.ipp index ea2834b61b0..eb693a9148a 100644 --- a/Core/include/Acts/Propagator/EigenStepper.ipp +++ b/Core/include/Acts/Propagator/EigenStepper.ipp @@ -100,9 +100,8 @@ bool Acts::EigenStepper::prepareCurvilinearState( } template -auto Acts::EigenStepper::curvilinearState(State& state, - bool transportCov) const - -> CurvilinearState { +auto Acts::EigenStepper::curvilinearState( + State& state, bool transportCov) const -> CurvilinearState { return detail::curvilinearState( state.cov, state.jacobian, state.jacTransport, state.derivative, state.jacToGlobal, state.pars, state.particleHypothesis, diff --git a/Core/include/Acts/Propagator/MaterialInteractor.hpp b/Core/include/Acts/Propagator/MaterialInteractor.hpp index c0feff1f932..171e5032ef2 100644 --- a/Core/include/Acts/Propagator/MaterialInteractor.hpp +++ b/Core/include/Acts/Propagator/MaterialInteractor.hpp @@ -81,8 +81,8 @@ struct MaterialInteractor { // We only have material interactions if there is potential material if (surface && surface->surfaceMaterial()) { - ACTS_VERBOSE("MaterialInteractor | " - << "Found material on surface " << surface->geometryId()); + ACTS_VERBOSE("MaterialInteractor | " << "Found material on surface " + << surface->geometryId()); // Prepare relevant input particle properties detail::PointwiseMaterialInteraction interaction(surface, state, stepper); @@ -129,8 +129,8 @@ struct MaterialInteractor { // We only have material interactions if there is potential material if (volume && volume->volumeMaterial()) { - ACTS_VERBOSE("MaterialInteractor | " - << "Found material in volume " << volume->geometryId()); + ACTS_VERBOSE("MaterialInteractor | " << "Found material in volume " + << volume->geometryId()); // Prepare relevant input particle properties detail::VolumeMaterialInteraction interaction(volume, state, stepper); diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp index fd090814bd0..f743d059a2f 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp @@ -63,9 +63,8 @@ auto MultiEigenStepperLoop::boundState( } template -auto MultiEigenStepperLoop::curvilinearState(State& state, - bool transportCov) const - -> CurvilinearState { +auto MultiEigenStepperLoop::curvilinearState( + State& state, bool transportCov) const -> CurvilinearState { assert(!state.components.empty()); std::vector< diff --git a/Core/include/Acts/Propagator/Propagator.ipp b/Core/include/Acts/Propagator/Propagator.ipp index 40dbcb2334a..49f67f88f94 100644 --- a/Core/include/Acts/Propagator/Propagator.ipp +++ b/Core/include/Acts/Propagator/Propagator.ipp @@ -119,12 +119,12 @@ auto Acts::Propagator::propagate(const parameters_t& start, template template -auto Acts::Propagator::propagate( - const parameters_t& start, const Surface& target, - const propagator_options_t& options) const - -> Result> { +auto Acts::Propagator::propagate(const parameters_t& start, + const Surface& target, + const propagator_options_t& options) + const -> Result> { static_assert(Concepts::BoundTrackParametersConcept, "Parameters do not fulfill bound parameters concept."); @@ -274,12 +274,13 @@ auto Acts::Propagator::makeResult(propagator_state_t state, template template -auto Acts::Propagator::makeResult( - propagator_state_t state, Result propagationResult, - const Surface& target, const propagator_options_t& /*options*/) const - -> Result> { +auto Acts::Propagator::makeResult(propagator_state_t state, + Result propagationResult, + const Surface& target, + const propagator_options_t& /*options*/) + const -> Result> { // Type of track parameters produced at the end of the propagation using ReturnParameterType = StepperBoundTrackParameters; diff --git a/Core/include/Acts/Propagator/StandardAborters.hpp b/Core/include/Acts/Propagator/StandardAborters.hpp index 23c045eac7e..84ac3a427cf 100644 --- a/Core/include/Acts/Propagator/StandardAborters.hpp +++ b/Core/include/Acts/Propagator/StandardAborters.hpp @@ -51,8 +51,8 @@ struct PathLimitReached { double tolerance = state.options.surfaceTolerance; bool limitReached = (std::abs(distance) < std::abs(tolerance)); if (limitReached) { - ACTS_VERBOSE("PathLimit aborter | " - << "Path limit reached at distance " << distance); + ACTS_VERBOSE("PathLimit aborter | " << "Path limit reached at distance " + << distance); return true; } stepper.updateStepSize(state.stepping, distance, ConstrainedStep::aborter, diff --git a/Core/include/Acts/Seeding/SeedFinderGbts.ipp b/Core/include/Acts/Seeding/SeedFinderGbts.ipp index 6206a2c2cd0..92cc7cd1963 100644 --- a/Core/include/Acts/Seeding/SeedFinderGbts.ipp +++ b/Core/include/Acts/Seeding/SeedFinderGbts.ipp @@ -314,12 +314,12 @@ void SeedFinderGbts::runGbts_TrackFinder( nEdges++; } } // loop over n2 (outer) nodes - } // loop over n1 (inner) nodes - } // loop over source eta bins - } // loop over dst eta bins - } // loop over L2(L1) layers - } // loop over dst layers - } // loop over the stages of doublet making + } // loop over n1 (inner) nodes + } // loop over source eta bins + } // loop over dst eta bins + } // loop over L2(L1) layers + } // loop over dst layers + } // loop over the stages of doublet making std::vector*> vNodes; diff --git a/Core/include/Acts/Seeding/detail/UtilityFunctions.hpp b/Core/include/Acts/Seeding/detail/UtilityFunctions.hpp index 33f4e765476..5b73d9b416f 100644 --- a/Core/include/Acts/Seeding/detail/UtilityFunctions.hpp +++ b/Core/include/Acts/Seeding/detail/UtilityFunctions.hpp @@ -16,18 +16,18 @@ namespace Acts::detail { template concept isCollectionThatSupportsPushBack = std::ranges::range && requires { - typename external_t::value_type; -} && requires(external_t coll, typename external_t::value_type val) { - coll.push_back(val); -}; + typename external_t::value_type; + } && requires(external_t coll, typename external_t::value_type val) { + coll.push_back(val); + }; template concept isCollectionThatSupportsInsert = std::ranges::range && requires { - typename external_t::value_type; -} && requires(external_t coll, typename external_t::value_type val) { - coll.insert(std::ranges::end(coll), val); -}; + typename external_t::value_type; + } && requires(external_t coll, typename external_t::value_type val) { + coll.insert(std::ranges::end(coll), val); + }; // Define some functions template @@ -38,10 +38,9 @@ void pushBackOrInsertAtEnd( } template -requires(!Acts::detail::isCollectionThatSupportsPushBack && - Acts::detail::isCollectionThatSupportsInsert< - storage_t>) void pushBackOrInsertAtEnd(storage_t& storage, - value_t&& value) { + requires(!Acts::detail::isCollectionThatSupportsPushBack && + Acts::detail::isCollectionThatSupportsInsert) +void pushBackOrInsertAtEnd(storage_t& storage, value_t&& value) { storage.insert(std::ranges::end(storage), std::forward(value)); } diff --git a/Core/include/Acts/Surfaces/SurfaceConcept.hpp b/Core/include/Acts/Surfaces/SurfaceConcept.hpp index 2f3117f58c7..2dff4387752 100644 --- a/Core/include/Acts/Surfaces/SurfaceConcept.hpp +++ b/Core/include/Acts/Surfaces/SurfaceConcept.hpp @@ -34,7 +34,7 @@ concept SurfaceConcept = requires(S s, const S cs, S s2, const S cs2, { cs.bounds() } -> std::convertible_to; { cs.associatedDetectorElement() - } -> std::same_as; + } -> std::same_as; { cs.associatedLayer() } -> std::same_as; { s.associateLayer(std::declval()) } -> std::same_as; @@ -42,43 +42,43 @@ concept SurfaceConcept = requires(S s, const S cs, S s2, const S cs2, { cs.surfaceMaterial() } -> std::same_as; { cs.surfaceMaterialSharedPtr() - } -> std::same_as&>; + } -> std::same_as&>; { s.assignSurfaceMaterial( std::declval>()) - } -> std::same_as; + } -> std::same_as; { cs.isOnSurface(gctx, Vector3{}, Vector3{}, tolerance) - } -> std::same_as; + } -> std::same_as; { cs.insideBounds(Vector2{}, tolerance) } -> std::same_as; { cs.localToGlobal(gctx, Vector2{}, Vector3{}) } -> std::same_as; { cs.globalToLocal(gctx, Vector3{}, Vector3{}, double{5}) - } -> std::same_as>; + } -> std::same_as>; { cs.referenceFrame(gctx, Vector3{}, Vector3{}) - } -> std::same_as; + } -> std::same_as; { cs.boundToFreeJacobian(gctx, Vector3{}, Vector3{}) - } -> std::same_as; + } -> std::same_as; { cs.freeToBoundJacobian(gctx, Vector3{}, Vector3{}) - } -> std::same_as; + } -> std::same_as; { cs.freeToPathDerivative(gctx, Vector3{}, Vector3{}) - } -> std::same_as; + } -> std::same_as; { cs.pathCorrection(gctx, Vector3{}, Vector3{}) } -> std::same_as; { cs.intersect(gctx, Vector3{}, Vector3{}, tolerance, std::declval()) - } -> std::same_as; + } -> std::same_as; { cs.toStream(gctx) } -> std::same_as>; @@ -88,32 +88,32 @@ concept SurfaceConcept = requires(S s, const S cs, S s2, const S cs2, { cs.polyhedronRepresentation(gctx, std::declval()) - } -> std::same_as; + } -> std::same_as; { cs.alignmentToBoundDerivative(gctx, Vector3{}, Vector3{}, FreeVector{}) - } -> std::same_as; + } -> std::same_as; { cs.alignmentToPathDerivative(gctx, Vector3{}, Vector3{}) - } -> std::same_as; + } -> std::same_as; { cs.localCartesianToBoundLocalDerivative(gctx, Vector3{}) - } -> std::same_as>; + } -> std::same_as>; }; template -concept RegularSurfaceConcept = SurfaceConcept && - requires(S s, const S cs, GeometryContext gctx) { - { cs.normal(gctx, Vector2{}) } -> std::same_as; +concept RegularSurfaceConcept = + SurfaceConcept && requires(S s, const S cs, GeometryContext gctx) { + { cs.normal(gctx, Vector2{}) } -> std::same_as; - { cs.normal(gctx, Vector3{}) } -> std::same_as; + { cs.normal(gctx, Vector3{}) } -> std::same_as; - { - cs.globalToLocal(gctx, Vector3{}, Vector3{}, std::declval()) - } -> std::same_as>; + { + cs.globalToLocal(gctx, Vector3{}, Vector3{}, std::declval()) + } -> std::same_as>; - { cs.localToGlobal(gctx, Vector2{}) } -> std::same_as; -}; + { cs.localToGlobal(gctx, Vector2{}) } -> std::same_as; + }; } // namespace Acts diff --git a/Core/include/Acts/Surfaces/SurfaceVisitorConcept.hpp b/Core/include/Acts/Surfaces/SurfaceVisitorConcept.hpp index fc945e15cf0..1de5b60d50c 100644 --- a/Core/include/Acts/Surfaces/SurfaceVisitorConcept.hpp +++ b/Core/include/Acts/Surfaces/SurfaceVisitorConcept.hpp @@ -16,12 +16,12 @@ class Surface; template concept SurfaceVisitor = requires(T v) { - {v(std::declval())}; + { v(std::declval()) }; }; template concept MutableSurfaceVisitor = requires(T v) { - {v(std::declval())}; + { v(std::declval()) }; }; } // namespace Acts diff --git a/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp b/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp index 16da26e3d37..ccd05bfbc27 100644 --- a/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp +++ b/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp @@ -685,8 +685,8 @@ class Gx2Fitter { const Gx2FitterOptions& gx2fOptions, TrackContainer& trackContainer) const -> std::enable_if_t< - !_isdn, Result::TrackProxy>> { + !_isdn, Result::TrackProxy>> { // Preprocess Measurements (SourceLinks -> map) // To be able to find measurements later, we put them into a map // We need to copy input SourceLinks anyway, so the map can own them. diff --git a/Core/include/Acts/TrackFitting/KalmanFitter.hpp b/Core/include/Acts/TrackFitting/KalmanFitter.hpp index 3d2ca45711c..453d94b0ad1 100644 --- a/Core/include/Acts/TrackFitting/KalmanFitter.hpp +++ b/Core/include/Acts/TrackFitting/KalmanFitter.hpp @@ -1089,8 +1089,8 @@ class KalmanFitter { const KalmanFitterOptions& kfOptions, TrackContainer& trackContainer) const -> std::enable_if_t< - !_isdn, Result::TrackProxy>> { + !_isdn, Result::TrackProxy>> { // To be able to find measurements later, we put them into a map // We need to copy input SourceLinks anyway, so the map can own them. ACTS_VERBOSE("Preparing " << std::distance(it, end) @@ -1180,8 +1180,8 @@ class KalmanFitter { const std::vector& sSequence, TrackContainer& trackContainer) const -> std::enable_if_t< - _isdn, Result::TrackProxy>> { + _isdn, Result::TrackProxy>> { // To be able to find measurements later, we put them into a map // We need to copy input SourceLinks anyway, so the map can own them. ACTS_VERBOSE("Preparing " << std::distance(it, end) diff --git a/Core/include/Acts/Utilities/Any.hpp b/Core/include/Acts/Utilities/Any.hpp index 3f3383522af..10181638386 100644 --- a/Core/include/Acts/Utilities/Any.hpp +++ b/Core/include/Acts/Utilities/Any.hpp @@ -136,9 +136,7 @@ class AnyBase : public AnyBaseAll { } #if defined(_ACTS_ANY_ENABLE_VERBOSE) - AnyBase() { - _ACTS_ANY_VERBOSE("Default construct this=" << this); - }; + AnyBase() { _ACTS_ANY_VERBOSE("Default construct this=" << this); }; #else AnyBase() = default; #endif @@ -175,9 +173,7 @@ class AnyBase : public AnyBaseAll { return *reinterpret_cast(dataPtr()); } - ~AnyBase() { - destroy(); - } + ~AnyBase() { destroy(); } AnyBase(const AnyBase& other) { if (m_handler == nullptr && other.m_handler == nullptr) { @@ -252,9 +248,7 @@ class AnyBase : public AnyBaseAll { return *this; } - operator bool() const { - return m_handler != nullptr; - } + operator bool() const { return m_handler != nullptr; } private: void* dataPtr() { @@ -265,9 +259,7 @@ class AnyBase : public AnyBaseAll { } } - void setDataPtr(void* ptr) { - *reinterpret_cast(m_data.data()) = ptr; - } + void setDataPtr(void* ptr) { *reinterpret_cast(m_data.data()) = ptr; } const void* dataPtr() const { if (m_handler->heapAllocated) { diff --git a/Core/include/Acts/Utilities/AxisFwd.hpp b/Core/include/Acts/Utilities/AxisFwd.hpp index 0c91aa717b0..3f5dc538fa1 100644 --- a/Core/include/Acts/Utilities/AxisFwd.hpp +++ b/Core/include/Acts/Utilities/AxisFwd.hpp @@ -86,18 +86,18 @@ inline std::ostream& operator<<(std::ostream& os, AxisType type) { template class Axis; -Axis(ActsScalar min, ActsScalar max, std::size_t bins) - ->Axis; +Axis(ActsScalar min, ActsScalar max, + std::size_t bins) -> Axis; template Axis(AxisBoundaryTypeTag /*bdt*/, ActsScalar min, ActsScalar max, std::size_t bins) -> Axis; Axis(std::vector bins) - ->Axis; + -> Axis; template -Axis(AxisBoundaryTypeTag /*bdt*/, std::vector bins) - -> Axis; +Axis(AxisBoundaryTypeTag /*bdt*/, + std::vector bins) -> Axis; } // namespace Acts diff --git a/Core/include/Acts/Utilities/Delegate.hpp b/Core/include/Acts/Utilities/Delegate.hpp index 201016fc40b..29f1a3d4f20 100644 --- a/Core/include/Acts/Utilities/Delegate.hpp +++ b/Core/include/Acts/Utilities/Delegate.hpp @@ -223,7 +223,7 @@ class Delegate { template > void connect(std::unique_ptr instance) { - using member_ptr_type = return_type (Type::*)(Args && ...) const; + using member_ptr_type = return_type (Type::*)(Args &&...) const; static_assert(Concepts::is_detected::value, "Callable given does not correspond exactly to required call " diff --git a/Core/include/Acts/Utilities/GridIterator.hpp b/Core/include/Acts/Utilities/GridIterator.hpp index f373a0c193b..f70c02785a0 100644 --- a/Core/include/Acts/Utilities/GridIterator.hpp +++ b/Core/include/Acts/Utilities/GridIterator.hpp @@ -300,8 +300,8 @@ class GridLocalIterator { }; template -GridGlobalIterator(const Acts::Grid& grid, std::size_t idx) - -> GridGlobalIterator; +GridGlobalIterator(const Acts::Grid& grid, + std::size_t idx) -> GridGlobalIterator; } // namespace Acts diff --git a/Core/include/Acts/Utilities/KDTree.hpp b/Core/include/Acts/Utilities/KDTree.hpp index ddf7e1877af..a3ff86a43fb 100644 --- a/Core/include/Acts/Utilities/KDTree.hpp +++ b/Core/include/Acts/Utilities/KDTree.hpp @@ -180,9 +180,8 @@ class KDTree { /// @param i The iterator to write the output to. template void rangeSearchInserterWithKey(const range_t &r, OutputIt i) const { - rangeSearchMapDiscard(r, [i](const coordinate_t &c, const Type &v) mutable { - i = {c, v}; - }); + rangeSearchMapDiscard( + r, [i](const coordinate_t &c, const Type &v) mutable { i = {c, v}; }); } /// @brief Perform an orthogonal range search within the k-d tree, applying diff --git a/Core/include/Acts/Utilities/detail/MPL/type_collector.hpp b/Core/include/Acts/Utilities/detail/MPL/type_collector.hpp index 3cfcf603f81..28c380d3bbc 100644 --- a/Core/include/Acts/Utilities/detail/MPL/type_collector.hpp +++ b/Core/include/Acts/Utilities/detail/MPL/type_collector.hpp @@ -70,9 +70,8 @@ constexpr auto type_collector = [](auto t_, auto predicate, auto extractor) { * @tparam items The items to filter / collect from. */ template -constexpr auto type_collector_t = type_collector(hana::tuple_t, - helper::predicate, - helper::extractor); +constexpr auto type_collector_t = type_collector( + hana::tuple_t, helper::predicate, helper::extractor); /** * Meta function which returns a compile time bool diff --git a/Core/include/Acts/Vertexing/SingleSeedVertexFinder.ipp b/Core/include/Acts/Vertexing/SingleSeedVertexFinder.ipp index d61d2965255..1206528cd5c 100644 --- a/Core/include/Acts/Vertexing/SingleSeedVertexFinder.ipp +++ b/Core/include/Acts/Vertexing/SingleSeedVertexFinder.ipp @@ -309,14 +309,14 @@ Acts::SingleSeedVertexFinder::findTriplets( triplets.push_back(tr); } } // loop over far spacepoints - } // loop over middle spacepoints - } // loop over near spacepoints - } // loop over far phi slices - } // loop over middle phi slices - } // loop over near phi slices - } // loop over far Z slices - } // loop over near Z slices - } // loop over middle Z slices + } // loop over middle spacepoints + } // loop over near spacepoints + } // loop over far phi slices + } // loop over middle phi slices + } // loop over near phi slices + } // loop over far Z slices + } // loop over near Z slices + } // loop over middle Z slices return triplets; } diff --git a/Core/src/EventData/VectorMultiTrajectory.cpp b/Core/src/EventData/VectorMultiTrajectory.cpp index b778e5787a0..e6c1fb56161 100644 --- a/Core/src/EventData/VectorMultiTrajectory.cpp +++ b/Core/src/EventData/VectorMultiTrajectory.cpp @@ -22,9 +22,8 @@ namespace Acts { -auto VectorMultiTrajectory::addTrackState_impl(TrackStatePropMask mask, - IndexType iprevious) - -> IndexType { +auto VectorMultiTrajectory::addTrackState_impl( + TrackStatePropMask mask, IndexType iprevious) -> IndexType { using PropMask = TrackStatePropMask; m_index.emplace_back(); diff --git a/Core/src/Geometry/LayerCreator.cpp b/Core/src/Geometry/LayerCreator.cpp index a5c194b0323..8c4e3c61bc4 100644 --- a/Core/src/Geometry/LayerCreator.cpp +++ b/Core/src/Geometry/LayerCreator.cpp @@ -394,9 +394,8 @@ Acts::MutableLayerPtr Acts::LayerCreator::planeLayer( Translation3 addTranslation(0., 0., 0.); if (transform.isApprox(Transform3::Identity())) { addTranslation = Translation3(centerX, centerY, centerZ); - ACTS_VERBOSE(" - layer shift = " - << "(" << centerX << ", " << centerY << ", " << centerZ - << ")"); + ACTS_VERBOSE(" - layer shift = " << "(" << centerX << ", " << centerY + << ", " << centerZ << ")"); } std::unique_ptr sArray; diff --git a/Core/src/Vertexing/AdaptiveMultiVertexFitter.cpp b/Core/src/Vertexing/AdaptiveMultiVertexFitter.cpp index 68f1c97091c..6a6a879278a 100644 --- a/Core/src/Vertexing/AdaptiveMultiVertexFitter.cpp +++ b/Core/src/Vertexing/AdaptiveMultiVertexFitter.cpp @@ -159,8 +159,8 @@ Acts::Result Acts::AdaptiveMultiVertexFitter::addVtxToFit( } } } // End for loop over range of associated vertices - } // End loop over trackLinks - } // End loop over lastIterAddedVertices + } // End loop over trackLinks + } // End loop over lastIterAddedVertices lastIterAddedVertices = currentIterAddedVertices; currentIterAddedVertices.clear(); diff --git a/Examples/Algorithms/Digitization/src/ModuleClusters.cpp b/Examples/Algorithms/Digitization/src/ModuleClusters.cpp index b880a1534f4..f82ec7063c4 100644 --- a/Examples/Algorithms/Digitization/src/ModuleClusters.cpp +++ b/Examples/Algorithms/Digitization/src/ModuleClusters.cpp @@ -219,7 +219,7 @@ std::vector> ModuleClusters::mergeParameters( thisvec.push_back(std::move(values.at(j))); } } // Loop on `j' - } // Loop on `i' + } // Loop on `i' return retv; } diff --git a/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/Geant4Manager.hpp b/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/Geant4Manager.hpp index 44aaebd3e45..b9d6f427547 100644 --- a/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/Geant4Manager.hpp +++ b/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/Geant4Manager.hpp @@ -82,8 +82,8 @@ class Geant4Manager { const std::string &name) const; /// Get the current list of physics list factories. - const std::unordered_map> - &getPhysicsListFactories() const; + const std::unordered_map> & + getPhysicsListFactories() const; private: Geant4Manager(); diff --git a/Examples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp index eb1067f2461..821592cb6d3 100644 --- a/Examples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp @@ -106,15 +106,15 @@ ActsExamples::ProcessCode ActsExamples::GbtsSeedingAlgorithm::execute( // } for (auto sp : GbtsSpacePoints) { - ACTS_DEBUG("Gbts space points: " - << " Gbts_id: " << sp.gbtsID << " z: " << sp.SP->z() - << " r: " << sp.SP->r() << " ACTS volume: " - << sp.SP->sourceLinks() - .front() - .get() - .geometryId() - .volume() - << "\n"); + ACTS_DEBUG("Gbts space points: " << " Gbts_id: " << sp.gbtsID << " z: " + << sp.SP->z() << " r: " << sp.SP->r() + << " ACTS volume: " + << sp.SP->sourceLinks() + .front() + .get() + .geometryId() + .volume() + << "\n"); } // this is now calling on a core algorithm diff --git a/Examples/Framework/src/Framework/Sequencer.cpp b/Examples/Framework/src/Framework/Sequencer.cpp index f1a3576e38e..e0c3231faf5 100644 --- a/Examples/Framework/src/Framework/Sequencer.cpp +++ b/Examples/Framework/src/Framework/Sequencer.cpp @@ -619,10 +619,9 @@ void Sequencer::fpeReport() const { std::vector> sorted; - std::transform( - merged.stackTraces().begin(), merged.stackTraces().end(), - std::back_inserter(sorted), - [](const auto& f) -> const auto& { return f; }); + std::transform(merged.stackTraces().begin(), merged.stackTraces().end(), + std::back_inserter(sorted), + [](const auto& f) -> const auto& { return f; }); std::sort(sorted.begin(), sorted.end(), [](const auto& a, const auto& b) { return a.get().count > b.get().count; }); diff --git a/Examples/Io/Root/src/RootBFieldWriter.cpp b/Examples/Io/Root/src/RootBFieldWriter.cpp index 59d7090c05f..6704180811f 100644 --- a/Examples/Io/Root/src/RootBFieldWriter.cpp +++ b/Examples/Io/Root/src/RootBFieldWriter.cpp @@ -189,8 +189,8 @@ void RootBFieldWriter::run(const Config& config, Bz = bField.z() / Acts::UnitConstants::T; outputTree->Fill(); } // for z - } // for y - } // for x + } // for y + } // for x } else { ACTS_INFO("Map will be written out in cylinder coordinates (r,z)."); @@ -271,7 +271,7 @@ void RootBFieldWriter::run(const Config& config, Br = VectorHelpers::perp(bField) / Acts::UnitConstants::T; outputTree->Fill(); } // for R - } // for z + } // for z } // Tear down ROOT I/O diff --git a/Examples/Python/include/Acts/Plugins/Python/Utilities.hpp b/Examples/Python/include/Acts/Plugins/Python/Utilities.hpp index b0e0e7c51ce..8cd5d4202db 100644 --- a/Examples/Python/include/Acts/Plugins/Python/Utilities.hpp +++ b/Examples/Python/include/Acts/Plugins/Python/Utilities.hpp @@ -34,10 +34,7 @@ template void pythonRangeProperty(T& obj, const std::string& name, Ur Ut::*begin, Ur Ut::*end) { obj.def_property( - name.c_str(), - [=](Ut& self) { - return std::pair{self.*begin, self.*end}; - }, + name.c_str(), [=](Ut& self) { return std::pair{self.*begin, self.*end}; }, [=](Ut& self, std::pair p) { self.*begin = p.first; self.*end = p.second; diff --git a/Examples/Python/src/Generators.cpp b/Examples/Python/src/Generators.cpp index c450f856e98..e6f02fb6900 100644 --- a/Examples/Python/src/Generators.cpp +++ b/Examples/Python/src/Generators.cpp @@ -159,28 +159,21 @@ void addGenerators(Context& ctx) { .def_readwrite("mass", &Config::mass) .def_readwrite("charge", &Config::charge) .def_property( - "p", - [](Config& cfg) { - return std::pair{cfg.pMin, cfg.pMax}; - }, + "p", [](Config& cfg) { return std::pair{cfg.pMin, cfg.pMax}; }, [](Config& cfg, std::pair value) { cfg.pMin = value.first; cfg.pMax = value.second; }) .def_property( "phi", - [](Config& cfg) { - return std::pair{cfg.phiMin, cfg.phiMax}; - }, + [](Config& cfg) { return std::pair{cfg.phiMin, cfg.phiMax}; }, [](Config& cfg, std::pair value) { cfg.phiMin = value.first; cfg.phiMax = value.second; }) .def_property( "theta", - [](Config& cfg) { - return std::pair{cfg.thetaMin, cfg.thetaMax}; - }, + [](Config& cfg) { return std::pair{cfg.thetaMin, cfg.thetaMax}; }, [](Config& cfg, std::pair value) { cfg.thetaMin = value.first; cfg.thetaMax = value.second; diff --git a/Examples/Python/src/Json.cpp b/Examples/Python/src/Json.cpp index 864812c6a1a..fce16c5d558 100644 --- a/Examples/Python/src/Json.cpp +++ b/Examples/Python/src/Json.cpp @@ -219,18 +219,17 @@ void addJson(Context& ctx) { } { - mex.def( - "readDetectorFromJson", - [](const Acts::GeometryContext& gctx, - const std::string& fileName) -> auto{ - auto in = std::ifstream(fileName, - std::ifstream::in | std::ifstream::binary); - nlohmann::json jDetectorIn; - in >> jDetectorIn; - in.close(); - - return Acts::DetectorJsonConverter::fromJson(gctx, jDetectorIn); - }); + mex.def("readDetectorFromJson", + [](const Acts::GeometryContext& gctx, + const std::string& fileName) -> auto { + auto in = std::ifstream( + fileName, std::ifstream::in | std::ifstream::binary); + nlohmann::json jDetectorIn; + in >> jDetectorIn; + in.close(); + + return Acts::DetectorJsonConverter::fromJson(gctx, jDetectorIn); + }); } } } // namespace Acts::Python diff --git a/Examples/Python/src/TrackFinding.cpp b/Examples/Python/src/TrackFinding.cpp index 807ba6ee43f..5a0e6ec59b9 100644 --- a/Examples/Python/src/TrackFinding.cpp +++ b/Examples/Python/src/TrackFinding.cpp @@ -337,20 +337,21 @@ void addTrackFinding(Context& ctx) { } { - auto constructor = [](const std::vector, - std::vector, - std::vector>>>& input) { - std::vector> - converted; - converted.reserve(input.size()); - for (const auto& [id, cuts] : input) { - const auto& [bins, chi2, num] = cuts; - converted.emplace_back(id, MeasurementSelectorCuts{bins, chi2, num}); - } - return std::make_unique(converted); - }; + auto constructor = + [](const std::vector< + std::pair, std::vector, + std::vector>>>& input) { + std::vector> + converted; + converted.reserve(input.size()); + for (const auto& [id, cuts] : input) { + const auto& [bins, chi2, num] = cuts; + converted.emplace_back(id, + MeasurementSelectorCuts{bins, chi2, num}); + } + return std::make_unique(converted); + }; py::class_(m, "MeasurementSelectorCuts") .def(py::init<>()) diff --git a/Plugins/FpeMonitoring/src/FpeMonitor.cpp b/Plugins/FpeMonitoring/src/FpeMonitor.cpp index 77c78a5ff6e..2940492c1e3 100644 --- a/Plugins/FpeMonitoring/src/FpeMonitor.cpp +++ b/Plugins/FpeMonitoring/src/FpeMonitor.cpp @@ -133,8 +133,8 @@ unsigned int FpeMonitor::Result::numStackTraces() const { return m_stracktraces.size(); } -const std::vector - &FpeMonitor::Result::stackTraces() const { +const std::vector & +FpeMonitor::Result::stackTraces() const { return m_stracktraces; } @@ -167,11 +167,11 @@ void FpeMonitor::Result::deduplicate() { m_stracktraces.clear(); for (auto &info : copy) { - auto it = std::find_if( - m_stracktraces.begin(), m_stracktraces.end(), - [&info](const FpeInfo &el) { - return areFpesEquivalent({el.type, *el.st}, {info.type, *info.st}); - }); + auto it = std::find_if(m_stracktraces.begin(), m_stracktraces.end(), + [&info](const FpeInfo &el) { + return areFpesEquivalent({el.type, *el.st}, + {info.type, *info.st}); + }); if (it != m_stracktraces.end()) { it->count += info.count; continue; diff --git a/Plugins/Onnx/include/Acts/Plugins/Onnx/SeedClassifier.hpp b/Plugins/Onnx/include/Acts/Plugins/Onnx/SeedClassifier.hpp index 77dfef6c51d..85d22116829 100644 --- a/Plugins/Onnx/include/Acts/Plugins/Onnx/SeedClassifier.hpp +++ b/Plugins/Onnx/include/Acts/Plugins/Onnx/SeedClassifier.hpp @@ -24,7 +24,7 @@ class SeedClassifier { /// @param modelPath path to the model file SeedClassifier(const char* modelPath) : m_env(ORT_LOGGING_LEVEL_WARNING, "MLSeedClassifier"), - m_duplicateClassifier(m_env, modelPath){}; + m_duplicateClassifier(m_env, modelPath) {}; /// Compute a score for each seed to be used in the seed selection /// diff --git a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/LineSurfaceStub.hpp b/Tests/CommonHelpers/Acts/Tests/CommonHelpers/LineSurfaceStub.hpp index 4070074539c..55448f11445 100644 --- a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/LineSurfaceStub.hpp +++ b/Tests/CommonHelpers/Acts/Tests/CommonHelpers/LineSurfaceStub.hpp @@ -19,32 +19,27 @@ class LineSurfaceStub : public LineSurface { LineSurfaceStub() = delete; // LineSurfaceStub(const Transform3& htrans, double radius, double halfz) - : GeometryObject(), LineSurface(htrans, radius, halfz) { /* nop */ - } + : GeometryObject(), LineSurface(htrans, radius, halfz) { /* nop */ } // LineSurfaceStub(const Transform3& htrans, std::shared_ptr lbounds = nullptr) - : GeometryObject(), LineSurface(htrans, std::move(lbounds)) { /*nop */ - } + : GeometryObject(), LineSurface(htrans, std::move(lbounds)) { /*nop */ } // LineSurfaceStub(std::shared_ptr lbounds, const DetectorElementBase& detelement) : GeometryObject(), - LineSurface(std::move(lbounds), detelement) { /* nop */ - } + LineSurface(std::move(lbounds), detelement) { /* nop */ } // LineSurfaceStub(const LineSurfaceStub& ls) - : GeometryObject(), LineSurface(ls) { /* nop */ - } + : GeometryObject(), LineSurface(ls) { /* nop */ } LineSurfaceStub& operator=(const LineSurfaceStub& ls) = default; // LineSurfaceStub(const GeometryContext& gctx, const LineSurfaceStub& ls, const Transform3& t) - : GeometryObject(), LineSurface(gctx, ls, t) { /* nop */ - } + : GeometryObject(), LineSurface(gctx, ls, t) { /* nop */ } /// Return method for the Surface type to avoid dynamic casts SurfaceType type() const final { return Surface::Straw; } diff --git a/Tests/UnitTests/Core/Detector/CuboidalDetectorFromBlueprintTests.cpp b/Tests/UnitTests/Core/Detector/CuboidalDetectorFromBlueprintTests.cpp index 3365afeedcb..aba5426de06 100644 --- a/Tests/UnitTests/Core/Detector/CuboidalDetectorFromBlueprintTests.cpp +++ b/Tests/UnitTests/Core/Detector/CuboidalDetectorFromBlueprintTests.cpp @@ -32,7 +32,7 @@ class SurfaceBuilder : public Acts::Experimental::IInternalStructureBuilder { public: SurfaceBuilder(const Acts::Transform3& transform, const Acts::RectangleBounds& sBounds) - : m_transform(transform), m_surfaceBounds(sBounds){}; + : m_transform(transform), m_surfaceBounds(sBounds) {}; /// Conrstruct and return the internal structure creation /// diff --git a/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp b/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp index d4f5572d0cf..98c10e33767 100644 --- a/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp +++ b/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp @@ -236,9 +236,7 @@ BOOST_AUTO_TEST_CASE(VolumeMaterialMapper_comparison_tests) { // Build the material grid Grid3D Grid = createGrid(xAxis, yAxis, zAxis); std::function transfoGlobalToLocal = - [](Vector3 pos) -> Vector3 { - return {pos.x(), pos.y(), pos.z()}; - }; + [](Vector3 pos) -> Vector3 { return {pos.x(), pos.y(), pos.z()}; }; // Walk over each property for (const auto& rm : matRecord) { diff --git a/Tests/UnitTests/Core/Surfaces/SurfaceBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/SurfaceBoundsTests.cpp index 9578acf1ffb..5b49bd16da0 100644 --- a/Tests/UnitTests/Core/Surfaces/SurfaceBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/SurfaceBoundsTests.cpp @@ -38,12 +38,8 @@ class SurfaceBoundsStub : public SurfaceBounds { #endif ~SurfaceBoundsStub() override = default; - BoundsType type() const final { - return SurfaceBounds::eOther; - } - std::vector values() const override { - return m_values; - } + BoundsType type() const final { return SurfaceBounds::eOther; } + std::vector values() const override { return m_values; } bool inside(const Vector2& /*lpos*/, const BoundaryTolerance& /*boundaryTolerance*/) const final { return true; diff --git a/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp b/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp index 048f29c99b2..bef7ba52cd6 100644 --- a/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp +++ b/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp @@ -210,7 +210,7 @@ struct FitterTester { if (doDiag) { doTest(true); - } // with reversed & smoothed columns + } // with reversed & smoothed columns doTest(false); // without the extra columns } diff --git a/Tests/UnitTests/Core/TrackFitting/GainMatrixUpdaterTests.cpp b/Tests/UnitTests/Core/TrackFitting/GainMatrixUpdaterTests.cpp index 859f17fa320..3cebdd61325 100644 --- a/Tests/UnitTests/Core/TrackFitting/GainMatrixUpdaterTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/GainMatrixUpdaterTests.cpp @@ -76,8 +76,7 @@ BOOST_AUTO_TEST_CASE(Update) { // Gain matrix update and filtered state BOOST_CHECK(GainMatrixUpdater() - . - operator()(tgContext, ts) + .operator()(tgContext, ts) .ok()); // Check for regression. This does NOT test if the math is correct, just that @@ -127,8 +126,7 @@ BOOST_AUTO_TEST_CASE(UpdateFailed) { // Gain matrix update and filtered state BOOST_CHECK(GainMatrixUpdater() - . - operator()(tgContext, ts) + .operator()(tgContext, ts) .error() == KalmanFitterError::UpdateFailed); } diff --git a/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp b/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp index bffbdb2a8aa..d9fc6581dc1 100644 --- a/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp @@ -148,8 +148,8 @@ auto circularMean(const std::vector> &samples) -> ActsVector { // subtraction object to enable circular behaviour template >> auto boundCov(const std::vector> &samples, - const ActsVector &mu, const subtract_t &sub = subtract_t{}) - -> ActsSquareMatrix { + const ActsVector &mu, + const subtract_t &sub = subtract_t{}) -> ActsSquareMatrix { ActsSquareMatrix boundCov = ActsSquareMatrix::Zero(); for (const auto &smpl : samples) { diff --git a/Tests/UnitTests/Core/Utilities/AlgebraHelpersTests.cpp b/Tests/UnitTests/Core/Utilities/AlgebraHelpersTests.cpp index 978a27953ed..c195be14f84 100644 --- a/Tests/UnitTests/Core/Utilities/AlgebraHelpersTests.cpp +++ b/Tests/UnitTests/Core/Utilities/AlgebraHelpersTests.cpp @@ -78,14 +78,13 @@ BOOST_AUTO_TEST_CASE(SafeInverseFPESmallMatrix) { BOOST_CHECK(mInv); BOOST_CHECK(!mInvInv); - ACTS_VERBOSE("Test: SafeInverseFPESmallMatrix" - << "\n" - << "m:\n" - << m << "\n" - << "mInv:\n" - << *mInv << "\n" - << "mInvInv [garbage]:\n" - << *mInvInv); + ACTS_VERBOSE("Test: SafeInverseFPESmallMatrix" << "\n" + << "m:\n" + << m << "\n" + << "mInv:\n" + << *mInv << "\n" + << "mInvInv [garbage]:\n" + << *mInvInv); } BOOST_AUTO_TEST_CASE(SafeInverseFPELargeMatrix) { @@ -97,12 +96,11 @@ BOOST_AUTO_TEST_CASE(SafeInverseFPELargeMatrix) { BOOST_CHECK(!mInv); - ACTS_VERBOSE("Test: SafeInverseFPELargeMatrix" - << "\n" - << "m:\n" - << m << "\n" - << "mInv [garbage]:\n" - << *mInv); + ACTS_VERBOSE("Test: SafeInverseFPELargeMatrix" << "\n" + << "m:\n" + << m << "\n" + << "mInv [garbage]:\n" + << *mInv); } /// This test should not compile diff --git a/Tests/UnitTests/Plugins/Json/MaterialMapJsonConverterTests.cpp b/Tests/UnitTests/Plugins/Json/MaterialMapJsonConverterTests.cpp index 9b8e2d376a5..7d0ffd19ac0 100644 --- a/Tests/UnitTests/Plugins/Json/MaterialMapJsonConverterTests.cpp +++ b/Tests/UnitTests/Plugins/Json/MaterialMapJsonConverterTests.cpp @@ -26,10 +26,10 @@ class IVolumeMaterial; class DummyDecorator : public Acts::IVolumeMaterialJsonDecorator { public: void decorate([[maybe_unused]] const Acts::ISurfaceMaterial &material, - [[maybe_unused]] nlohmann::json &json) const override{}; + [[maybe_unused]] nlohmann::json &json) const override {}; void decorate([[maybe_unused]] const Acts::IVolumeMaterial &material, - [[maybe_unused]] nlohmann::json &json) const override{}; + [[maybe_unused]] nlohmann::json &json) const override {}; }; BOOST_AUTO_TEST_SUITE(MaterialMapJsonConverter)