43TObject(), fInteraction(NULL)
45 this->UseInteraction(0);
61 static bool tMaxLoaded =
false;
62 static double DFR_tMax = -1;
101 else if ( xcls.
NPi0() != 1 )
106 double mtot = Mf + mf + mpi;
107 double Ethresh = (mtot*mtot - Mi*Mi - mi*mi)/2/Mi;
111 if (pi.
IsNorm() )
return 0;
119 double mtot = Mf + ml + mk;
120 double Ethresh = (mtot*mtot - Mi*Mi)/2/Mi;
125 return ml + 0.5*ml*ml/tgt.
Mass();
130 int tgtpdgc = tgt.
Pdg();
137 if ( xcls.
NPions() > 0 ) {
141 double m = ml + m_other ;
142 double m2 = TMath::Power(m,2);
143 double Ethr = m + 0.5*m2/MA;
145 return TMath::Max(0.,Ethr);
158 double Mn2 = TMath::Power(Mn,2);
184 double smin = TMath::Power(Wmin+ml,2.);
185 double Ethr = 0.5*(smin-Mn2)/Mn;
190 smin = TMath::Power(Wmin+ml,2);
191 Ethr = TMath::Max(0.5*(smin-Mn2-ml*ml)/Mn,ml);
194 return TMath::Max(0.,Ethr);
199 return TMath::Max(0.,Ethr);
211 double Mn2 = TMath::Power(Mn,2);
213 double smin = TMath::Power(Wmin+ml,2.);
214 double Ethr = 0.5*(smin-Mn2)/Mn;
215 return TMath::Max(0.,Ethr);
224 return TMath::Max(0.,Ethr);
228 double Ethr = 0.5 * (ml*ml-TMath::Power(Mn,2))/Mn;
229 return TMath::Max(0.,Ethr);
237 double Ethr = 0.5 * (TMath::Power(
kMw+ml,2)-TMath::Power(MA,2))/MA;
238 return TMath::Max(0.,Ethr);
258 case(
kKVW) :
return this->
WLim();
break;
261 case(
kKVx) :
return this->
XLim();
break;
262 case(
kKVy) :
return this->
YLim();
break;
263 case(
kKVt) :
return this->
TLim();
break;
320 LOG(
"KPhaseSpace",
pDEBUG) <<
"E = " << E <<
", Ethr = " << Ethr;
340 double Q2 = kine.
Q2();
342 bool allowed = in_phys;
353 double Q2 = kine.
Q2();
355 bool allowed = in_phys;
364 double Q2 = kine.
Q2();
366 bool allowed = in_phys;
375 bool allowed = in_phys;
386 bool allowed = in_phys;
392 double Q2 = kine.
Q2();
393 bool allowed (Q2 > 0);
405 double Q2 = kine.
Q2();
407 LOG(
"KPhaseSpace",
pDEBUG) <<
" W = " << W <<
", limits = [" << Wl.
min <<
"," << Wl.
max <<
"];";
408 LOG(
"KPhaseSpace",
pDEBUG) <<
" Q2 = " << Q2 <<
", limits = [" << Q2l.
min <<
"," << Q2l.
max <<
"];";
419 LOG(
"KPhaseSpace",
pDEBUG) <<
" t = " << t <<
", limits = [" << tl.
min <<
"," << tl.
max <<
"];";
422 LOG(
"KPhaseSpace",
pDEBUG) <<
" phase space point is " << ( in_phys ?
"ALLOWED" :
"NOT ALLOWED");
425 bool allowed = in_phys;
432 double Q2 = kine.
Q2();
434 bool allowed = in_phys;
454 bool is_em = pi.
IsEM();
479 else if (
fInteraction->ProcInfo().IsDeepInelastic() ) {
501 LOG(
"KPhaseSpace",
pDEBUG) <<
"Found nominal limits: " << Wl.
min <<
", " << Wl.
max;
528 bool is_em = pi.
IsEM();
535 if(!is_qel && !is_inel && !is_coh && !is_dme && !is_dmdis)
return Q2l;
547 if(is_qel || is_dme) W =
fInteraction->RecoilNucleon()->Mass();
552 }
else if (is_dme || is_dmdis) {
584 bool is_em = pi.
IsEM();
592 if(!is_qel && !is_inel && !is_coh && !is_cevns && !is_dme && !is_dmdis)
return Q2l;
613 if ( xcls.
NPions() > 0 ) {
666 double Q2maxConfig = 1.44;
667 if (Q2l.
max > Q2maxConfig) Q2l.
max = Q2maxConfig;
701 bool is_em = pi.
IsEM();
753 bool is_em = pi.
IsEM();
825 bool is_em = pi.
IsEM();
878 double Q2 = kine.
Q2();
879 double Mn = init_state.
Tgt().
Mass();
888 if ( xcls.
NPions() > 0 ) {
910 return this->
YLim(xsi);
931 double Q2 = kine.
Q2();
932 double nu = Ev * kine.
y();
943 if ( xcls.
NPions() > 0 ) {
948 double m_other2 = m_other * m_other ;
950 tl.
min = 1.0 * (Q2 + m_other2)/(2.0 * nu) * (Q2 + m_other2)/(2.0 * nu);
961 double mpi2 = mpi*mpi;
965 double nuSqPlusQ2 = nu*nu + Q2;
966 double nuOverM = nu / M;
967 double mpiQ2term = mpi2 - Q2 - 2*nu*nu;
968 double A1 = 1 + 2*nuOverM + nuOverM*nuOverM - nuSqPlusQ2/M2;
969 double A2 = (1+nuOverM) * mpiQ2term + 2*nuOverM*nuSqPlusQ2;
970 double A3 = mpiQ2term*mpiQ2term - 4*nuSqPlusQ2*(nu*nu - mpi2);
972 tl.
min = std::abs( (A2 + sqrt(A2*A2 - A1*A3)) / A1 );
975#if __cplusplus >= 201103L
976 tminIsNaN = std::isnan(tl.
min);
980 tminIsNaN = tl.
min != tl.
min;
985 <<
"tmin for diffractive scattering is NaN "
986 <<
"( Enu = " << Ev <<
", Q2 = " << Q2 <<
", nu = " << nu <<
")";
996 LOG(
"KPhaseSpace",
pWARN) <<
"It is not sensible to ask for t limits for events that are not coherent or diffractive.";
1010 double mtot = M + mf + mpi;
1011 double Ethresh = (mtot*mtot - M*M - mi*mi)/2/M;
1024 double ECM = init_state.
CMEnergy();
1029 if ( (Wl.
max - Wl.
min) < (Wl.
max + Wl.
min)*std::numeric_limits<double>::epsilon() )
1036 Wl.
min *= 1. + std::numeric_limits<double>::epsilon();
1037 Wl.
max *= 1. - std::numeric_limits<double>::epsilon();
1054 double ECM = TMath::Sqrt(M*(M + 2*Ei) + mi*mi);
1059 if ( (Wl.
max - Wl.
min) < (Wl.
max + Wl.
min)*std::numeric_limits<double>::epsilon() )
1066 Wl.
min *= 1. + std::numeric_limits<double>::epsilon();
1067 Wl.
max *= 1. - std::numeric_limits<double>::epsilon();
1080 double mi = pdglib->
Find( init_state.
ProbePdg() )->Mass();
1086 double ECM = init_state.
CMEnergy();
1089 double Ei_CM = (s + mi2 - Mi*Mi)/2/ECM;
1090 double Ef_CM = (s + mf2 - W*W)/2/ECM;
1091 double Pi_CM = (Ei_CM - mi)<0?0:TMath::Sqrt(Ei_CM*Ei_CM - mi2);
1092 double Pf_CM = (Ef_CM - mf)<0?0:TMath::Sqrt(Ef_CM*Ef_CM - mf2);
1094 Q2l.
min = 2*(Ei_CM*Ef_CM - Pi_CM*Pf_CM) - mi2 - mf2;
1095 Q2l.
max = 2*(Ei_CM*Ef_CM + Pi_CM*Pf_CM) - mi2 - mf2;
1097 if ( (Q2l.
max - Q2l.
min) < (Q2l.
max + Q2l.
min)*std::numeric_limits<double>::epsilon() )
1104 Q2l.
min *= 1. + std::numeric_limits<double>::epsilon();
1105 Q2l.
max *= 1. - std::numeric_limits<double>::epsilon();
1118 double mi = pdglib->
Find( init_state.
ProbePdg() )->Mass();
1125 double s = M*(M + 2*Ei) + mi2;
1126 double ECM = TMath::Sqrt(s);
1128 double Ei_CM = (s + mi2 - M*M)/2/ECM;
1129 double Ef_CM = (s + mf2 - W*W)/2/ECM;
1130 double Pi_CM = (Ei_CM - mi)<0?0:TMath::Sqrt(Ei_CM*Ei_CM - mi2);
1131 double Pf_CM = (Ef_CM - mf)<0?0:TMath::Sqrt(Ef_CM*Ef_CM - mf2);
1133 Q2l.
min = 2*(Ei_CM*Ef_CM - Pi_CM*Pf_CM) - mi2 - mf2;
1134 Q2l.
max = 2*(Ei_CM*Ef_CM + Pi_CM*Pf_CM) - mi2 - mf2;
1136 if ( (Q2l.
max - Q2l.
min) < (Q2l.
max + Q2l.
min)*std::numeric_limits<double>::epsilon() )
1143 Q2l.
min *= 1. + std::numeric_limits<double>::epsilon();
1144 Q2l.
max *= 1. - std::numeric_limits<double>::epsilon();
ClassImp(KPhaseSpace) KPhaseSpace
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils.
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
static AlgConfigPool * Instance()
Registry * CommonList(const string &file_id, const string &set_name) const
Initial State information.
const Target & Tgt(void) const
double CMEnergy() const
centre-of-mass energy (sqrt s)
double ProbeE(RefFrame_t rf) const
Summary information for an interaction.
double Threshold_SPP_iso(void) const
Energy limit for resonance single pion production on isoscalar nucleon.
Range1D_t XLim(void) const
x limits
Range1D_t WLim_SPP_iso(void) const
W limits for resonance single pion production on isoscalar nucleon.
double Minimum(KineVar_t kvar) const
Range1D_t q2Lim_W(void) const
q2 limits @ fixed W
Range1D_t YLim_X(void) const
y limits @ fixed x
bool IsAllowed(void) const
Check whether the current kinematics is in the allowed phase space.
Range1D_t Q2Lim_W(void) const
Q2 limits @ fixed W.
Range1D_t Q2Lim_W_SPP(void) const
Q2 limits @ fixed W for single pion production models.
void UseInteraction(const Interaction *in)
double Threshold(void) const
Energy threshold.
Range1D_t TLim(void) const
t limits
bool IsAboveThreshold(void) const
Checks whether the interaction is above the energy threshold.
Range1D_t YLim(void) const
y limits
Range1D_t q2Lim(void) const
q2 limits
Range1D_t WLim(void) const
W limits.
const Interaction * fInteraction
Range1D_t Q2Lim_W_SPP_iso(void) const
Q2 limits @ fixed W for resonance single pion production on isoscalar nucleon.
Range1D_t Limits(KineVar_t kvar) const
Return the kinematical variable limits.
static double GetTMaxDFR()
Range1D_t Q2Lim(void) const
Q2 limits.
double Maximum(KineVar_t kvar) const
Range1D_t WLim_SPP(void) const
W limits for single pion production models.
static string AsString(KineVar_t kv)
Generated/set kinematical variables for an event.
double Q2(bool selected=false) const
double t(bool selected=false) const
double y(bool selected=false) const
double W(bool selected=false) const
double x(bool selected=false) const
Singleton class to load & serve a TDatabasePDG.
static PDGLibrary * Instance(void)
TParticlePDG * Find(int pdgc, bool must_exist=true)
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
bool IsPhotonResonance(void) const
bool IsAMNuGamma(void) const
bool IsNuElectronElastic(void) const
bool IsDiffractive(void) const
bool IsDeepInelastic(void) const
bool IsInverseMuDecay(void) const
bool IsCoherentElastic(void) const
bool IsDarkMatterElastic(void) const
bool IsPhotonCoherent(void) const
bool IsWeakCC(void) const
bool IsCoherentProduction(void) const
bool IsQuasiElastic(void) const
bool IsDarkMatterElectronElastic(void) const
bool IsIMDAnnihilation(void) const
bool IsGlashowResonance(void) const
bool IsSinglePion(void) const
bool IsResonant(void) const
bool IsInverseBetaDecay(void) const
bool IsDarkMatterDeepInelastic(void) const
bool IsSingleKaon(void) const
A simple [min,max] interval for doubles.
A registry. Provides the container for algorithm configuration parameters.
RgDbl GetDouble(RgKey key) const
static int FinStatePion(SppChannel_t channel)
static SppChannel_t FromInteraction(const Interaction *interaction)
static int FinStateNucleon(SppChannel_t channel)
static int InitStateNucleon(SppChannel_t channel)
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
int HitNucPdg(void) const
TLorentzVector * HitNucP4Ptr(void) const
double HitNucMass(void) const
bool HitNucIsSet(void) const
Contains minimal information for tagging exclusive processes.
bool IsInclusiveCharm(void) const
bool IsStrangeEvent(void) const
bool IsCharmEvent(void) const
int StrangeHadronPdg(void) const
int CharmHadronPdg(void) const
Exception used inside Interaction classes.
static const double kTauMass
static const double kNucleonMass
static const double kLightestChmHad
static const double kElectronMass2
static const double kMuonMass2
static const double kMuonMass
static const double kPhotontest
static const double kElectronMass
static const double kPionMass
static const double kNeutronMass
static const double kPi0Mass
static const double kProtonMass
static const double kMinQ2Limit_VLE
static const double kASmallNum
int SwitchProtonNeutron(int pdgc)
Range1D_t InelXLim(double El, double ml, double M)
Range1D_t InelWLim(double El, double ml, double M)
Range1D_t InelQ2Lim_W(double El, double ml, double M, double W)
Range1D_t InelYLim(double El, double ml, double M)
Range1D_t InelQ2Lim(double El, double ml, double M)
Range1D_t InelYLim_X(double El, double ml, double M, double x)
Range1D_t InelQ2Lim(double Ev, double M, double ml, double Q2min_cut=controls::kMinQ2Limit)
Range1D_t DarkWLim(double Ev, double M, double ml)
void UpdateWQ2FromXY(const Interaction *in)
double W(const Interaction *const i)
Range1D_t DarkQ2Lim_W(double Ev, double M, double ml, double W, double Q2min_cut=controls::kMinQ2Limit)
Range1D_t CEvNSQ2Lim(double Ev)
Range1D_t DarkYLim_X(double Ev, double M, double ml, double x)
Range1D_t CohYLim(double Mn, double m_produced, double mlep, double Ev, double Q2, double xsi)
Range1D_t DarkYLim(double Ev, double M, double ml)
Range1D_t InelWLim(double Ev, double M, double ml)
Range1D_t DarkQ2Lim(double Ev, double M, double ml, double Q2min_cut=controls::kMinQ2Limit)
Range1D_t CohQ2Lim(double Mn, double m_produced, double mlep, double Ev)
Range1D_t DarkXLim(double Ev, double M, double ml)
Range1D_t InelYLim_X(double Ev, double M, double ml, double x)
Range1D_t InelXLim(double Ev, double M, double ml)
Range1D_t InelQ2Lim_W(double Ev, double M, double ml, double W, double Q2min_cut=controls::kMinQ2Limit)
Range1D_t InelYLim(double Ev, double M, double ml)
bool IsWithinLimits(double x, Range1D_t range)
Root of GENIE utility namespaces.
THE MAIN GENIE PROJECT NAMESPACE
enum genie::EKineVar KineVar_t
enum genie::ESppChannel SppChannel_t