IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 1bc79005 authored by Ralf Ulrich's avatar Ralf Ulrich
Browse files

Merge branch 'pdg_nuclei' into 'master'

added pdg codes for nuclei

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