From cd0c04ce942c7ae388d4cb0c547a22040980492b Mon Sep 17 00:00:00 2001
From: Maximilian Reininghaus <maximilian.reininghaus@tu-dortmund.de>
Date: Thu, 19 Nov 2020 17:00:48 +0100
Subject: [PATCH] removed double test

---
 corsika/detail/framework/core/ParticleProperties.inl | 5 -----
 corsika/framework/core/ParticleProperties.hpp        | 6 ++++++
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/corsika/detail/framework/core/ParticleProperties.inl b/corsika/detail/framework/core/ParticleProperties.inl
index 36d0b2306..53aa3b26f 100644
--- a/corsika/detail/framework/core/ParticleProperties.inl
+++ b/corsika/detail/framework/core/ParticleProperties.inl
@@ -30,8 +30,6 @@ namespace corsika {
   }
 
   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;
   }
 
@@ -76,12 +74,10 @@ namespace corsika {
     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) {
     return stream << name(code);
   }
 
-  //! convert PDG code to CORSIKA 8 internal code
   inline Code convert_from_PDG(PDGCode p) {
     static_assert(particle::detail::conversionArray.size() % 2 == 1);
     // this will fail, for the strange case where the maxPDG is negative...
@@ -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) {
     auto const absA = std::abs(A);
     auto const absZ = std::abs(Z);
diff --git a/corsika/framework/core/ParticleProperties.hpp b/corsika/framework/core/ParticleProperties.hpp
index a6ef84a7c..992d16a4c 100644
--- a/corsika/framework/core/ParticleProperties.hpp
+++ b/corsika/framework/core/ParticleProperties.hpp
@@ -59,6 +59,12 @@ namespace corsika {
 
   //! returns mass of (A,Z) nucleus, disregarding binding energy
   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
 
 // data arrays, etc.
-- 
GitLab