From c1e3e05dd21465886359568474ece6a9a44cc176 Mon Sep 17 00:00:00 2001
From: "felix@home" <felix.riehn@kit.edu>
Date: Wed, 23 Jan 2019 22:50:18 +0000
Subject: [PATCH] first pieces of interactions in nuclib

---
 Processes/Sibyll/NuclearInteraction.h | 19 ++++++++++---------
 Processes/Sibyll/sibyll2.3c.h         |  2 --
 Processes/Sibyll/testSibyll.cc        |  2 +-
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/Processes/Sibyll/NuclearInteraction.h b/Processes/Sibyll/NuclearInteraction.h
index 917cda8c..7520b2df 100644
--- a/Processes/Sibyll/NuclearInteraction.h
+++ b/Processes/Sibyll/NuclearInteraction.h
@@ -58,16 +58,17 @@ namespace corsika::process::sibyll {
       using namespace corsika::units::si;
       double sigProd, dummy, dum1, dum2, dum3, dum4;
       double dumdif[3];
-      
-      if(!corsika::particles::IsNucleus(BeamId)){
-	sigProd = std::numeric_limits<double>::infinity();
-	return std::make_tuple(sigProd * 1_mbarn, 1);
-      }
 
-      // TODO: use nuclib to calc. nuclear cross sections
-      // FOR NOW: use proton cross section for nuclei
-      auto const BeamIdToUse = corsika::particles::Proton::GetCode();
-      std::cout << "WARNING: replacing beam nucleus with proton!" << std::endl;
+      corsika::particles::Code BeamIdToUse;
+      if(corsika::particles::IsNucleus(BeamId)){
+
+	// TODO: use nuclib to calc. nuclear cross sections
+	// FOR NOW: use proton cross section for nuclei
+	BeamIdToUse = corsika::particles::Proton::GetCode();
+	std::cout << "WARNING: replacing beam nucleus with proton!" << std::endl;
+      } else {
+	BeamIdToUse = BeamId;
+      }
       
       const int iBeam = process::sibyll::GetSibyllXSCode(BeamIdToUse);
       const double dEcm = CoMenergy / 1_GeV;
diff --git a/Processes/Sibyll/sibyll2.3c.h b/Processes/Sibyll/sibyll2.3c.h
index df5a5760..5003b42e 100644
--- a/Processes/Sibyll/sibyll2.3c.h
+++ b/Processes/Sibyll/sibyll2.3c.h
@@ -102,8 +102,6 @@ void sibyll_(const int&, const int&, const double&);
 // subroutine to initiate sibyll
 void sibyll_ini_();
 
-// subroutine to initiate nuclib  
-void nuc_nuc_ini_();
   
 // subroutine to SET DECAYS
 void dec_ini_();
diff --git a/Processes/Sibyll/testSibyll.cc b/Processes/Sibyll/testSibyll.cc
index 795ba53a..bf79d05f 100644
--- a/Processes/Sibyll/testSibyll.cc
+++ b/Processes/Sibyll/testSibyll.cc
@@ -144,7 +144,7 @@ TEST_CASE("SibyllInterface", "[processes]") {
    
     auto particle = stack.AddParticle(particles::Code::Proton, E0, plab, pos, 0_ns);
 
-    Interaction model(env);
+    NuclearInteraction model(env);
 
     model.Init();
     [[maybe_unused]] const process::EProcessReturn ret =
-- 
GitLab