Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
genie::SmithMonizUtils Class Reference

Contains auxiliary functions for Smith-Moniz model.
. More...

#include <SmithMonizUtils.h>

Inheritance diagram for genie::SmithMonizUtils:
genie::Algorithm

Classes

class  Func1D
 

Public Member Functions

 SmithMonizUtils ()
 
 SmithMonizUtils (string config)
 
virtual ~SmithMonizUtils ()
 
void SetInteraction (const Interaction *i)
 
double GetBindingEnergy (void) const
 
double GetFermiMomentum (void) const
 
double GetTheta_k (double v, double qv) const
 
double GetTheta_p (double pv, double v, double qv, double &E_p) const
 
double E_nu_thr_SM (void) const
 
Range1D_t Q2QES_SM_lim (void) const
 
Range1D_t vQES_SM_lim (double Q2) const
 
Range1D_t kFQES_SM_lim (double nu, double Q2) const
 
double PhaseSpaceVolume (KinePhaseSpace_t ps) const
 
void Configure (const Registry &config)
 
void Configure (string config)
 
- Public Member Functions inherited from genie::Algorithm
virtual ~Algorithm ()
 
virtual void FindConfig (void)
 
virtual const RegistryGetConfig (void) const
 
RegistryGetOwnedConfig (void)
 
virtual const AlgIdId (void) const
 Get algorithm ID. More...
 
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status. More...
 
virtual bool AllowReconfig (void) const
 
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm. More...
 
virtual void SetId (const AlgId &id)
 Set algorithm ID. More...
 
virtual void SetId (string name, string config)
 
const AlgorithmSubAlg (const RgKey &registry_key) const
 
void AdoptConfig (void)
 
void AdoptSubstructure (void)
 
virtual void Print (ostream &stream) const
 Print algorithm info. More...
 

Static Public Member Functions

static double rho (double P_Fermi, double T_Fermi, double p)
 
- Static Public Member Functions inherited from genie::Algorithm
static string BuildParamVectKey (const std::string &comm_name, unsigned int i)
 
static string BuildParamVectSizeKey (const std::string &comm_name)
 

Private Member Functions

void LoadConfig (void)
 
double QEL_EnuMin_SM (double E_nu) const
 
double Q2lim1_SM (double Q2) const
 
double Q2lim2_SM (double Q2) 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 vQES_SM_low_bound (double Q2) const
 
double vQES_SM_upper_bound (double Q2) const
 

Private Attributes

map< int, double > fNucRmvE
 
string fKFTable
 
bool fUseParametrization
 
const InteractionfInteraction
 
double E_nu
 Neutrino energy (GeV) More...
 
double m_lep
 Mass of final charged lepton (GeV) More...
 
double mm_lep
 Squared mass of final charged lepton (GeV) More...
 
double m_ini
 Mass of initial hadron or hadron system (GeV) More...
 
double mm_ini
 Sqared mass of initial hadron or hadron system (GeV) More...
 
double m_fin
 Mass of final hadron or hadron system (GeV) More...
 
double mm_fin
 Squared mass of final hadron or hadron system (GeV) More...
 
double m_tar
 Mass of target nucleus (GeV) More...
 
double mm_tar
 Squared mass of target nucleus (GeV) More...
 
double m_rnu
 Mass of residual nucleus (GeV) More...
 
double mm_rnu
 Squared mass of residual nucleus (GeV) More...
 
double P_Fermi
 Maximum value of Fermi momentum of target nucleon (GeV) More...
 
double E_BIN
 Binding energy (GeV) More...
 
double Enu_in
 Running neutrino energy (GeV) More...
 

Additional Inherited Members

- Protected Member Functions inherited from genie::Algorithm
 Algorithm ()
 
 Algorithm (string name)
 
 Algorithm (string name, string config)
 
void Initialize (void)
 
void DeleteConfig (void)
 
void DeleteSubstructure (void)
 
RegistryExtractLocalConfig (const Registry &in) const
 
RegistryExtractLowerConfig (const Registry &in, const string &alg_key) const
 Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key. More...
 
template<class T >
bool GetParam (const RgKey &name, T &p, bool is_top_call=true) const
 
template<class T >
bool GetParamDef (const RgKey &name, T &p, const T &def) const
 
template<class T >
int GetParamVect (const std::string &comm_name, std::vector< T > &v, bool is_top_call=true) const
 Handle to load vectors of parameters. More...
 
int GetParamVectKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
 
int AddTopRegistry (Registry *rp, bool owns=true)
 add registry with top priority, also update ownership More...
 
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership More...
 
int MergeTopRegistry (const Registry &r)
 
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships. More...
 
- Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
 
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...) More...
 
AlgId fID
 algorithm name and configuration set More...
 
vector< Registry * > fConfVect
 
vector< boolfOwnerships
 ownership for every registry in fConfVect More...
 
AlgStatus_t fStatus
 algorithm execution status More...
 
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool) More...
 

Detailed Description

Contains auxiliary functions for Smith-Moniz model.
.

[1] R.A.Smith and E.J.Moniz, Nuclear Physics B43, (1972) 605-622
[2] K.S. Kuzmin, V.V. Lyubushkin, V.A.Naumov Eur. Phys. J. C54, (2008) 517-538

Author
Igor Kakorin kakor.nosp@m.in@j.nosp@m.inr.r.nosp@m.u Joint Institute for Nuclear Research
adapted from fortran code provided by:
Konstantin Kuzmin kkuzm.nosp@m.in@t.nosp@m.heor..nosp@m.jinr.nosp@m..ru Joint Institute for Nuclear Research
Vladimir Lyubushkin Joint Institute for Nuclear Research
Vadim Naumov vnaum.nosp@m.ov@t.nosp@m.heor..nosp@m.jinr.nosp@m..ru Joint Institute for Nuclear Research
based on code of:
Costas Andreopoulos const.nosp@m.anti.nosp@m.nos.a.nosp@m.ndre.nosp@m.opoul.nosp@m.os@c.nosp@m.ern.c.nosp@m.h University of Liverpool & STFC Rutherford Appleton Laboratory

May 05, 2017

Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 51 of file SmithMonizUtils.h.

Constructor & Destructor Documentation

SmithMonizUtils::SmithMonizUtils ( )

Definition at line 49 of file SmithMonizUtils.cxx.

49  :
50 Algorithm("genie::SmithMonizUtils")
51 {
52 
53 }
SmithMonizUtils::SmithMonizUtils ( string  config)

Definition at line 55 of file SmithMonizUtils.cxx.

55  :
56 Algorithm("genie::SmithMonizUtils", config)
57 {
58 
59 }
static Config * config
Definition: config.cpp:1054
SmithMonizUtils::~SmithMonizUtils ( )
virtual

Definition at line 61 of file SmithMonizUtils.cxx.

62 {
63 
64 }

Member Function Documentation

void SmithMonizUtils::Configure ( const Registry config)
virtual

methods overloading the Algorithm() interface implementation to build the fragmentation function from configuration data

Reimplemented from genie::Algorithm.

Definition at line 66 of file SmithMonizUtils.cxx.

67 {
68  Algorithm::Configure(config);
69  this->LoadConfig();
70 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void SmithMonizUtils::Configure ( string  config)
virtual

Configure the algorithm from the AlgoConfigPool based on param_set string given in input An algorithm contains a vector of registries coming from different xml configuration files, which are loaded according a very precise prioriy This methods will load a number registries in order of priority: 1) "Tunable" parameter set from CommonParametes. This is loaded with the highest prioriry and it is designed to be used for tuning procedure Usage not expected from the user. 2) For every string defined in "CommonParame" the corresponding parameter set will be loaded from CommonParameter.xml 3) parameter set specified by the config string and defined in the xml file of the algorithm 4) if config is not "Default" also the Default parameter set from the same xml file will be loaded Effectively this avoids the repetion of a parameter when it is not changed in the requested configuration

Reimplemented from genie::Algorithm.

Definition at line 72 of file SmithMonizUtils.cxx.

73 {
75  this->LoadConfig();
76 }
static Config * config
Definition: config.cpp:1054
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void SmithMonizUtils::DMINFC ( Func1D< SmithMonizUtils > &  F,
double  A,
double  B,
double  EPS,
double  DELTA,
double &  X,
double &  Y,
bool LLM 
) const
private

Definition at line 418 of file SmithMonizUtils.cxx.

419 {
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;
425 
426  int N = -1;
427  if(A!=B) N = TMath::Nint(2.08*TMath::Log(TMath::Abs((A-B)/EPS)));
428  double C = A;
429  double D = B;
430  if(A>B)
431  {
432  C = B;
433  D = A;
434  }
435  bool LLT = true;
436  bool LGE = true;
437  double V, FV, W, FW, H;
438  while(true)
439  {
440  H = D-C;
441  if(N<0)
442  {
443  X = HF*(C+D);
444  Y = F(X);
445  LLM = TMath::Abs(X-A)>DELTA && TMath::Abs(X-B)>DELTA;
446  return;
447  }
448  if(LLT)
449  {
450  V = C+HV*H;
451  FV = F(V);
452  }
453  if(LGE)
454  {
455  W = C+HW*H;
456  FW = F(W);
457  }
458  if(FV<FW)
459  {
460  LLT = true;
461  LGE = false;
462  D = W;
463  W = V;
464  FW = FV;
465  }
466  else
467  {
468  LLT = false;
469  LGE = true;
470  C = V;
471  V = W;
472  FV = FW;
473  }
474  N = N-1;
475  }
476 }
#define D
Debug message.
Definition: tclscanner.cpp:775
#define A
Definition: memgrp.cpp:38
double SmithMonizUtils::E_nu_thr_SM ( void  ) const

Definition at line 209 of file SmithMonizUtils.cxx.

210 {
211 
212  Func1D<SmithMonizUtils> QEL_EnuMin_SM_(*this, &SmithMonizUtils::QEL_EnuMin_SM);
213 
214 
215  const int MFC = 10000; // Maximum of function call
216  const double EPSABS = 0;
217  const double EPSREL = 1.0e-08;
218  double E_min = ((m_lep + m_rnu + m_fin)*(m_lep + m_rnu + m_fin) - mm_tar)/(2*m_tar);
219  double Enu_2 = 5.0e+00;
220  double Enu_rf;
221  if (QEL_EnuMin_SM(E_min) > 0)
222  {
223  // C++ analog of fortran function Enu_rf= DZEROX(E_min,Enu_2,EPS,MFC,QEL_EnuMin_SM,1)
224  ROOT::Math::RootFinder rfgb(ROOT::Math::RootFinder::kGSL_BRENT);
225  rfgb.Solve(QEL_EnuMin_SM_, E_min, Enu_2, MFC, EPSABS, EPSREL); //convergence is reached using tolerance = 2 *( epsrel * abs(x) + epsabs)
226  Enu_rf = rfgb.Root();
227  }
228  else
229  {
230  Enu_rf = -1.0e+01;
231  }
232  E_min = TMath::Max(E_min,Enu_rf);
233  if(E_min < 0)
234  {
235  E_min = 0;
236  LOG("SmithMoniz", pDEBUG) << "E_min = " << E_min;
237  }
238  return E_min;
239 
240 }
double m_lep
Mass of final charged lepton (GeV)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
double m_rnu
Mass of residual nucleus (GeV)
double m_tar
Mass of target nucleus (GeV)
double QEL_EnuMin_SM(double E_nu) const
double mm_tar
Squared mass of target nucleus (GeV)
double m_fin
Mass of final hadron or hadron system (GeV)
#define pDEBUG
Definition: Messenger.h:63
double SmithMonizUtils::GetBindingEnergy ( void  ) const

Definition at line 493 of file SmithMonizUtils.cxx.

494 {
495  return E_BIN;
496 }
double E_BIN
Binding energy (GeV)
double SmithMonizUtils::GetFermiMomentum ( void  ) const

Definition at line 498 of file SmithMonizUtils.cxx.

499 {
500  return P_Fermi;
501 }
double P_Fermi
Maximum value of Fermi momentum of target nucleon (GeV)
double SmithMonizUtils::GetTheta_k ( double  v,
double  qv 
) const

Definition at line 503 of file SmithMonizUtils.cxx.

504 {
505  return TMath::ACos((v + (mm_lep-v*v+qv*qv)/2/E_nu)/qv);
506 }
double mm_lep
Squared mass of final charged lepton (GeV)
double E_nu
Neutrino energy (GeV)
double SmithMonizUtils::GetTheta_p ( double  pv,
double  v,
double  qv,
double &  E_p 
) const

Definition at line 508 of file SmithMonizUtils.cxx.

509 {
510  E_p = TMath::Sqrt(mm_ini+pv*pv)-E_BIN;
511  if (pv != 0)
512  return TMath::ACos(((v-E_BIN)*(2*E_p+v+E_BIN)-qv*qv+mm_ini-mm_fin)/(2*pv*qv));
513  else
514  return 0;
515 }
double E_BIN
Binding energy (GeV)
double mm_fin
Squared mass of final hadron or hadron system (GeV)
double mm_ini
Sqared mass of initial hadron or hadron system (GeV)
Range1D_t SmithMonizUtils::kFQES_SM_lim ( double  nu,
double  Q2 
) const

Definition at line 395 of file SmithMonizUtils.cxx.

396 {
397  double qv = TMath::Sqrt(nu*nu+Q2);
398  double c_f = (nu-E_BIN)/qv;
399  double d_f = (E_BIN*E_BIN-2*nu*E_BIN-Q2+mm_ini-mm_fin)/(2*qv*m_ini);
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));
402  double kF_max= P_Fermi;
403  Range1D_t R;
404  if (kF_min<=kF_max)
405  R = Range1D_t(kF_min,kF_max);
406  else
407  R = Range1D_t(0.5*(kF_min+kF_max),0.5*(kF_min+kF_max));
408  return R;
409 
410 }
double m_ini
Mass of initial hadron or hadron system (GeV)
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1064
double E_BIN
Binding energy (GeV)
A simple [min,max] interval for doubles.
Definition: Range1.h:42
double mm_fin
Squared mass of final hadron or hadron system (GeV)
double mm_ini
Sqared mass of initial hadron or hadron system (GeV)
double P_Fermi
Maximum value of Fermi momentum of target nucleon (GeV)
double SmithMonizUtils::LambdaFUNCTION ( double  a,
double  b,
double  c 
) const
private

Definition at line 412 of file SmithMonizUtils.cxx.

413 {
414  return a*a+b*b+c*c-2*(a*b+b*c+a*c);
415 }
const double a
static bool * b
Definition: config.cpp:1043
void SmithMonizUtils::LoadConfig ( void  )
private

Definition at line 78 of file SmithMonizUtils.cxx.

79 {
80 
81 
82  GetParam( "FermiMomentumTable", fKFTable);
83  GetParam( "RFG-UseParametrization", fUseParametrization);
84 
85 
86  // Load removal energy for specific nuclei from either the algorithm's
87  // configuration file or the UserPhysicsOptions file.
88  // If none is used use Wapstra's semi-empirical formula.
89  const std::string keyStart = "RFG-NucRemovalE@Pdg=";
90 
91  RgIMap entries = GetConfig().GetItemMap();
92 
93  for(RgIMap::const_iterator it = entries.begin(); it != entries.end(); ++it)
94  {
95  const std::string& key = it->first;
96  int pdg = 0;
97  int Z = 0;
98  if (0 == key.compare(0, keyStart.size(), keyStart.c_str()))
99  {
100  pdg = atoi(key.c_str() + keyStart.size());
101  Z = pdg::IonPdgCodeToZ(pdg);
102  }
103  if (0 != pdg && 0 != Z)
104  {
105  ostringstream key_ss ;
106  key_ss << keyStart << pdg;
107  RgKey rgkey = key_ss.str();
108  double eb;
109  GetParam( rgkey, eb ) ;
110  eb = TMath::Max(eb, 0.);
111  fNucRmvE.insert(map<int,double>::value_type(Z,eb));
112  }
113  }
114 
115 
116 }
std::string string
Definition: nybbler.cc:12
map< int, double > fNucRmvE
intermediate_table::const_iterator const_iterator
virtual const Registry & GetConfig(void) const
Definition: Algorithm.cxx:246
const RgIMap & GetItemMap(void) const
Definition: Registry.h:161
def key(type, name=None)
Definition: graph.py:13
string RgKey
int IonPdgCodeToZ(int pdgc)
Definition: PDGUtils.cxx:52
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
map< RgKey, RegistryItemI * > RgIMap
Definition: Registry.h:45
double SmithMonizUtils::PhaseSpaceVolume ( KinePhaseSpace_t  ps) const

Definition at line 527 of file SmithMonizUtils.cxx.

528 {
529  double vol = 0.0;
530  if (ps == kPSQ2fE)
531  {
532  Range1D_t rQ2 = Q2QES_SM_lim();
533  vol = rQ2.max - rQ2.min;
534  return vol;
535  }
536  else if (ps == kPSQ2vfE)
537  {
538  Range1D_t rQ2 = Q2QES_SM_lim();
539  const int kNQ2 = 101;
540  double dQ2 = (rQ2.max-rQ2.min)/(kNQ2-1);
541  for(int iq2=0; iq2<kNQ2; iq2++)
542  {
543  double Q2 = (rQ2.min + iq2*dQ2);
544  Range1D_t rvlims = vQES_SM_lim(Q2);
545  double dv = (rvlims.max-rvlims.min);
546  vol += (dQ2*dv);
547  }
548  return vol;
549  }
550  else
551  return 0;
552 }
Range1D_t Q2QES_SM_lim(void) const
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1064
A simple [min,max] interval for doubles.
Definition: Range1.h:42
Range1D_t vQES_SM_lim(double Q2) const
static constexpr double ps
Definition: Units.h:99
double max
Definition: Range1.h:53
double min
Definition: Range1.h:52
double SmithMonizUtils::Q2lim1_SM ( double  Q2) const
private

Definition at line 265 of file SmithMonizUtils.cxx.

266 {
267  double s = 2*Enu_in*m_tar+mm_tar;
268  double nu_max = (s-mm_tar-mm_lep*(s-mm_tar)/(Q2+mm_lep)-mm_tar*(Q2+mm_lep)/(s-mm_tar))/(2*m_tar);
269  double E = sqrt(P_Fermi*P_Fermi+mm_ini);
270  double b = (E-E_BIN)*(E-E_BIN)-P_Fermi*P_Fermi;
271  double a = 0.5*(Q2+mm_fin-b);
272  double nu_1 = (a*(E-E_BIN)-P_Fermi*TMath::Sqrt(a*a+Q2*b))/b;
273  return nu_1-nu_max;
274 
275 }
double mm_lep
Squared mass of final charged lepton (GeV)
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1064
double E_BIN
Binding energy (GeV)
double mm_fin
Squared mass of final hadron or hadron system (GeV)
double mm_ini
Sqared mass of initial hadron or hadron system (GeV)
const double a
double P_Fermi
Maximum value of Fermi momentum of target nucleon (GeV)
double m_tar
Mass of target nucleus (GeV)
double Enu_in
Running neutrino energy (GeV)
static bool * b
Definition: config.cpp:1043
double mm_tar
Squared mass of target nucleus (GeV)
static QCString * s
Definition: config.cpp:1042
double SmithMonizUtils::Q2lim2_SM ( double  Q2) const
private

Definition at line 278 of file SmithMonizUtils.cxx.

279 {
280  double nu_min = ((m_rnu+m_fin)*(m_rnu+m_fin)+Q2-mm_tar)/(2*m_tar);
281  double E = sqrt(P_Fermi*P_Fermi+mm_ini);
282  double b = (E-E_BIN)*(E-E_BIN)-P_Fermi*P_Fermi;
283  double a = (Q2+mm_fin-b)*0.5;
284  double nu_2 = (a*(E-E_BIN)+P_Fermi*TMath::Sqrt(a*a+Q2*b))/b;
285  return nu_min-nu_2;
286 
287 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1064
double E_BIN
Binding energy (GeV)
double mm_fin
Squared mass of final hadron or hadron system (GeV)
double mm_ini
Sqared mass of initial hadron or hadron system (GeV)
const double a
double P_Fermi
Maximum value of Fermi momentum of target nucleon (GeV)
double m_rnu
Mass of residual nucleus (GeV)
double m_tar
Mass of target nucleus (GeV)
static bool * b
Definition: config.cpp:1043
double mm_tar
Squared mass of target nucleus (GeV)
double m_fin
Mass of final hadron or hadron system (GeV)
Range1D_t SmithMonizUtils::Q2QES_SM_lim ( void  ) const

Definition at line 290 of file SmithMonizUtils.cxx.

291 {
292 
293 
294  const int MFC = 1000; // Maximum of function call
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;
299 
300  Enu_in = E_nu;
301  double s = 2*E_nu*m_tar+mm_tar;
302  double W2 = (m_rnu+m_fin)*(m_rnu+m_fin);
303  double c = 0.5*(W2+mm_lep-mm_tar*(W2-mm_lep)/s);
304  double sqrtD = TMath::Sqrt(LambdaFUNCTION(1.0, mm_lep/s, W2/s));
305  double tmp = 0.5*(s-mm_tar);
306  double Q2_min = tmp*(1.0-sqrtD)-c;
307  double Q2_max = tmp*(1.0+sqrtD)-c;
308  // if the nucleus is hydrogen or deuterium then there is no need in further calculation
309  if (E_BIN == 0 && P_Fermi == 0)
310  {
311  Q2_min= TMath::Max(Q2_min,0.0);
312  Range1D_t R(Q2_min,Q2_max);
313  return R;
314  }
315  double F_MIN, Q2_0;
316  bool LLM;
317  // C++ analog of fortran function DMINFC(Q2lim1_SM,Q2_min,Q2_max,EPS,Delta,Q2_0,F_MIN,LLM)
318  Func1D<SmithMonizUtils> Q2lim1_SM_(*this, &SmithMonizUtils::Q2lim1_SM);
319  DMINFC(Q2lim1_SM_,Q2_min,Q2_max,EPS,Delta,Q2_0,F_MIN,LLM);
320  if (F_MIN>0)
321  {
322  LOG("SmithMoniz", pFATAL)
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;
326  exit(1);
327  }
328  if (Q2lim1_SM(Q2_min)>0)
329  {
330  //C++ analog of fortran function Q2_RF=DZEROX(Q2_min,Q2_0,EPS,MFC,Q2lim1_SM,1)
331  ROOT::Math::RootFinder rfgb(ROOT::Math::RootFinder::kGSL_BRENT);
332  rfgb.Solve(Q2lim1_SM_, Q2_min, Q2_0, MFC, EPSABS, EPSREL); //convergence is reached using tolerance = 2 *( epsrel * abs(x) + epsabs)
333  double Q2_RF = rfgb.Root();
334  Q2_min= TMath::Max(Q2_min,Q2_RF);
335  }
336  if(Q2lim1_SM(Q2_max)>0)
337  {
338  // C++ analog of fortran function Q2_RF=DZEROX(Q2_0,Q2_max,Eps,MFC,Q2lim1_SM,1)
339  ROOT::Math::RootFinder rfgb(ROOT::Math::RootFinder::kGSL_BRENT);
340  rfgb.Solve(Q2lim1_SM_, Q2_0, Q2_max, MFC, EPSABS, EPSREL); //convergence is reached using tolerance = 2 *( epsrel * abs(x) + epsabs)
341  double Q2_RF = rfgb.Root();
342  Q2_max= TMath::Min(Q2_max,Q2_RF);
343  }
344  Func1D<SmithMonizUtils> Q2lim2_SM_(*this, &SmithMonizUtils::Q2lim2_SM);
345  if (Q2lim2_SM(Q2_min)>0)
346  {
347  if(Q2lim2_SM(Q2_max)>0)
348  {
349  LOG("SmithMoniz", pWARN) << "The RFG model is not applicable! The cross section is set zero!";
350  Q2_min = Q2_max;
351  }
352  else
353  {
354  // C++ analog of fortran function Q2_RF = DZEROX(Q2_min,Q2_max,Eps,MFC,Q2lim2_SM,1)
355  ROOT::Math::RootFinder rfgb(ROOT::Math::RootFinder::kGSL_BRENT);
356  rfgb.Solve(Q2lim2_SM_, Q2_min,Q2_max, MFC, EPSABS, EPSREL); //convergence is reached using tolerance = 2 *( epsrel * abs(x) + epsabs)
357  double Q2_RF = rfgb.Root();
358  Q2_min= TMath::Max(Q2_min,Q2_RF);
359  }
360  }
361 
362  Q2_min= TMath::Max(Q2_min,0.0);
363  Range1D_t R(Q2_min,Q2_max);
364  return R;
365 
366 }
double mm_lep
Squared mass of final charged lepton (GeV)
double E_BIN
Binding energy (GeV)
A simple [min,max] interval for doubles.
Definition: Range1.h:42
#define pFATAL
Definition: Messenger.h:56
double E_nu
Neutrino energy (GeV)
double Q2lim1_SM(double Q2) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
double Q2lim2_SM(double Q2) const
double P_Fermi
Maximum value of Fermi momentum of target nucleon (GeV)
double m_rnu
Mass of residual nucleus (GeV)
double m_tar
Mass of target nucleus (GeV)
string tmp
Definition: languages.py:63
#define pWARN
Definition: Messenger.h:60
double Enu_in
Running neutrino energy (GeV)
double mm_tar
Squared mass of target nucleus (GeV)
double LambdaFUNCTION(double a, double b, double c) const
static QCString * s
Definition: config.cpp:1042
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 SmithMonizUtils::QEL_EnuMin_SM ( double  E_nu) const
private

Definition at line 243 of file SmithMonizUtils.cxx.

244 {
245  const double EPS = 1.0e-06;
246  const double Delta= 1.0e-14;
247  const double Precision = std::numeric_limits<double>::epsilon();
248  Enu_in = Enu;
249  double s = 2*Enu*m_tar+mm_tar;
250  double W2 = (m_rnu+m_fin)*(m_rnu+m_fin);
251  double c = 0.5*(W2+mm_lep-mm_tar*(W2-mm_lep)/s);
252  double sqrtD = TMath::Sqrt(TMath::Max(Precision,LambdaFUNCTION(1.0, mm_lep/s, W2/s)));
253  double tmp = 0.5*(s-mm_tar);
254  double Q2_lim1= tmp*(1.0-sqrtD)-c;
255  double Q2_lim2= tmp*(1.0+sqrtD)-c;
256  // C++ analog of fortran function DMINFC(Q2lim1_SM,Q2_lim1,Q2_lim2,EPS,Delta,Q2_0,F_MIN,LLM)
257  Func1D<SmithMonizUtils> Q2lim1_SM_(*this, &SmithMonizUtils::Q2lim1_SM);
258  double Q2_0,F_MIN;
259  bool LLM;
260  DMINFC(Q2lim1_SM_,Q2_lim1,Q2_lim2,EPS,Delta,Q2_0,F_MIN,LLM);
261  return F_MIN;
262 }
double mm_lep
Squared mass of final charged lepton (GeV)
double Q2lim1_SM(double Q2) const
double m_rnu
Mass of residual nucleus (GeV)
double m_tar
Mass of target nucleus (GeV)
string tmp
Definition: languages.py:63
double Enu_in
Running neutrino energy (GeV)
double mm_tar
Squared mass of target nucleus (GeV)
double LambdaFUNCTION(double a, double b, double c) const
static QCString * s
Definition: config.cpp:1042
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 SmithMonizUtils::rho ( double  P_Fermi,
double  T_Fermi,
double  p 
)
static

Definition at line 479 of file SmithMonizUtils.cxx.

480 {
481 
482  if (T_Fermi==0) //Pure Fermi gaz with T_Fermi=0
483  if(p<=P_Fermi)
484  return 1.0;
485  else
486  return 0.0;
487  else //Fermi-Dirac distribution
488  return 1.0/(1.0 + TMath::Exp(-(P_Fermi-p)/T_Fermi));
489 
490 
491 }
double P_Fermi
Maximum value of Fermi momentum of target nucleon (GeV)
p
Definition: test.py:223
void SmithMonizUtils::SetInteraction ( const Interaction i)

Definition at line 119 of file SmithMonizUtils.cxx.

120 {
121 
123  // Get kinematics & init-state parameters
124  // unused // const Kinematics & kinematics = interaction -> Kine();
125  const InitialState & init_state = interaction -> InitState();
126  const Target & target = init_state.Tgt();
127  PDGLibrary * pdglib = PDGLibrary::Instance();
128 
129  E_nu = interaction->InitState().ProbeE(kRfLab); // Neutrino energy (GeV)
130 
131  assert(target.HitNucIsSet());
132  // get lepton&nuclear masses (init & final state nucleus)
133  m_lep = interaction->FSPrimLepton()->Mass(); // Mass of final charged lepton (GeV)
134  mm_lep = TMath::Power(m_lep, 2);
135  int nucl_pdg_ini = target.HitNucPdg();
136  m_ini = target.HitNucMass();
137  mm_ini = TMath::Power(m_ini, 2);
138  int nucl_pdg_fin = genie::pdg::SwitchProtonNeutron(nucl_pdg_ini);
139  TParticlePDG * nucl_fin = pdglib->Find( nucl_pdg_fin );
140  m_fin = nucl_fin -> Mass(); // Mass of final hadron or hadron system (GeV)
141  mm_fin = TMath::Power(m_fin, 2);
142  m_tar = target.Mass(); // Mass of target nucleus (GeV)
143  mm_tar = TMath::Power(m_tar, 2);
144 
145  // For hydrogen and deuterium RFG is not applied
146  if (target.A()<3)
147  {
148  E_BIN = P_Fermi = m_rnu = mm_rnu = 0;
149  return;
150  }
151 
152  bool is_p = pdg::IsProton(nucl_pdg_ini);
153  int Zi = target.Z();
154  int Ai = target.A();
155  int Zf = (is_p) ? Zi-1 : Zi;
156  int Af = Ai-1;
157  TParticlePDG * nucl_f = pdglib->Find( pdg::IonPdgCode(Af, Zf) );
158  if(!nucl_f)
159  {
160  LOG("SmithMoniz", pFATAL)
161  << "Unknwown nuclear target! No target with code: "
162  << pdg::IonPdgCode(Af, Zf) << " in PDGLibrary!";
163  exit(1);
164  }
165 
166  m_rnu = nucl_f -> Mass(); // Mass of residual nucleus (GeV)
167  mm_rnu = TMath::Power(m_rnu, 2);
168 
169  int Z = target.Z();
170  int A = target.A();
171  int N = A-Z;
172 
173 
174  // Maximum value of Fermi momentum of target nucleon (GeV)
175  if (A < 6 || !fUseParametrization)
176  {
177  //-- look up the Fermi momentum for this Target
179  const FermiMomentumTable * kft = kftp->GetTable(fKFTable);
180  P_Fermi = kft->FindClosestKF(pdg::IonPdgCode(A, Z), nucl_pdg_ini);
181  }
182  else
183  {
184  //-- define the Fermi momentum for this Target
185  //
187  //-- correct the Fermi momentum for the struck nucleon
188  if(is_p) P_Fermi *= TMath::Power( 2.*Z/A, 1./3);
189  else
190  P_Fermi *= TMath::Power( 2.*N/A, 1./3);
191  }
192 
193  // Neutrino binding energy (GeV)
194  if (target.A() < 6 || !fUseParametrization)
195  {
197  if(it != fNucRmvE.end()) E_BIN = it->second;
199  }
200  else
202 
203 
204 
205 
206 }
double mm_lep
Squared mass of final charged lepton (GeV)
double m_ini
Mass of initial hadron or hadron system (GeV)
double E_BIN
Binding energy (GeV)
int HitNucPdg(void) const
Definition: Target.cxx:304
int A(void) const
Definition: Target.h:70
double HitNucMass(void) const
Definition: Target.cxx:233
double m_lep
Mass of final charged lepton (GeV)
#define pFATAL
Definition: Messenger.h:56
double mm_fin
Squared mass of final hadron or hadron system (GeV)
static FermiMomentumTablePool * Instance(void)
int SwitchProtonNeutron(int pdgc)
Definition: PDGUtils.cxx:353
double E_nu
Neutrino energy (GeV)
map< int, double > fNucRmvE
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.
intermediate_table::const_iterator const_iterator
double Mass(void) const
Definition: Target.cxx:224
double mm_rnu
Squared mass of residual nucleus (GeV)
const Interaction * fInteraction
double BindEnergyPerNucleon(const Target &target)
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:333
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...
Definition: Messenger.h:96
const FermiMomentumTable * GetTable(string name)
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...
Definition: Target.h:40
double m_rnu
Mass of residual nucleus (GeV)
int Z(void) const
Definition: Target.h:68
double m_tar
Mass of target nucleus (GeV)
double FermiMomentumForIsoscalarNucleonParametrization(const Target &target)
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
Singleton class to load & serve a TDatabasePDG.
Definition: PDGLibrary.h:32
bool HitNucIsSet(void) const
Definition: Target.cxx:283
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:68
#define A
Definition: memgrp.cpp:38
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
double FindClosestKF(int target_pdgc, int nucleon_pdgc) const
const Target & Tgt(void) const
Definition: InitialState.h:66
double mm_tar
Squared mass of target nucleus (GeV)
double m_fin
Mass of final hadron or hadron system (GeV)
Initial State information.
Definition: InitialState.h:48
Range1D_t SmithMonizUtils::vQES_SM_lim ( double  Q2) const

Definition at line 369 of file SmithMonizUtils.cxx.

370 {
371  double s = 2*E_nu*m_tar+mm_tar;
372  double nu_min= ((m_rnu+m_fin)*(m_rnu+m_fin)+Q2-mm_tar)/(2*m_tar);
373  double nu_max= (s-mm_tar-mm_lep*(s-mm_tar)/(Q2+mm_lep)-mm_tar*(Q2+mm_lep)/(s-mm_tar))/(2*m_tar);
374  double E = TMath::Sqrt(P_Fermi*P_Fermi+mm_ini);
375  double b = (E-E_BIN)*(E-E_BIN)-P_Fermi*P_Fermi;
376  double a = (Q2+mm_fin-b)*0.5;
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);
383  Range1D_t R;
384  if (E_BIN == 0 && P_Fermi == 0)
385  nu_max=nu_min;
386  if (nu_min<=nu_max)
387  R = Range1D_t(nu_min,nu_max);
388  else
389  R = Range1D_t(0.5*(nu_min+nu_max),0.5*(nu_min+nu_max));
390  return R;
391 
392 }
double mm_lep
Squared mass of final charged lepton (GeV)
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1064
double E_BIN
Binding energy (GeV)
A simple [min,max] interval for doubles.
Definition: Range1.h:42
double mm_fin
Squared mass of final hadron or hadron system (GeV)
double E_nu
Neutrino energy (GeV)
double mm_ini
Sqared mass of initial hadron or hadron system (GeV)
const double a
double P_Fermi
Maximum value of Fermi momentum of target nucleon (GeV)
double m_rnu
Mass of residual nucleus (GeV)
double m_tar
Mass of target nucleus (GeV)
static bool * b
Definition: config.cpp:1043
double mm_tar
Squared mass of target nucleus (GeV)
static QCString * s
Definition: config.cpp:1042
double m_fin
Mass of final hadron or hadron system (GeV)
double SmithMonizUtils::vQES_SM_low_bound ( double  Q2) const
private

Definition at line 517 of file SmithMonizUtils.cxx.

518 {
519  return vQES_SM_lim(Q2).min;
520 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1064
Range1D_t vQES_SM_lim(double Q2) const
double min
Definition: Range1.h:52
double SmithMonizUtils::vQES_SM_upper_bound ( double  Q2) const
private

Definition at line 522 of file SmithMonizUtils.cxx.

523 {
524  return -1.0*vQES_SM_lim(Q2).max;
525 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1064
Range1D_t vQES_SM_lim(double Q2) const
double max
Definition: Range1.h:53

Member Data Documentation

double genie::SmithMonizUtils::E_BIN
private

Binding energy (GeV)

Definition at line 117 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::E_nu
private

Neutrino energy (GeV)

Definition at line 105 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::Enu_in
mutableprivate

Running neutrino energy (GeV)

Definition at line 118 of file SmithMonizUtils.h.

const Interaction* genie::SmithMonizUtils::fInteraction
private

Definition at line 100 of file SmithMonizUtils.h.

string genie::SmithMonizUtils::fKFTable
private

Definition at line 97 of file SmithMonizUtils.h.

map<int, double> genie::SmithMonizUtils::fNucRmvE
private

Definition at line 96 of file SmithMonizUtils.h.

bool genie::SmithMonizUtils::fUseParametrization
private

Definition at line 98 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::m_fin
private

Mass of final hadron or hadron system (GeV)

Definition at line 110 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::m_ini
private

Mass of initial hadron or hadron system (GeV)

Definition at line 108 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::m_lep
private

Mass of final charged lepton (GeV)

Definition at line 106 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::m_rnu
private

Mass of residual nucleus (GeV)

Definition at line 114 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::m_tar
private

Mass of target nucleus (GeV)

Definition at line 112 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::mm_fin
private

Squared mass of final hadron or hadron system (GeV)

Definition at line 111 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::mm_ini
private

Sqared mass of initial hadron or hadron system (GeV)

Definition at line 109 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::mm_lep
private

Squared mass of final charged lepton (GeV)

Definition at line 107 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::mm_rnu
private

Squared mass of residual nucleus (GeV)

Definition at line 115 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::mm_tar
private

Squared mass of target nucleus (GeV)

Definition at line 113 of file SmithMonizUtils.h.

double genie::SmithMonizUtils::P_Fermi
private

Maximum value of Fermi momentum of target nucleon (GeV)

Definition at line 116 of file SmithMonizUtils.h.


The documentation for this class was generated from the following files: