IAP GITLAB

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

Merge branch '122-add-constant-for-nucleon-mass' into 'master'

Resolve "add constant for nucleon mass"

Closes #122

See merge request !75
parents 7a2ba843 29b99594
No related branches found
No related tags found
1 merge request!75Resolve "add constant for nucleon mass"
Pipeline #297 passed
......@@ -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.
*
*/
......
......@@ -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") {
......
......@@ -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
......
......@@ -18,28 +18,11 @@ namespace phys::units {
/**
* @file PhysicalUnits
*
* Add new units and types we need. Units are compile-time. We support
* different system of units in parallel. Literals are used for
* optimal coding style.
* Add new units and types we need. Units are compile-time. Literals are
* used for optimal coding style.
*
*/
/*
namespace corsika::units::hep {
using namespace phys::units;
using namespace phys::units::literals;
using namespace phys::units::io;
/// defining HEP energy, mass, momentum
using energy_hep_d = phys::units::energy_d;
constexpr phys::units::quantity<energy_hep_d> GeV{corsika::units::constants::eV};
// corsika::units::constants::e / phys::units::coulomb * phys::units::joule };
using MassType = phys::units::quantity<energy_hep_d, double>;
using MomentumType = phys::units::quantity<energy_hep_d, double>;
using EnergyType = phys::units::quantity<energy_hep_d, double>;
} // namespace corsika::units::hep
*/
namespace corsika::units::si {
using namespace phys::units;
using namespace phys::units::literals;
......
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