diff --git a/corsika/detail/framework/core/ParticleProperties.inl b/corsika/detail/framework/core/ParticleProperties.inl index d385ad5b93aa683b5270e8b3bf0414f7772df07f..7339a81ee2c948827533d24c92f3a671539639f6 100644 --- a/corsika/detail/framework/core/ParticleProperties.inl +++ b/corsika/detail/framework/core/ParticleProperties.inl @@ -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"); diff --git a/corsika/framework/core/ParticleProperties.hpp b/corsika/framework/core/ParticleProperties.hpp index 6ec30d7487c847c7606aebb091e406cd809b8c6f..85a65346b48b343e586516e2c8cbb1828db4ec25 100644 --- a/corsika/framework/core/ParticleProperties.hpp +++ b/corsika/framework/core/ParticleProperties.hpp @@ -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