From 0c7c189ec60b8f34730ec16cf8a2cfcccec49031 Mon Sep 17 00:00:00 2001
From: Felix Riehn <felix@matilda>
Date: Tue, 11 Jun 2019 18:18:37 +0100
Subject: [PATCH] fixed CanInteract for Nucleus, added test

---
 Processes/Sibyll/code_generator.py | 2 +-
 Processes/Sibyll/testSibyll.cc     | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Processes/Sibyll/code_generator.py b/Processes/Sibyll/code_generator.py
index cb7d0cb24..d2ca87c6f 100755
--- a/Processes/Sibyll/code_generator.py
+++ b/Processes/Sibyll/code_generator.py
@@ -64,7 +64,7 @@ def generate_corsika2sibyll(particle_db):
 def generate_corsika2sibyll_xsType(particle_db):    
     string = "std::array<int, {:d}> constexpr corsika2sibyllXStype = {{\n".format(len(particle_db))
     for identifier, pData in particle_db.items():
-        sibCodeXS = pData.get("sibyll_xsType", -1)
+        sibCodeXS = pData.get("sibyll_xsType", 0)
         string += "  {:d}, // {:s}\n".format(sibCodeXS, identifier if sibCodeXS else identifier + " (not implemented in SIBYLL)")
     string += "};\n"
     return string
diff --git a/Processes/Sibyll/testSibyll.cc b/Processes/Sibyll/testSibyll.cc
index b00995687..492b6bf3e 100644
--- a/Processes/Sibyll/testSibyll.cc
+++ b/Processes/Sibyll/testSibyll.cc
@@ -45,6 +45,9 @@ TEST_CASE("Sibyll", "[processes]") {
 
     REQUIRE_FALSE(process::sibyll::CanInteract(particles::Electron::GetCode()));
     REQUIRE_FALSE(process::sibyll::CanInteract(particles::SigmaC0::GetCode()));
+
+    REQUIRE_FALSE(process::sibyll::CanInteract(particles::Nucleus::GetCode()));
+    REQUIRE_FALSE(process::sibyll::CanInteract(particles::Helium::GetCode()));
   }
 
   SECTION("cross-section type") {
-- 
GitLab