From 9410a5f774ec3a678c335e8dac1391c36f84dec9 Mon Sep 17 00:00:00 2001
From: Felix Riehn <friehn@lip.pt>
Date: Wed, 21 Feb 2024 21:31:06 +0100
Subject: [PATCH] added comment about neutrino cross section, check minimal
 energy

---
 corsika/modules/pythia8/NeutrinoInteraction.hpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/corsika/modules/pythia8/NeutrinoInteraction.hpp b/corsika/modules/pythia8/NeutrinoInteraction.hpp
index 826787efa..694dd2095 100644
--- a/corsika/modules/pythia8/NeutrinoInteraction.hpp
+++ b/corsika/modules/pythia8/NeutrinoInteraction.hpp
@@ -41,6 +41,10 @@ namespace corsika::pythia8 {
      *
      * @return inelastic cross section
      */
+    /* NOTE: the cross section for neutrino interactions is fixed to an arbitrary small
+     * value. This is needed just so the interaction process is not skipped in the process
+     * loop when the interaction is forced. If needed the exact value could be made
+     * accessible. */
     CrossSectionType getCrossSection(Code const projectile, Code const target,
                                      FourMomentum const& projectileP4,
                                      FourMomentum const& targetP4) const {
@@ -51,11 +55,12 @@ namespace corsika::pythia8 {
     };
 
     bool isValid(Code const projectileId, [[maybe_unused]] Code const targetId,
-                 [[maybe_unused]] FourMomentum const& projectileP4,
-                 [[maybe_unused]] FourMomentum const& targetP4) const {
+                 FourMomentum const& projectileP4, FourMomentum const& targetP4) const {
+      auto const S = (projectileP4 + targetP4).getNormSqr();
       return is_neutrino(projectileId) &&
              (is_nucleus(targetId) || targetId == Code::Proton ||
-              targetId == Code::Neutron);
+              targetId == Code::Neutron) &&
+             S >= minQ2_;
     };
 
     /**
-- 
GitLab