From 244cff6c44352e55ec165903ad8738e358f4b35e Mon Sep 17 00:00:00 2001
From: Felix Riehn <felix@matilda>
Date: Fri, 21 Dec 2018 16:18:43 +0000
Subject: [PATCH] added HasDecayed query to SibStack

---
 Processes/Sibyll/Interaction.h | 2 +-
 Processes/Sibyll/SibStack.h    | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Processes/Sibyll/Interaction.h b/Processes/Sibyll/Interaction.h
index 8fd27958..fb1334da 100644
--- a/Processes/Sibyll/Interaction.h
+++ b/Processes/Sibyll/Interaction.h
@@ -220,7 +220,7 @@ namespace corsika::process::sibyll {
           for (auto& psib : ss) {
             ++i;
             // skip particles that have decayed in Sibyll
-            if (abs(s_plist_.llist[i]) > 100) continue;
+	    if( psib.HasDecayed()) continue;
 
             // transform energy to lab. frame, primitve
             // compute beta_vec * p_vec
diff --git a/Processes/Sibyll/SibStack.h b/Processes/Sibyll/SibStack.h
index 7398d400..d7827382 100644
--- a/Processes/Sibyll/SibStack.h
+++ b/Processes/Sibyll/SibStack.h
@@ -20,7 +20,7 @@ namespace corsika::process::sibyll {
     void Clear() { s_plist_.np = 0; }
 
     int GetSize() const { return s_plist_.np; }
-#warning check actual capacity of sibyll stack
+
     int GetCapacity() const { return 8000; }
 
     void SetId(const int i, const int v) { s_plist_.llist[i] = v; }
@@ -80,6 +80,10 @@ namespace corsika::process::sibyll {
     corsika::units::hep::EnergyType GetEnergy() const {
       return GetStackData().GetEnergy(GetIndex());
     }
+    bool HasDecayed() const
+    {
+      return abs(GetStackData().GetId(GetIndex()))>100 ? true : false;
+    }
     void SetPID(const int v) { GetStackData().SetId(GetIndex(), v); }
     corsika::process::sibyll::SibyllCode GetPID() const {
       return static_cast<corsika::process::sibyll::SibyllCode>(
-- 
GitLab