IAP GITLAB

Skip to content
Snippets Groups Projects
Commit ed7de18c authored by ralfulrich's avatar ralfulrich Committed by Ralf Ulrich
Browse files

added pdg codes for nuclei

parent e623e3ed
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,10 @@ namespace corsika {
return particle::detail::pdg_codes[static_cast<CodeIntType>(p)];
}
inline PDGCode constexpr get_PDG(unsigned int A, unsigned int Z) {
return static_cast<PDGCode>(1000000000 + Z * 10000 + A + 10); // 10LZZZAAAI
}
inline int16_t constexpr get_charge_number(Code const code) {
if (code == Code::Nucleus)
throw std::runtime_error("charge of particle::Nucleus undefined");
......
......@@ -88,6 +88,8 @@ namespace corsika {
//! Particle code according to PDG, "Monte Carlo Particle Numbering Scheme"
PDGCode constexpr get_PDG(Code const);
PDGCode constexpr get_PDG(unsigned int A, unsigned int Z);
std::string_view constexpr get_name(Code const); //!< name of the particle as string
TimeType constexpr get_lifetime(Code const); //!< lifetime
......
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