From 4e64d639bc7b348525c0a45124b704559762b013 Mon Sep 17 00:00:00 2001
From: Felix Riehn <felix@matilda>
Date: Thu, 24 Jan 2019 19:10:10 +0000
Subject: [PATCH] catch wrong projectile in DoInteraction call

---
 Processes/Sibyll/Interaction.h        | 5 +++--
 Processes/Sibyll/NuclearInteraction.h | 1 -
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Processes/Sibyll/Interaction.h b/Processes/Sibyll/Interaction.h
index b916f55b1..75409a7a1 100644
--- a/Processes/Sibyll/Interaction.h
+++ b/Processes/Sibyll/Interaction.h
@@ -185,9 +185,10 @@ namespace corsika::process::sibyll {
       cout << "ProcessSibyll: "
            << "DoInteraction: " << corsikaBeamId << " interaction? "
            << process::sibyll::CanInteract(corsikaBeamId) << endl;
+      
       if(corsika::particles::IsNucleus(corsikaBeamId)){
-	// nuclei handled by different process, skip
-	return process::EProcessReturn::eOk;
+	// nuclei handled by different process, this should not happen
+	throw std::runtime_error("Nuclear projectile are not handled by SIBYLL!");
       }
       
       if (process::sibyll::CanInteract(corsikaBeamId)) {
diff --git a/Processes/Sibyll/NuclearInteraction.h b/Processes/Sibyll/NuclearInteraction.h
index d7f926fd8..63ee3aa13 100644
--- a/Processes/Sibyll/NuclearInteraction.h
+++ b/Processes/Sibyll/NuclearInteraction.h
@@ -203,7 +203,6 @@ namespace corsika::process::sibyll {
       if(!IsNucleus(corsikaProjId)){
 	// this should not happen
 	throw std::runtime_error("Non nuclear projectile in NUCLIB!");
-	return process::EProcessReturn::eOk;
       }
 
       fCount++;
-- 
GitLab