From 39a5fbd753beecca91fb13730620ee0c825db7fd Mon Sep 17 00:00:00 2001 From: Bastian Schlag <bastian.schlag@cern.ch> Date: Sun, 1 Mar 2020 00:40:17 +0100 Subject: [PATCH] remove unnecessary const keyword in vector of BoundParameters --- Core/include/Acts/Vertexing/GaussianTrackDensity.hpp | 10 ++++------ Core/include/Acts/Vertexing/TrackDensity.hpp | 8 ++++---- .../Acts/Vertexing/TrackDensityVertexFinder.ipp | 2 +- Core/src/Vertexing/GaussianTrackDensity.cpp | 9 +++------ 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/Core/include/Acts/Vertexing/GaussianTrackDensity.hpp b/Core/include/Acts/Vertexing/GaussianTrackDensity.hpp index f30d03b78..6ac751d13 100644 --- a/Core/include/Acts/Vertexing/GaussianTrackDensity.hpp +++ b/Core/include/Acts/Vertexing/GaussianTrackDensity.hpp @@ -50,9 +50,8 @@ class GaussianTrackDensity { /// @param state The GaussianTrackDensity state /// /// @return The z position of the maximum - double globalMaximum( - const std::vector<const Acts::BoundParameters>& trackList, - State& state) const; + double globalMaximum(const std::vector<Acts::BoundParameters>& trackList, + State& state) const; /// @brief Calculates the global maximum with width /// @@ -61,8 +60,7 @@ class GaussianTrackDensity { /// /// @return The z position of the maximum and its width std::pair<double, double> globalMaximumWithWidth( - const std::vector<const Acts::BoundParameters>& trackList, - State& state) const; + const std::vector<Acts::BoundParameters>& trackList, State& state) const; private: /// The configuration @@ -72,7 +70,7 @@ class GaussianTrackDensity { /// /// @param trackList The list of tracks /// @param state The GaussianTrackDensity state - void addTracks(const std::vector<const Acts::BoundParameters>& trackList, + void addTracks(const std::vector<Acts::BoundParameters>& trackList, State& state) const; }; } // namespace Acts diff --git a/Core/include/Acts/Vertexing/TrackDensity.hpp b/Core/include/Acts/Vertexing/TrackDensity.hpp index 574439ec5..ad6d08cbe 100644 --- a/Core/include/Acts/Vertexing/TrackDensity.hpp +++ b/Core/include/Acts/Vertexing/TrackDensity.hpp @@ -66,9 +66,9 @@ class TrackDensity { } }; - using TrackMap = std::map<BoundParameters, TrackEntry, predPerigee>; - using LowerMap = std::map<TrackEntry, BoundParameters, predEntryByMax>; - using UpperMap = std::map<TrackEntry, BoundParameters, predEntryByMin>; + using TrackMap = std::map<const BoundParameters, TrackEntry, predPerigee>; + using LowerMap = std::map<TrackEntry, const BoundParameters, predEntryByMax>; + using UpperMap = std::map<TrackEntry, const BoundParameters, predEntryByMin>; /// @brief The Config struct struct Config { @@ -82,7 +82,7 @@ class TrackDensity { double maxZRange = 0; // Maps to cache track information - std::set<BoundParameters, predPerigee> trackSet; + std::set<const BoundParameters, predPerigee> trackSet; LowerMap lowerMap; UpperMap upperMap; }; diff --git a/Core/include/Acts/Vertexing/TrackDensityVertexFinder.ipp b/Core/include/Acts/Vertexing/TrackDensityVertexFinder.ipp index d2e957f29..ed26c5631 100644 --- a/Core/include/Acts/Vertexing/TrackDensityVertexFinder.ipp +++ b/Core/include/Acts/Vertexing/TrackDensityVertexFinder.ipp @@ -13,7 +13,7 @@ auto Acts::TrackDensityVertexFinder<vfitter_t, track_density_t>::find( -> Result<std::vector<Vertex<InputTrack_t>>> { typename track_density_t::State densityState; - std::vector<const BoundParameters> trackList; + std::vector<BoundParameters> trackList; trackList.reserve(trackVector.size()); for (const auto& trk : trackVector) { diff --git a/Core/src/Vertexing/GaussianTrackDensity.cpp b/Core/src/Vertexing/GaussianTrackDensity.cpp index b36a85c37..44a080f9c 100644 --- a/Core/src/Vertexing/GaussianTrackDensity.cpp +++ b/Core/src/Vertexing/GaussianTrackDensity.cpp @@ -9,22 +9,19 @@ #include "Acts/Vertexing/GaussianTrackDensity.hpp" double Acts::GaussianTrackDensity::globalMaximum( - const std::vector<const Acts::BoundParameters>& trackList, - State& state) const { + const std::vector<Acts::BoundParameters>& trackList, State& state) const { addTracks(trackList, state); return state.trackDensity.globalMaximum(state.trackDensityState); } std::pair<double, double> Acts::GaussianTrackDensity::globalMaximumWithWidth( - const std::vector<const Acts::BoundParameters>& trackList, - State& state) const { + const std::vector<Acts::BoundParameters>& trackList, State& state) const { addTracks(trackList, state); return state.trackDensity.globalMaximumWithWidth(state.trackDensityState); } void Acts::GaussianTrackDensity::addTracks( - const std::vector<const Acts::BoundParameters>& trackList, - State& state) const { + const std::vector<Acts::BoundParameters>& trackList, State& state) const { const double d0SignificanceCut = m_cfg.d0MaxSignificance * m_cfg.d0MaxSignificance; const double z0SignificanceCut = -- GitLab