diff --git a/config/NievesQELCCPXSec.xml b/config/NievesQELCCPXSec.xml index 1a0be1658b..43b08d8027 100644 --- a/config/NievesQELCCPXSec.xml +++ b/config/NievesQELCCPXSec.xml @@ -40,7 +40,7 @@ RmaxMode string Yes Method to use to comput genie::NewQELXSec/Default genie::NuclearModelMap/Default UseNuclearModel - 10.0 + 1000000.0 true true diff --git a/src/Framework/Interaction/InitialState.h b/src/Framework/Interaction/InitialState.h index ddc00f64b7..91d407e9d3 100644 --- a/src/Framework/Interaction/InitialState.h +++ b/src/Framework/Interaction/InitialState.h @@ -14,6 +14,7 @@ Other minor changes / additions and fixes were installed by: Andy Furmanski (Univ. of Manchester) Joe Johnston (Univ of Pittsburgh) + John Plows (Univ. of Liverpool) \created May 02, 2004 diff --git a/src/Physics/NuclearState/FermiMover.cxx b/src/Physics/NuclearState/FermiMover.cxx index 6d5020b3af..3cd0f70aac 100644 --- a/src/Physics/NuclearState/FermiMover.cxx +++ b/src/Physics/NuclearState/FermiMover.cxx @@ -197,6 +197,20 @@ void FermiMover::KickHitNucleon(GHepRecord * evrec) const nucleon->SetMomentum(*p4); // update GHEP value + // The below call to KPhaseSpace::IsAboveThreshold() depends on the target p4. + // If the EN < p3.Mag() then this is unphysical and kills code. Handle it here + if( p4->Mag2() < 0.0 ) { + LOG("FermiMover", pNOTICE) + << "Event generates an unphysical initial state target with p4 = " + << utils::print::P4AsShortString(p4) + << ". Skipping event"; + evrec->EventFlags()->SetBitNumber(kBelowThrNRF, true); + genie::exceptions::EVGThreadException exception; + exception.SetReason("Unphysical initial state 4-momentum after FermiMover acted on it"); + exception.SwitchOnFastForward(); + throw exception; + } + // Sometimes, for interactions near threshold, Fermi momentum might bring // the neutrino energy in the nucleon rest frame below threshold (for the // selected interaction). In this case mark the event as unphysical and diff --git a/src/Physics/NuclearState/FermiMover.h b/src/Physics/NuclearState/FermiMover.h index 7c1c94aa7e..43846aae6c 100644 --- a/src/Physics/NuclearState/FermiMover.h +++ b/src/Physics/NuclearState/FermiMover.h @@ -27,6 +27,7 @@ #include "Framework/Interaction/Target.h" #include "Physics/NuclearState/SRCNuclearRecoil.h" #include "Physics/NuclearState/SecondNucleonEmissionI.h" +#include "Framework/Utils/PrintUtils.h" namespace genie { diff --git a/src/Physics/NuclearState/NuclearModel.h b/src/Physics/NuclearState/NuclearModel.h index 33ac63429f..3b805717a8 100644 --- a/src/Physics/NuclearState/NuclearModel.h +++ b/src/Physics/NuclearState/NuclearModel.h @@ -40,6 +40,7 @@ typedef enum EFermiMoverInteractionType { kFermiMoveEffectiveSF1p1h, kFermiMoveEffectiveSF2p2h_eject, kFermiMoveEffectiveSF2p2h_noeject, + kFermiMoveSpectralFunc, } FermiMoverInteractionType_t; class NuclearModel { diff --git a/src/Physics/NuclearState/SpectralFunc.cxx b/src/Physics/NuclearState/SpectralFunc.cxx index 10d4395c43..8ae91480f0 100644 --- a/src/Physics/NuclearState/SpectralFunc.cxx +++ b/src/Physics/NuclearState/SpectralFunc.cxx @@ -42,13 +42,13 @@ using namespace genie::controls; //____________________________________________________________________________ SpectralFunc::SpectralFunc() : NuclearModelI("genie::SpectralFunc") { - + fFermiMoverInteractionType = kFermiMoveSpectralFunc; } //____________________________________________________________________________ SpectralFunc::SpectralFunc(string config) : NuclearModelI("genie::SpectralFunc", config) { - + fFermiMoverInteractionType = kFermiMoveSpectralFunc; } //____________________________________________________________________________ SpectralFunc::~SpectralFunc() diff --git a/src/Physics/QuasiElastic/EventGen/QELEventGenerator.cxx b/src/Physics/QuasiElastic/EventGen/QELEventGenerator.cxx index a04dddbc22..04f0bb24bd 100644 --- a/src/Physics/QuasiElastic/EventGen/QELEventGenerator.cxx +++ b/src/Physics/QuasiElastic/EventGen/QELEventGenerator.cxx @@ -508,10 +508,10 @@ double QELEventGenerator::ComputeMaxXSec(const Interaction * in) const }// Done with centre-of-mass angles coarsely // Calculate the range for the next layer - costh_range_min = costh_at_xsec_max - costh_increment; - costh_range_max = costh_at_xsec_max + costh_increment; - phi_range_min = phi_at_xsec_max - phi_increment; - phi_range_max = phi_at_xsec_max + phi_increment; + costh_range_min = costh_at_xsec_max - costh_increment; if(costh_range_min < -1.0) { costh_range_min = -1.0; } + costh_range_max = costh_at_xsec_max + costh_increment; if(costh_range_max > 1.0) { costh_range_max = 1.0; } + phi_range_min = phi_at_xsec_max - phi_increment; if( phi_range_min < 0.0) { phi_range_min = 0.0; } + phi_range_max = phi_at_xsec_max + phi_increment; if( phi_range_max > 2.0 * TMath::Pi()) { phi_range_max = 2.0 * TMath::Pi(); } double improvement_factor = this_nuc_xsec_max/last_layer_xsec_max; if (ilayer && (improvement_factor-1) < acceptable_fraction_of_safety_factor * (fSafetyFactor-1)) {