29 #include <Math/IFunction.h> 30 #include <Math/RootFinder.h> 32 #include "Framework/Conventions/GBuild.h" 44 using namespace genie;
46 using std::ostringstream;
56 Algorithm(
"genie::SmithMonizUtils", config)
89 const std::string keyStart =
"RFG-NucRemovalE@Pdg=";
98 if (0 == key.compare(0, keyStart.size(), keyStart.c_str()))
100 pdg = atoi(key.c_str() + keyStart.size());
103 if (0 != pdg && 0 != Z)
105 ostringstream key_ss ;
106 key_ss << keyStart <<
pdg;
107 RgKey rgkey = key_ss.str();
110 eb = TMath::Max(eb, 0.);
111 fNucRmvE.insert(map<int,double>::value_type(Z,eb));
125 const InitialState & init_state = interaction -> InitState();
134 mm_lep = TMath::Power(m_lep, 2);
139 TParticlePDG * nucl_fin = pdglib->
Find( nucl_pdg_fin );
155 int Zf = (is_p) ? Zi-1 : Zi;
161 <<
"Unknwown nuclear target! No target with code: " 188 if(is_p)
P_Fermi *= TMath::Power( 2.*Z/A, 1./3);
190 P_Fermi *= TMath::Power( 2.*N/A, 1./3);
215 const int MFC = 10000;
216 const double EPSABS = 0;
217 const double EPSREL = 1.0e-08;
219 double Enu_2 = 5.0e+00;
224 ROOT::Math::RootFinder rfgb(ROOT::Math::RootFinder::kGSL_BRENT);
225 rfgb.Solve(QEL_EnuMin_SM_, E_min, Enu_2, MFC, EPSABS, EPSREL);
226 Enu_rf = rfgb.Root();
232 E_min = TMath::Max(E_min,Enu_rf);
236 LOG(
"SmithMoniz",
pDEBUG) <<
"E_min = " << E_min;
245 const double EPS = 1.0e-06;
246 const double Delta= 1.0e-14;
247 const double Precision = std::numeric_limits<double>::epsilon();
254 double Q2_lim1= tmp*(1.0-sqrtD)-c;
255 double Q2_lim2= tmp*(1.0+sqrtD)-c;
260 DMINFC(Q2lim1_SM_,Q2_lim1,Q2_lim2,EPS,Delta,Q2_0,F_MIN,LLM);
272 double nu_1 = (a*(E-
E_BIN)-P_Fermi*TMath::Sqrt(a*a+Q2*b))/b;
284 double nu_2 = (a*(E-
E_BIN)+P_Fermi*TMath::Sqrt(a*a+Q2*b))/b;
294 const int MFC = 1000;
295 const double EPS = 1.0e-08;
296 const double Delta= 1.0e-14;
297 const double EPSABS = 0;
298 const double EPSREL = 1.0e-08;
306 double Q2_min = tmp*(1.0-sqrtD)-c;
307 double Q2_max = tmp*(1.0+sqrtD)-c;
311 Q2_min= TMath::Max(Q2_min,0.0);
319 DMINFC(Q2lim1_SM_,Q2_min,Q2_max,EPS,Delta,Q2_0,F_MIN,LLM);
323 <<
"No overlapped area for energy " <<
E_nu <<
"\n" <<
324 "Q2_min=" << Q2_min <<
" Q2_max=" << Q2_max <<
"\n" <<
325 "Q2_0=" << Q2_0 <<
" F_MIN=" << F_MIN;
331 ROOT::Math::RootFinder rfgb(ROOT::Math::RootFinder::kGSL_BRENT);
332 rfgb.Solve(Q2lim1_SM_, Q2_min, Q2_0, MFC, EPSABS, EPSREL);
333 double Q2_RF = rfgb.Root();
334 Q2_min= TMath::Max(Q2_min,Q2_RF);
339 ROOT::Math::RootFinder rfgb(ROOT::Math::RootFinder::kGSL_BRENT);
340 rfgb.Solve(Q2lim1_SM_, Q2_0, Q2_max, MFC, EPSABS, EPSREL);
341 double Q2_RF = rfgb.Root();
342 Q2_max= TMath::Min(Q2_max,Q2_RF);
349 LOG(
"SmithMoniz",
pWARN) <<
"The RFG model is not applicable! The cross section is set zero!";
355 ROOT::Math::RootFinder rfgb(ROOT::Math::RootFinder::kGSL_BRENT);
356 rfgb.Solve(Q2lim2_SM_, Q2_min,Q2_max, MFC, EPSABS, EPSREL);
357 double Q2_RF = rfgb.Root();
358 Q2_min= TMath::Max(Q2_min,Q2_RF);
362 Q2_min= TMath::Max(Q2_min,0.0);
377 double tmp1 = a*(E-
E_BIN);
378 double tmp2 = P_Fermi*TMath::Sqrt(a*a+Q2*b);
379 double nu_1 = (tmp1-tmp2)/b;
380 double nu_2 = (tmp1+tmp2)/b;
381 nu_min= TMath::Max(nu_min,nu_1);
382 nu_max= TMath::Min(nu_max,nu_2);
384 if (
E_BIN == 0 && P_Fermi == 0)
389 R =
Range1D_t(0.5*(nu_min+nu_max),0.5*(nu_min+nu_max));
397 double qv = TMath::Sqrt(nu*nu+Q2);
398 double c_f = (nu-
E_BIN)/qv;
400 double Ef_min= m_ini*(c_f*d_f+TMath::Sqrt(1.0-c_f*c_f+d_f*d_f))/(1.0-c_f*c_f);
401 double kF_min= TMath::Sqrt(TMath::Max(Ef_min*Ef_min-
mm_ini,0.0));
407 R =
Range1D_t(0.5*(kF_min+kF_max),0.5*(kF_min+kF_max));
414 return a*a+b*b+c*c-2*(a*b+b*c+a*
c);
420 const double W5 = TMath::Sqrt(5);
421 const double HV = (3-W5)/2;
422 const double HW = (W5-1)/2;
423 const double R1 = 1.0;
424 const double HF = R1/2;
427 if(A!=B) N = TMath::Nint(2.08*TMath::Log(TMath::Abs((A-B)/EPS)));
437 double V, FV,
W, FW, H;
445 LLM = TMath::Abs(X-A)>DELTA && TMath::Abs(X-B)>DELTA;
488 return 1.0/(1.0 + TMath::Exp(-(P_Fermi-p)/T_Fermi));
505 return TMath::ACos((v + (
mm_lep-v*v+qv*qv)/2/
E_nu)/qv);
539 const int kNQ2 = 101;
540 double dQ2 = (rQ2.
max-rQ2.
min)/(kNQ2-1);
541 for(
int iq2=0; iq2<kNQ2; iq2++)
543 double Q2 = (rQ2.
min + iq2*dQ2);
545 double dv = (rvlims.
max-rvlims.
min);
void SetInteraction(const Interaction *i)
Range1D_t Q2QES_SM_lim(void) const
double mm_lep
Squared mass of final charged lepton (GeV)
double m_ini
Mass of initial hadron or hadron system (GeV)
THE MAIN GENIE PROJECT NAMESPACE
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)
double vQES_SM_low_bound(double Q2) const
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
double Q2lim1_SM(double Q2) const
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
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 m_tar
Mass of target nucleus (GeV)
static constexpr double ps
double vQES_SM_upper_bound(double Q2) const
double QEL_EnuMin_SM(double E_nu) const
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
double Enu_in
Running neutrino energy (GeV)
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 LambdaFUNCTION(double a, double b, double c) const
void DMINFC(Func1D< SmithMonizUtils > &F, double A, double B, double EPS, double DELTA, double &X, double &Y, bool &LLM) const
double m_fin
Mass of final hadron or hadron system (GeV)
double GetFermiMomentum(void) const
Initial State information.
map< RgKey, RegistryItemI * > RgIMap