diff --git a/Examples/Algorithms/Utilities/src/HitSelector.cpp b/Examples/Algorithms/Utilities/src/HitSelector.cpp index 69ce9a1916f..1da7e059483 100644 --- a/Examples/Algorithms/Utilities/src/HitSelector.cpp +++ b/Examples/Algorithms/Utilities/src/HitSelector.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2019-2024 CERN for the benefit of the Acts project +// Copyright (C) 2019-2023 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -8,8 +8,6 @@ #include "ActsExamples/Utilities/HitSelector.hpp" -#include - ActsExamples::HitSelector::HitSelector(const Config& config, Acts::Logging::Level level) : IAlgorithm("HitSelector", level), m_cfg(config) { @@ -22,10 +20,9 @@ ActsExamples::ProcessCode ActsExamples::HitSelector::execute( const auto& hits = m_inputHits(ctx); SimHitContainer selectedHits; - std::ranges::copy(hits | std::ranges::views::filter([&](const auto& hit) { - return hit.time() < m_cfg.maxTime; - }), - std::inserter(selectedHits, selectedHits.begin())); + std::copy_if(hits.begin(), hits.end(), + std::inserter(selectedHits, selectedHits.begin()), + [&](const auto& hit) { return hit.time() < m_cfg.maxTime; }); ACTS_DEBUG("selected " << selectedHits.size() << " from " << hits.size() << " hits"); diff --git a/Fatras/include/ActsFatras/Kernel/ContinuousProcess.hpp b/Fatras/include/ActsFatras/Kernel/ContinuousProcess.hpp index bac20422b7c..570d509d883 100644 --- a/Fatras/include/ActsFatras/Kernel/ContinuousProcess.hpp +++ b/Fatras/include/ActsFatras/Kernel/ContinuousProcess.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2018-2024 CERN for the benefit of the Acts project +// Copyright (C) 2018-2020 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -11,8 +11,6 @@ #include "Acts/Material/MaterialSlab.hpp" #include "ActsFatras/EventData/Particle.hpp" -#include - namespace ActsFatras { /// A continuous simulation process based on a physics model plus selectors. @@ -72,9 +70,8 @@ struct ContinuousProcess { // modify particle according to the physics process auto children = physics(generator, slab, particle); // move selected child particles to the output container - std::ranges::copy( - children | std::ranges::views::filter(selectChildParticle), - std::back_inserter(generated)); + std::copy_if(std::begin(children), std::end(children), + std::back_inserter(generated), selectChildParticle); // break condition is defined by whether the output particle is still valid // or not e.g. because it has fallen below a momentum threshold. return !selectOutputParticle(particle); diff --git a/Fatras/include/ActsFatras/Kernel/Simulation.hpp b/Fatras/include/ActsFatras/Kernel/Simulation.hpp index 7571a0d2991..c60bed02b9f 100644 --- a/Fatras/include/ActsFatras/Kernel/Simulation.hpp +++ b/Fatras/include/ActsFatras/Kernel/Simulation.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2018-2024 CERN for the benefit of the Acts project +// Copyright (C) 2018-2021 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -29,7 +29,6 @@ #include #include #include -#include #include namespace ActsFatras { @@ -289,13 +288,10 @@ struct Simulation { // store final particle state at the end of the simulation particlesFinal.push_back(result.particle); // move generated secondaries that should be simulated to the output - std::ranges::copy( - result.generatedParticles | - std::ranges::views::filter([this](const Particle &particle) { - return selectParticle(particle); - }), - std::back_inserter(particlesInitial)); - + std::copy_if( + result.generatedParticles.begin(), result.generatedParticles.end(), + std::back_inserter(particlesInitial), + [this](const Particle &particle) { return selectParticle(particle); }); std::copy(result.hits.begin(), result.hits.end(), std::back_inserter(hits)); }