diff --git a/Core/include/Acts/TrackFinding/TrackParamsLookupAccumulator.hpp b/Core/include/Acts/TrackFinding/TrackParamsLookupAccumulator.hpp index 228fbca21ac..3984c8f8f70 100644 --- a/Core/include/Acts/TrackFinding/TrackParamsLookupAccumulator.hpp +++ b/Core/include/Acts/TrackFinding/TrackParamsLookupAccumulator.hpp @@ -81,7 +81,8 @@ class TrackParamsLookupAccumulator { typename grid_t::value_type::first_type>::element_type; /// @brief Constructor - TrackParamsLookupAccumulator(grid_t grid) : m_grid(std::move(grid)) {} + explicit TrackParamsLookupAccumulator(grid_t grid) + : m_grid(std::move(grid)) {} /// @brief Add track parameters to the accumulator /// diff --git a/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackParamsLookupEstimation.hpp b/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackParamsLookupEstimation.hpp index fcf1489f042..e50991cd944 100644 --- a/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackParamsLookupEstimation.hpp +++ b/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackParamsLookupEstimation.hpp @@ -51,9 +51,6 @@ class TrackParamsLookupEstimation : public IAlgorithm { /// @brief Constructor TrackParamsLookupEstimation(const Config& config, Acts::Logging::Level level); - /// @brief Destructor - ~TrackParamsLookupEstimation() = default; - /// @brief The execute method ProcessCode execute(const AlgorithmContext& ctx) const override; diff --git a/Examples/Algorithms/TrackFinding/src/TrackParamsLookupEstimation.cpp b/Examples/Algorithms/TrackFinding/src/TrackParamsLookupEstimation.cpp index 44622aacdb3..4e4b283ddf9 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackParamsLookupEstimation.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackParamsLookupEstimation.cpp @@ -13,8 +13,7 @@ ActsExamples::TrackParamsLookupEstimation::TrackParamsLookupEstimation( const Config& config, Acts::Logging::Level level) - : IAlgorithm("TrackParamsLookupEstimation", level), - m_cfg(std::move(config)) { + : IAlgorithm("TrackParamsLookupEstimation", level), m_cfg(config) { // Iterate over the reference layers and create // track parameter accumulators for (const auto& [geoId, refSurface] : m_cfg.refLayers) { @@ -52,7 +51,7 @@ ActsExamples::TrackParamsLookupEstimation::finalize() { for (auto& [id, acc] : m_accumulators) { lookup.insert({id, acc->finalizeLookup()}); } - for (auto& writer : m_cfg.trackLookupGridWriters) { + for (const auto& writer : m_cfg.trackLookupGridWriters) { writer->writeLookup(lookup); } diff --git a/Examples/Io/Json/include/ActsExamples/Io/Json/JsonTrackParamsLookupReader.hpp b/Examples/Io/Json/include/ActsExamples/Io/Json/JsonTrackParamsLookupReader.hpp index eca5fc01894..a07edd9a2a7 100644 --- a/Examples/Io/Json/include/ActsExamples/Io/Json/JsonTrackParamsLookupReader.hpp +++ b/Examples/Io/Json/include/ActsExamples/Io/Json/JsonTrackParamsLookupReader.hpp @@ -35,7 +35,7 @@ class JsonTrackParamsLookupReader final : public ITrackParamsLookupReader { std::pair bins; }; - JsonTrackParamsLookupReader(const Config& config) : m_cfg(config) {}; + explicit JsonTrackParamsLookupReader(const Config& config) : m_cfg(config) {}; ~JsonTrackParamsLookupReader() override = default; @@ -44,7 +44,7 @@ class JsonTrackParamsLookupReader final : public ITrackParamsLookupReader { /// @param path path to the json file /// /// @return lookup table for track parameter estimation - TrackParamsLookup readLookup(const std::string& path) final { + TrackParamsLookup readLookup(const std::string& path) override { // Read the json file std::ifstream ifj(path); nlohmann::json jLookup; @@ -55,7 +55,7 @@ class JsonTrackParamsLookupReader final : public ITrackParamsLookupReader { for (const auto& jGrid : jLookup) { Acts::GeometryIdentifier id(jGrid["geo_id"]); - if (m_cfg.refLayers.find(id) == m_cfg.refLayers.end()) { + if (m_cfg.refLayers.contains(id)) { throw std::invalid_argument("Geometry identifier not found"); } @@ -84,7 +84,7 @@ class JsonTrackParamsLookupReader final : public ITrackParamsLookupReader { TrackParamsLookupPair>( jGrid["grid"], axisGen); - lookup.insert({id, std::move(grid)}); + lookup.try_emplace(id, std::move(grid)); } return lookup; diff --git a/Examples/Io/Json/include/ActsExamples/Io/Json/JsonTrackParamsLookupWriter.hpp b/Examples/Io/Json/include/ActsExamples/Io/Json/JsonTrackParamsLookupWriter.hpp index 1708d1a49fe..63a2c083618 100644 --- a/Examples/Io/Json/include/ActsExamples/Io/Json/JsonTrackParamsLookupWriter.hpp +++ b/Examples/Io/Json/include/ActsExamples/Io/Json/JsonTrackParamsLookupWriter.hpp @@ -33,7 +33,7 @@ class JsonTrackParamsLookupWriter final : public ITrackParamsLookupWriter { /// Constructor /// /// @param config The configuration struct of the writer - JsonTrackParamsLookupWriter(const Config& config) : m_cfg(config) {}; + explicit JsonTrackParamsLookupWriter(const Config& config) : m_cfg(config) {}; /// Virtual destructor ~JsonTrackParamsLookupWriter() override = default; @@ -41,7 +41,7 @@ class JsonTrackParamsLookupWriter final : public ITrackParamsLookupWriter { /// Write out track parameters lookup table /// /// @param lookup The lookup to write - void writeLookup(const TrackParamsLookup& lookup) const final { + void writeLookup(const TrackParamsLookup& lookup) const override { nlohmann::json jLookup; // Iterate over the lookup and serialize the grids