diff --git a/Documentation/Examples/particle_list_example.cc b/Documentation/Examples/particle_list_example.cc index 8ba18fa3c2c88ad074af5d4723ed4f02275fab58..c9fc8812d864913b3af61d61193e81b2ae806e22 100644 --- a/Documentation/Examples/particle_list_example.cc +++ b/Documentation/Examples/particle_list_example.cc @@ -38,7 +38,7 @@ int main() { << " | " << std::setw(18) << "SIBYLL-mass (GeV)" << " | " << endl; cout << std::setw(104) << std::setfill('-') << "-" << endl; - for (auto p : corsika::particles::detail::all_particles) { + for (auto p : getAllParticles()) { if (!IsNucleus(p)) { auto const sib_id = static_cast<int>(corsika::process::sibyll::ConvertToSibyll(p)); auto const sib_mass = corsika::process::sibyll::GetSibyllMass(p) / 1_GeV; diff --git a/Framework/Particles/ParticleProperties.h b/Framework/Particles/ParticleProperties.h index dbac43ac444f7411d63827655fd233a1b828ebf0..baafb57e754014f10ff9741d91af00fd1427f0fe 100644 --- a/Framework/Particles/ParticleProperties.h +++ b/Framework/Particles/ParticleProperties.h @@ -152,6 +152,10 @@ namespace corsika::particles { return Proton::GetMass() * vZ + (vA - vZ) * Neutron::GetMass(); } + std::initializer_list<Code> constexpr getAllParticles() { + return detail::all_particles; + } + } // namespace corsika::particles #endif diff --git a/Processes/Sibyll/ParticleConversion.cc b/Processes/Sibyll/ParticleConversion.cc index 96cf2fa21a70d6a9b980bd730e614c3c0d333fa5..f35bead59044466ebe2acdaa4a4fce22aed260d7 100644 --- a/Processes/Sibyll/ParticleConversion.cc +++ b/Processes/Sibyll/ParticleConversion.cc @@ -25,4 +25,3 @@ corsika::units::si::HEPMassType corsika::process::sibyll::GetSibyllMass( else return sqrt(get_sibyll_mass2(sCode)) * 1_GeV; } -