diff --git a/test/hepmc/edm4hep_testhepmc.cc b/test/hepmc/edm4hep_testhepmc.cc index 353a554fe..4828cf49b 100644 --- a/test/hepmc/edm4hep_testhepmc.cc +++ b/test/hepmc/edm4hep_testhepmc.cc @@ -114,7 +114,7 @@ int main() { std::cout << "Converting particle with PDG ID: " << particle_i->pdg_id() << std::endl; std::cout << "\t and id: " << particle_i->id() << std::endl; - if (hepmcToEdmMap.find(particle_i->id()) == hepmcToEdmMap.end()) { + if (!hepmcToEdmMap.contains(particle_i->id())) { auto edm_particle = convert(particle_i); hepmcToEdmMap.insert({particle_i->id(), edm_particle}); } @@ -124,7 +124,7 @@ int main() { if (nullptr != prodvertex) { for (auto particle_mother : prodvertex->particles_in()) { - if (hepmcToEdmMap.find(particle_mother->id()) == hepmcToEdmMap.end()) { + if (!hepmcToEdmMap.contains(particle_mother->id())) { auto edm_particle = convert(particle_mother); hepmcToEdmMap.insert({particle_mother->id(), edm_particle}); } @@ -136,7 +136,7 @@ int main() { if (nullptr != prodvertex) { for (auto particle_daughter : prodvertex->particles_in()) { - if (hepmcToEdmMap.find(particle_daughter->id()) == hepmcToEdmMap.end()) { + if (!hepmcToEdmMap.contains(particle_daughter->id())) { auto edm_particle = convert(particle_daughter); hepmcToEdmMap.insert({particle_daughter->id(), edm_particle}); } diff --git a/utils/src/ParticleIDUtils.cc b/utils/src/ParticleIDUtils.cc index d4da00a36..2ec1b6952 100644 --- a/utils/src/ParticleIDUtils.cc +++ b/utils/src/ParticleIDUtils.cc @@ -29,7 +29,7 @@ ParticleIDMeta::ParticleIDMeta(const std::string& algName, const std::vector getParamIndex(const ParticleIDMeta& pidMetaInfo, const std::string& param) { - const auto nameIt = std::find(pidMetaInfo.paramNames.begin(), pidMetaInfo.paramNames.end(), param); + const auto nameIt = std::ranges::find(pidMetaInfo.paramNames, param); if (nameIt != pidMetaInfo.paramNames.end()) { return std::distance(pidMetaInfo.paramNames.begin(), nameIt); }