IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 5d46c06a authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan:
Browse files

added constants::nucleonMass

parent 7a2ba843
No related branches found
No related tags found
1 merge request!75Resolve "add constant for nucleon mass"
...@@ -23,13 +23,12 @@ ...@@ -23,13 +23,12 @@
#include <iosfwd> #include <iosfwd>
#include <type_traits> #include <type_traits>
#include <corsika/units/PhysicalConstants.h>
#include <corsika/units/PhysicalUnits.h> #include <corsika/units/PhysicalUnits.h>
/** /**
* *
* The properties of all elementary particles is stored here. The data * 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.
* *
*/ */
......
...@@ -34,6 +34,8 @@ TEST_CASE("ParticleProperties", "[Particles]") { ...@@ -34,6 +34,8 @@ TEST_CASE("ParticleProperties", "[Particles]") {
SECTION("Masses") { SECTION("Masses") {
REQUIRE(Electron::GetMass() / (511_keV) == Approx(1)); REQUIRE(Electron::GetMass() / (511_keV) == Approx(1));
REQUIRE(Electron::GetMass() / GetMass(Code::Electron) == Approx(1)); REQUIRE(Electron::GetMass() / GetMass(Code::Electron) == Approx(1));
REQUIRE((Proton::GetMass() + Neutron::GetMass()) / corsika::units::constants::nucleonMass == Approx(2));
} }
SECTION("Charges") { SECTION("Charges") {
......
...@@ -61,7 +61,9 @@ namespace corsika::units::constants { ...@@ -61,7 +61,9 @@ namespace corsika::units::constants {
// unified atomic mass unit // unified atomic mass unit
constexpr quantity<mass_d> u{Rep(1.6605402e-27L) * kilogram}; constexpr quantity<mass_d> u{Rep(1.6605402e-27L) * kilogram};
auto constexpr nucleonMass = 0.5 * (0.93827 + 0.93957) * 1e9 * electronvolt;
// etc. // etc.
} // namespace corsika::units::constants } // namespace corsika::units::constants
......
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