diff --git a/corsika/detail/modules/pythia8/NeutrinoInteraction.inl b/corsika/detail/modules/pythia8/NeutrinoInteraction.inl index a36216d135b31ac31af93f3e9d882ddac3800565..0b7fb87480134259aa3f1cd547d56a068fd14e25 100644 --- a/corsika/detail/modules/pythia8/NeutrinoInteraction.inl +++ b/corsika/detail/modules/pythia8/NeutrinoInteraction.inl @@ -38,11 +38,17 @@ namespace corsika::pythia8 { targetId, projectileP4.getTimeLikeComponent() / 1_GeV); CORSIKA_LOG_INFO("configure Pythia for primary neutrino interactions. NC={}, CC={}", handle_nc_, handle_cc_); + if (!handle_nc_ && !handle_cc_) { + CORSIKA_LOG_ERROR( + "no neutrino interaction channel configured! Select either NC, CC or both!"); + throw std::runtime_error("Configuration error!"); + } CORSIKA_LOG_INFO("minimal Q2 in DIS: {} GeV2", minQ2_ / 1_GeV / 1_GeV); - if (!isValid(projectileId, targetId, projectileP4, targetP4)) + if (!isValid(projectileId, targetId, projectileP4, targetP4)) { + CORSIKA_LOG_ERROR("wrong projectile, target or energy configuration!"); throw std::runtime_error("Configuration error!"); - + } // sample nucleon from nucleus A,Z double const fProtons = get_nucleus_Z(targetId) / double(get_nucleus_A(targetId)); double const fNeutrons = 1. - fProtons; @@ -71,9 +77,9 @@ namespace corsika::pythia8 { // Set up DIS process within some phase space. // Neutral current (with gamma/Z interference). - pythiaMain_.readString("WeakBosonExchange:ff2ff(t:gmZ) = on"); + if (handle_nc_) pythiaMain_.readString("WeakBosonExchange:ff2ff(t:gmZ) = on"); // Uncomment to allow charged current. - pythiaMain_.readString("WeakBosonExchange:ff2ff(t:W) = on"); + if (handle_cc_) pythiaMain_.readString("WeakBosonExchange:ff2ff(t:W) = on"); // Phase-space cut: minimal Q2 of process. pythiaMain_.settings.parm("PhaseSpace:Q2Min", Q2min);