From 2eb3a2d7e5f01004b008f2efa7efdba2dc671640 Mon Sep 17 00:00:00 2001 From: kjplows Date: Mon, 16 Feb 2026 12:31:31 -0600 Subject: [PATCH] Prevent unphysical events from crashing gevgen --- src/Physics/QuasiElastic/XSection/QELUtils.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Physics/QuasiElastic/XSection/QELUtils.cxx b/src/Physics/QuasiElastic/XSection/QELUtils.cxx index 14e512dd8..7dbad7998 100644 --- a/src/Physics/QuasiElastic/XSection/QELUtils.cxx +++ b/src/Physics/QuasiElastic/XSection/QELUtils.cxx @@ -236,6 +236,7 @@ double genie::utils::CosTheta0Max(const genie::Interaction& interaction) { double probe_E_lab = interaction.InitState().ProbeE( genie::kRfLab ); TVector3 beta = COMframe2Lab( interaction.InitState() ); + if( beta.Mag2() >= 1.0 ) { return -1.1; } // remove unphysical events double gamma = 1. / std::sqrt(1. - beta.Mag2()); double sqrt_s = interaction.InitState().CMEnergy();