IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 4d9d3a12 authored by Felix Riehn's avatar Felix Riehn
Browse files

getter for all_particles

parent 9d8a3630
No related branches found
No related tags found
1 merge request!186Resolve "particle list example"
Pipeline #1251 passed
...@@ -38,7 +38,7 @@ int main() { ...@@ -38,7 +38,7 @@ int main() {
<< " | " << std::setw(18) << "SIBYLL-mass (GeV)" << " | " << std::setw(18) << "SIBYLL-mass (GeV)"
<< " | " << endl; << " | " << endl;
cout << std::setw(104) << std::setfill('-') << "-" << endl; cout << std::setw(104) << std::setfill('-') << "-" << endl;
for (auto p : corsika::particles::detail::all_particles) { for (auto p : getAllParticles()) {
if (!IsNucleus(p)) { if (!IsNucleus(p)) {
auto const sib_id = static_cast<int>(corsika::process::sibyll::ConvertToSibyll(p)); auto const sib_id = static_cast<int>(corsika::process::sibyll::ConvertToSibyll(p));
auto const sib_mass = corsika::process::sibyll::GetSibyllMass(p) / 1_GeV; auto const sib_mass = corsika::process::sibyll::GetSibyllMass(p) / 1_GeV;
......
...@@ -152,6 +152,10 @@ namespace corsika::particles { ...@@ -152,6 +152,10 @@ namespace corsika::particles {
return Proton::GetMass() * vZ + (vA - vZ) * Neutron::GetMass(); return Proton::GetMass() * vZ + (vA - vZ) * Neutron::GetMass();
} }
std::initializer_list<Code> constexpr getAllParticles() {
return detail::all_particles;
}
} // namespace corsika::particles } // namespace corsika::particles
#endif #endif
...@@ -25,4 +25,3 @@ corsika::units::si::HEPMassType corsika::process::sibyll::GetSibyllMass( ...@@ -25,4 +25,3 @@ corsika::units::si::HEPMassType corsika::process::sibyll::GetSibyllMass(
else else
return sqrt(get_sibyll_mass2(sCode)) * 1_GeV; return sqrt(get_sibyll_mass2(sCode)) * 1_GeV;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment