IAP GITLAB

Skip to content
Snippets Groups Projects
Commit cd0c04ce authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan: Committed by ralfulrich
Browse files

removed double test

parent fd5189c9
No related branches found
No related tags found
No related merge requests found
...@@ -30,8 +30,6 @@ namespace corsika { ...@@ -30,8 +30,6 @@ namespace corsika {
} }
ElectricChargeType constexpr charge(Code const code) { ElectricChargeType constexpr charge(Code const code) {
if (code == Code::Nucleus)
throw std::runtime_error("Cannot GetCharge() of particle::Nucleus -> unspecified");
return charge_number(code) * constants::e; return charge_number(code) * constants::e;
} }
...@@ -76,12 +74,10 @@ namespace corsika { ...@@ -76,12 +74,10 @@ namespace corsika {
return (code == Code::Nucleus) || (nucleus_A(code) != 0); return (code == Code::Nucleus) || (nucleus_A(code) != 0);
} }
//! the output stream operator for human-readable particle codes
inline std::ostream& operator<<(std::ostream& stream, corsika::Code const code) { inline std::ostream& operator<<(std::ostream& stream, corsika::Code const code) {
return stream << name(code); return stream << name(code);
} }
//! convert PDG code to CORSIKA 8 internal code
inline Code convert_from_PDG(PDGCode p) { inline Code convert_from_PDG(PDGCode p) {
static_assert(particle::detail::conversionArray.size() % 2 == 1); static_assert(particle::detail::conversionArray.size() % 2 == 1);
// this will fail, for the strange case where the maxPDG is negative... // this will fail, for the strange case where the maxPDG is negative...
...@@ -94,7 +90,6 @@ namespace corsika { ...@@ -94,7 +90,6 @@ namespace corsika {
} }
} }
//! returns mass of (A,Z) nucleus, disregarding binding energy
inline HEPMassType nucleus_mass(const int A, const int Z) { inline HEPMassType nucleus_mass(const int A, const int Z) {
auto const absA = std::abs(A); auto const absA = std::abs(A);
auto const absZ = std::abs(Z); auto const absZ = std::abs(Z);
......
...@@ -59,6 +59,12 @@ namespace corsika { ...@@ -59,6 +59,12 @@ namespace corsika {
//! returns mass of (A,Z) nucleus, disregarding binding energy //! returns mass of (A,Z) nucleus, disregarding binding energy
inline HEPMassType nucleus_mass(int, int); inline HEPMassType nucleus_mass(int, int);
//! convert PDG code to CORSIKA 8 internal code
inline Code convert_from_PDG(PDGCode);
//! the output stream operator for human-readable particle codes
inline std::ostream& operator<<(std::ostream&, corsika::Code);
} // namespace corsika } // namespace corsika
// data arrays, etc. // data arrays, etc.
......
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