26 #include <Math/IFunction.h>
27 #include <Math/RootFinder.h>
29 #include "Framework/Conventions/GBuild.h"
41 using namespace genie;
42 using namespace genie::constants;
43 using std::ostringstream;
53 Algorithm(
"genie::SmithMonizUtils", config)
86 const std::string keyStart =
"RFG-NucRemovalE@Pdg=";
90 for(RgIMap::const_iterator it = entries.begin(); it != entries.end(); ++it)
92 const std::string& key = it->first;
95 if (0 == key.compare(0, keyStart.size(), keyStart.c_str()))
97 pdg = atoi(key.c_str() + keyStart.size());
100 if (0 != pdg && 0 != Z)
102 ostringstream key_ss ;
103 key_ss << keyStart << pdg;
104 RgKey rgkey = key_ss.str();
107 eb = TMath::Max(eb, 0.);
108 fNucRmvE.insert(map<int,double>::value_type(Z,eb));
121 const InitialState & init_state = interaction -> InitState();
122 const Target & target = init_state.
Tgt();
133 mm_lep = TMath::Power(m_lep, 2);
138 TParticlePDG * nucl_fin = pdglib->
Find( nucl_pdg_fin );
156 int Zf = (is_p) ? Zi-1 : Zi;
162 <<
"Unknwown nuclear target! No target with code: "
189 if(is_p)
P_Fermi *= TMath::Power( 2.*Z/A, 1./3);
191 P_Fermi *= TMath::Power( 2.*N/A, 1./3);
197 map<int,double>::const_iterator it =
fNucRmvE.find(Z);
216 const int MFC = 10000;
217 const double EPSABS = 0.;
218 const double EPSREL = 1.0e-08;
226 E_min = TMath::Max(E_min, E_min2);
234 ROOT::Math::RootFinder rfgb(ROOT::Math::RootFinder::kGSL_BRENT);
236 if ( rfgb.Solve(QEL_EnuMin_SM_, E_min, 50., MFC, EPSABS, EPSREL) )
241 E_min = TMath::Max(E_min, 0.);
250 const double EPS = 1.0e-06;
251 const double Delta= 1.0e-14;
256 double E_nu_CM = (s-
mm_tar)/2/TMath::Sqrt(s);
258 double E_l_CM = (s+
mm_lep-W2)/2/TMath::Sqrt(s);
259 double P_l_CM = E_l_CM>
m_lep?TMath::Sqrt(E_l_CM*E_l_CM-
mm_lep):Precision;
261 double Q2_lim1 = 2*E_nu_CM*(E_l_CM-P_l_CM)-
mm_lep;
262 double Q2_lim2 = 2*E_nu_CM*(E_l_CM+P_l_CM)-
mm_lep;
268 DMINFC(Q2lim1_SM_,Q2_lim1,Q2_lim2,EPS,Delta,Q2_0,F_MIN,LLM);
282 double nu_1 = (a*(E-
E_BIN)-P_Fermi*TMath::Sqrt(a*a+Q2*b))/b;
297 double nu_2 = (a*(E-
E_BIN)+P_Fermi*TMath::Sqrt(a*a+Q2*b))/b;
319 const int MFC = 1000;
320 const double EPS = 1.0e-08;
321 const double Delta= 1.0e-14;
322 const double EPSABS = 0;
323 const double EPSREL = 1.0e-08;
332 double E_nu_CM = (s-
mm_ini)/2/TMath::Sqrt(s);
334 double E_l_CM = (s+
mm_lep-W2)/2/TMath::Sqrt(s);
335 double P_l_CM = E_l_CM>
m_lep?TMath::Sqrt(E_l_CM*E_l_CM-
mm_lep):Precision;
337 double Q2_min = 2*E_nu_CM*(E_l_CM-P_l_CM)-
mm_lep;
338 double Q2_max = 2*E_nu_CM*(E_l_CM+P_l_CM)-
mm_lep;
339 Q2_min= TMath::Max(Q2_min,0.0);
347 double E_nu_CM = (s-
mm_tar)/2/TMath::Sqrt(s);
349 double E_l_CM = (s+
mm_lep-W2)/2/TMath::Sqrt(s);
350 double P_l_CM = E_l_CM>
m_lep?TMath::Sqrt(E_l_CM*E_l_CM-
mm_lep):Precision;
352 double Q2_min = 2*E_nu_CM*(E_l_CM-P_l_CM)-
mm_lep;
353 double Q2_max = 2*E_nu_CM*(E_l_CM+P_l_CM)-
mm_lep;
359 DMINFC(Q2lim1_SM_,Q2_min,Q2_max,EPS,Delta,Q2_0,F_MIN,LLM);
363 <<
"No overlapped area for energy " <<
E_nu <<
"\n" <<
364 "Q2_min=" << Q2_min <<
" Q2_max=" << Q2_max <<
"\n" <<
365 "Q2_0=" << Q2_0 <<
" F_MIN=" << F_MIN;
374 ROOT::Math::RootFinder rfgb(ROOT::Math::RootFinder::kGSL_BRENT);
376 if (rfgb.Solve(Q2lim1_SM_, Q2_min, Q2_0, MFC, EPSABS, EPSREL))
386 ROOT::Math::RootFinder rfgb(ROOT::Math::RootFinder::kGSL_BRENT);
388 if (rfgb.Solve(Q2lim1_SM_, Q2_0, Q2_max, MFC, EPSABS, EPSREL))
399 LOG(
"SmithMoniz",
pWARN) <<
"The RFG model is not applicable! The cross section is set zero!";
407 ROOT::Math::RootFinder rfgb(ROOT::Math::RootFinder::kGSL_BRENT);
409 if (rfgb.Solve(Q2lim2_SM_, Q2_min,Q2_max, MFC, EPSABS, EPSREL))
415 Q2_min = TMath::Max(Q2_min,0.0);
440 double tmp1 = a*(E-
E_BIN);
441 double tmp2 = P_Fermi*TMath::Sqrt(a*a+Q2*b);
443 double nu_1 = (tmp1-tmp2)/b;
444 double nu_2 = (tmp1+tmp2)/b;
446 nu_min= TMath::Max(nu_min,nu_1);
448 nu_max= TMath::Min(nu_max,nu_2);
454 return Range1D_t(0.5*(nu_min+nu_max),0.5*(nu_min+nu_max));
462 const double EPS = 1.0e-08;
463 const double Delta= 1.0e-14;
472 DMINFC(vlim1_SM_,Q2_min,Q2_max,EPS,Delta,Q2_0,F_MIN,LLM);
482 const double EPS = 1.0e-08;
483 const double Delta= 1.0e-14;
492 DMINFC(vlim2_SM_,Q2_min,Q2_max,EPS,Delta,Q2_0,F_MIN,LLM);
508 double nu_1 = (a*(E-
E_BIN)-P_Fermi*TMath::Sqrt(a*a+Q2*b))/b;
509 nu_min= TMath::Max(nu_min,nu_1);
523 double nu_2 = (a*(E-
E_BIN)+P_Fermi*TMath::Sqrt(a*a+Q2*b))/b;
524 nu_max= TMath::Min(nu_max,nu_2);
531 double qv = TMath::Sqrt(nu*nu+Q2);
532 double c_f = (nu-
E_BIN)/qv;
535 double Ef_min= TMath::Max(m_ini*(c_f*d_f+TMath::Sqrt(1.0-c_f*c_f+d_f*d_f))/(1.0-c_f*c_f), TMath::Sqrt(
P_Fermi*
P_Fermi+
mm_ini)-nu);
536 double kF_min=
P_Fermi!=0?TMath::Sqrt(TMath::Max(Ef_min*Ef_min-
mm_ini,0.0)):0.;
542 R =
Range1D_t(0.5*(kF_min+kF_max),0.5*(kF_min+kF_max));
550 const double W5 = TMath::Sqrt(5);
551 const double HV = (3-W5)/2;
552 const double HW = (W5-1)/2;
553 const double R1 = 1.0;
554 const double HF = R1/2;
557 if(A!=B) N = TMath::Nint(2.08*TMath::Log(TMath::Abs((A-B)/EPS)));
567 double V, FV,
W, FW, H;
575 LLM = TMath::Abs(X-A)>DELTA && TMath::Abs(X-B)>DELTA;
623 return 1.0/(1.0 + TMath::Exp(-(P_Fermi-p)/T_Fermi));
641 return TMath::ACos((v + (
mm_lep-v*v+qv*qv)/2/
E_nu)/qv);
664 const int kNQ2 = 101;
667 double dQ2 = (rQ2.
max-rQ2.
min)/(kNQ2-1);
668 for(
int iq2=0; iq2<kNQ2-1; iq2++)
670 double Q2 = rQ2.
min + iq2*dQ2;
672 double dv = (rv.
max-rv.
min)/(kNv-1);
673 for(
int iv=0; iv<kNv-1; iv++)
675 double v = rv.
min + iv*dv;
677 double dkF = (rkF.
max-rkF.
min);
void SetInteraction(const Interaction *i)
Range1D_t Q2QES_SM_lim(void) const
double vQES_SM_max(double Q2min, double Q2max) const
double mm_lep
Squared mass of final charged lepton (GeV)
double m_ini
Mass of initial hadron or hadron system (GeV)
double Q2(const Interaction *const i)
double E_BIN
Binding energy (GeV)
int HitNucPdg(void) const
double E_nu_thr_SM(void) const
A simple [min,max] interval for doubles.
double HitNucMass(void) const
double m_lep
Mass of final charged lepton (GeV)
double mm_fin
Squared mass of final hadron or hadron system (GeV)
static constexpr double s
static FermiMomentumTablePool * Instance(void)
int SwitchProtonNeutron(int pdgc)
double E_nu
Neutrino energy (GeV)
map< int, double > fNucRmvE
Algorithm abstract base class.
double mm_ini
Sqared mass of initial hadron or hadron system (GeV)
double Mass(Resonance_t res)
resonance mass (GeV)
A table of Fermi momentum constants.
double GetTheta_k(double v, double qv) const
enum genie::EKinePhaseSpace KinePhaseSpace_t
virtual ~SmithMonizUtils()
Range1D_t vQES_SM_lim(double Q2) const
virtual const Registry & GetConfig(void) const
double GetBindingEnergy(void) const
static constexpr double b
double W(const Interaction *const i)
double mm_rnu
Squared mass of residual nucleus (GeV)
Summary information for an interaction.
const Interaction * fInteraction
Range1D_t kFQES_SM_lim(double nu, double Q2) const
double BindEnergyPerNucleon(const Target &target)
Singleton class to load & serve tables of Fermi momentum constants.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
const RgIMap & GetItemMap(void) const
static constexpr double A
const FermiMomentumTable * GetTable(string name)
double Q2lim2_SM(double Q2) const
double P_Fermi
Maximum value of Fermi momentum of target nucleon (GeV)
double BindEnergyPerNucleonParametrization(const Target &target)
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
virtual void Configure(const Registry &config)
double m_rnu
Mass of residual nucleus (GeV)
double Q2lim1_SM(double Q2, double Enu) const
double m_tar
Mass of target nucleus (GeV)
static constexpr double ps
void DMINFC(Functor1D &F, double A, double B, double EPS, double DELTA, double &X, double &Y, bool &LLM) const
double vlim2_SM(double Q2) const
double QEL_EnuMin_SM(double E_nu) const
double vQES_SM_min(double Q2min, double Q2max) const
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
double FermiMomentumForIsoscalarNucleonParametrization(const Target &target)
static PDGLibrary * Instance(void)
static double rho(double P_Fermi, double T_Fermi, double p)
Singleton class to load & serve a TDatabasePDG.
bool HitNucIsSet(void) const
double PhaseSpaceVolume(KinePhaseSpace_t ps) const
A registry. Provides the container for algorithm configuration parameters.
int IonPdgCode(int A, int Z)
const InitialState & InitState(void) const
int IonPdgCodeToZ(int pdgc)
double GetTheta_p(double pv, double v, double qv, double &E_p) const
TParticlePDG * Find(int pdgc, bool must_exist=true)
double FindClosestKF(int target_pdgc, int nucleon_pdgc) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
const Target & Tgt(void) const
double mm_tar
Squared mass of target nucleus (GeV)
void Configure(const Registry &config)
double ProbeE(RefFrame_t rf) const
double m_fin
Mass of final hadron or hadron system (GeV)
double vlim1_SM(double Q2) const
double GetFermiMomentum(void) const
Initial State information.
map< RgKey, RegistryItemI * > RgIMap