From 37ed0e4c2b14790e2c9d042a24d58630d1d996af Mon Sep 17 00:00:00 2001
From: Maximilian Reininghaus <maximilian.reininghaus@tu-dortmund.de>
Date: Sun, 7 Jun 2020 17:15:38 +0200
Subject: [PATCH] return zero cross-section for nucleus projectile

---
 Processes/UrQMD/UrQMD.cc     | 24 ++++++++++++------------
 Processes/UrQMD/testUrQMD.cc |  2 +-
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Processes/UrQMD/UrQMD.cc b/Processes/UrQMD/UrQMD.cc
index b0f097088..0c9f63265 100644
--- a/Processes/UrQMD/UrQMD.cc
+++ b/Processes/UrQMD/UrQMD.cc
@@ -191,29 +191,29 @@ template <typename TParticle> // need template here, as this is called both with
                               // SetupParticle as well as SetupProjectile
 CrossSectionType UrQMD::GetCrossSection(TParticle const& projectile,
                                         corsika::particles::Code targetCode) const {
-  // TODO: return 0 for non-hadrons?
 
   auto const projectileCode = projectile.GetPID();
   auto const projectileEnergyLab = projectile.GetEnergy();
 
-  return GetTabulatedCrossSection(projectileCode, targetCode, projectileEnergyLab);
-
-  // if (projectileCode == particles::Code::K0Long) {
-  //   return 0.5 *
-  //          (GetCrossSection(particles::Code::K0, vTargetCode, projectileEnergyLab) +
-  //           GetCrossSection(particles::Code::K0Bar, vTargetCode, projectileEnergyLab));
-  // }
+  if (projectileCode == particles::Code::Nucleus) {
+    /*
+     * unfortunately unavoidable at the moment until we have tools to get the actual
+     * inealstic cross-section from UrQMD
+     */
+    return CrossSectionType::zero();
+  }
 
-  // int const Ap =
-  //     (projectileCode == particles::Code::Nucleus) ? vProjectile.GetNuclearA() : 1;
-  // return GetCrossSection(projectileCode, vTargetCode, projectileEnergyLab, Ap);
+  return GetTabulatedCrossSection(projectileCode, targetCode, projectileEnergyLab);
 }
 
 bool UrQMD::CanInteract(particles::Code vCode) const {
   // According to the manual, UrQMD can use all mesons, baryons and nucleons
   // which are modeled also as input particles. I think it is safer to accept
   // only the usual long-lived species as input.
-  // TODO: Charmed mesons should be added to the list, too
+
+  // Interactions with nucleus projectiles are possible in principle with UrQMD
+  // but right now we don't have access to the inelastic (production) cross-section,
+  // so we unfortunately have to forbid these interactions for the time being.
 
   static particles::Code const validProjectileCodes[] = {
       particles::Code::Proton,      particles::Code::AntiProton, particles::Code::Neutron,
diff --git a/Processes/UrQMD/testUrQMD.cc b/Processes/UrQMD/testUrQMD.cc
index c5cdffd88..d93334f6f 100644
--- a/Processes/UrQMD/testUrQMD.cc
+++ b/Processes/UrQMD/testUrQMD.cc
@@ -149,7 +149,7 @@ TEST_CASE("UrQMD") {
       REQUIRE(stack->GetSize() == 1);
 
       // simple check whether the cross-section is non-vanishing
-      // only nuclei with available tabluated data so far 
+      // only nuclei with available tabluated data so far
       REQUIRE(urqmd.GetCrossSection(view->GetProjectile(), particles::Code::Nitrogen) /
                   1_mb >
               0);
-- 
GitLab