From 5d46c06a512f639bb0fecdd90718bb99e3bb53f7 Mon Sep 17 00:00:00 2001 From: Maximilian Reininghaus <maximilian.reininghaus@kit.edu> Date: Wed, 6 Feb 2019 19:23:19 +0100 Subject: [PATCH] added constants::nucleonMass --- Framework/Particles/ParticleProperties.h | 3 +-- Framework/Particles/testParticles.cc | 2 ++ Framework/Units/PhysicalConstants.h | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Framework/Particles/ParticleProperties.h b/Framework/Particles/ParticleProperties.h index 2f5365eb0..7b2b6f7e5 100644 --- a/Framework/Particles/ParticleProperties.h +++ b/Framework/Particles/ParticleProperties.h @@ -23,13 +23,12 @@ #include <iosfwd> #include <type_traits> -#include <corsika/units/PhysicalConstants.h> #include <corsika/units/PhysicalUnits.h> /** * * The properties of all elementary particles is stored here. The data - * is taken from the Pythia ParticleData.xml file. + * are taken from the Pythia ParticleData.xml file. * */ diff --git a/Framework/Particles/testParticles.cc b/Framework/Particles/testParticles.cc index 0603ea035..cba91b476 100644 --- a/Framework/Particles/testParticles.cc +++ b/Framework/Particles/testParticles.cc @@ -34,6 +34,8 @@ TEST_CASE("ParticleProperties", "[Particles]") { SECTION("Masses") { REQUIRE(Electron::GetMass() / (511_keV) == Approx(1)); REQUIRE(Electron::GetMass() / GetMass(Code::Electron) == Approx(1)); + + REQUIRE((Proton::GetMass() + Neutron::GetMass()) / corsika::units::constants::nucleonMass == Approx(2)); } SECTION("Charges") { diff --git a/Framework/Units/PhysicalConstants.h b/Framework/Units/PhysicalConstants.h index 38c59992f..1bf9872a0 100644 --- a/Framework/Units/PhysicalConstants.h +++ b/Framework/Units/PhysicalConstants.h @@ -61,7 +61,9 @@ namespace corsika::units::constants { // unified atomic mass unit constexpr quantity<mass_d> u{Rep(1.6605402e-27L) * kilogram}; - + + auto constexpr nucleonMass = 0.5 * (0.93827 + 0.93957) * 1e9 * electronvolt; + // etc. } // namespace corsika::units::constants -- GitLab