From 81da08b861f3ee3f540ce3ee84a1b99c7cd855d1 Mon Sep 17 00:00:00 2001
From: ralfulrich <ralf.ulrich@kit.edu>
Date: Thu, 29 Nov 2018 17:05:55 +0100
Subject: [PATCH] working

---
 Processes/Sibyll/code_generator.py |  5 +++--
 Processes/Sibyll/sibyll_codes.dat  |  2 ++
 Processes/Sibyll/testSibyll.cc     | 12 +++++++++++-
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/Processes/Sibyll/code_generator.py b/Processes/Sibyll/code_generator.py
index a87e644f..a2929fda 100755
--- a/Processes/Sibyll/code_generator.py
+++ b/Processes/Sibyll/code_generator.py
@@ -28,10 +28,11 @@ def read_sibyll_codes(filename, pythia_db):
             line = line.strip()
             if line[0] == '#':
                 continue            
-            identifier, sib_code, canInteractFlag, xsctnId = line.split()
+            identifier, sib_code, canInteractFlag, xsType = line.split()
             try:
                 pythia_db[identifier]["sibyll_code"] = int(sib_code)
                 pythia_db[identifier]["sibyll_canInteract"] = int(canInteractFlag)
+                pythia_db[identifier]["xsType"] = int(xsType)
             except KeyError as e:
                 raise Exception("Identifier '{:s}' not found in pythia_db".format(identifier))
 
@@ -126,7 +127,7 @@ def generate_interacting_particle(pythia_db):
         low = numeric & 0xFFFFFFFF
         numeric = numeric >> 32
         string += "  0x{:0x},\n".format(low)
-        
+    
     string += "}}};\n"
     return string
     
diff --git a/Processes/Sibyll/sibyll_codes.dat b/Processes/Sibyll/sibyll_codes.dat
index d04a8436..fc851588 100644
--- a/Processes/Sibyll/sibyll_codes.dat
+++ b/Processes/Sibyll/sibyll_codes.dat
@@ -1,3 +1,5 @@
+# input file for particle conversion to/from SIBYLL
+# the format of this file is: "corsika-identifier" "sibyll-id" "can-interact-in-sibyll" "cross-section-type"
 Electron 3 0 0
 Positron 2 0 0
 NuE 15 0 0
diff --git a/Processes/Sibyll/testSibyll.cc b/Processes/Sibyll/testSibyll.cc
index 8302be00..c8113277 100644
--- a/Processes/Sibyll/testSibyll.cc
+++ b/Processes/Sibyll/testSibyll.cc
@@ -33,10 +33,20 @@ TEST_CASE("Sibyll", "[processes]") {
             13 );
   }
 
-  SECTION("KnownBySibyll") {
+  SECTION("handledBySibyll") {
     REQUIRE(process::sibyll::KnownBySibyll(corsika::particles::Electron::GetCode()));
 
     REQUIRE_FALSE(
         process::sibyll::KnownBySibyll(corsika::particles::XiPrimeC0::GetCode()));
   }
+
+  SECTION("cross-section type") {
+    REQUIRE(process::sibyll::CanInteract(corsika::particles::Proton::GetCode()));
+    REQUIRE(process::sibyll::CanInteract(corsika::particles::XiCPlus::GetCode()));
+
+    REQUIRE_FALSE(
+		  process::sibyll::CanInteract(corsika::particles::Electron::GetCode()));
+    REQUIRE_FALSE(
+		  process::sibyll::CanInteract(corsika::particles::SigmaC0::GetCode()));
+  }
 }
-- 
GitLab