19 #include "Framework/Conventions/GBuild.h"
29 using std::ostringstream;
30 using namespace genie;
31 using namespace genie::constants;
32 using namespace genie::utils;
53 double hitNucleonRadius)
const
62 TH1D * prob = this->
ProbDistro(target,hitNucleonRadius);
65 <<
"Null nucleon momentum probability distribution";
71 double costheta = -1. + 2. * rnd->
RndGen().Rndm();
72 double sintheta = TMath::Sqrt(1.-costheta*costheta);
73 double fi = 2 *
kPi * rnd->
RndGen().Rndm();
74 double cosfi = TMath::Cos(fi);
75 double sinfi = TMath::Sin(fi);
82 map<int,double>::const_iterator it =
fNucRmvE.find(Z);
89 p = prob->GetRandom();
91 LOG(
"LocalFGM",
pINFO) <<
"|p,nucleon| = " << p;
93 px = p*sintheta*cosfi;
94 py = p*sintheta*sinfi;
106 double T_F = TMath::Sqrt(TMath::Power(nucl_mass,2)+TMath::Power(KF,2)) - nucl_mass;
110 double localEb = T_F;
113 double T_nucl = TMath::Sqrt(TMath::Power(
fCurrMomentum.Mag(),2)+TMath::Power(nucl_mass,2))- nucl_mass;
117 if(it !=
fNucRmvE.end()) q_val_offset = it->second;
122 fCurrRemovalEnergy = localEb + q_val_offset - T_nucl;
129 if(it !=
fNucRmvE.end()) fCurrRemovalEnergy = it->second;
136 if(fCurrRemovalEnergy<0) doThrow=
true;
137 else doThrow =
false;
148 double hitNucleonRadius)
const
151 TH1D * prob = this->
ProbDistro(target, hitNucleonRadius);
152 int bin = prob->FindBin(p);
153 double y = prob->GetBinContent(bin);
154 double dx = prob->GetBinWidth(bin);
166 <<
"Computing P = f(p_nucleon) for: " << target.
AsString()
167 <<
", Nucleon Radius = " << r;
169 <<
", P(max) = " <<
fPMax;
198 int npbins = (int) (1000*
fPMax);
199 TH1D * prob =
new TH1D(
"",
"", npbins, 0,
fPMax);
200 prob->SetDirectory(0);
202 double dp =
fPMax / (npbins-1);
206 for(
int i = 0; i < npbins; i++) {
208 double p2 = TMath::Power(p,2);
222 double dP_dp = 4*
kPi * p2 * phi2;
223 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
224 LOG(
"LocalFGM",
pDEBUG) <<
"p = " << p <<
", dP/dp = " << dP_dp;
226 prob->Fill(p, dP_dp);
229 double normfactor = prob->Integral(
"width");
232 if (normfactor > 0) prob->Scale(1/normfactor);
242 double numNuc = (double) ( (is_p) ? t.
Z() : t.
N() );
279 LOG(
"LocalFGM",
pFATAL) <<
"Momentum CutOff greater than Momentum Max";
289 for(
int Z=1; Z<140; Z++) {
290 for(
int A=Z;
A<3*Z;
A++) {
293 key <<
"RFG-NucRemovalE@Pdg=" << pdgc;
294 RgKey rgkey = key.str();
296 if (
GetParam( rgkey, eb,
false ) ) {
297 eb = TMath::Max(eb, 0.);
298 LOG(
"LocalFGM",
pINFO) <<
"Nucleus: " << pdgc <<
" -> using Eb = " << eb <<
" GeV";
299 fNucRmvE.insert(map<int,double>::value_type(Z,eb));
string AsString(void) const
static RandomGen * Instance()
Access instance.
int HitNucPdg(void) const
double Density(double r, int A, double ring=0.)
double HitNucMass(void) const
double Prob(double p, double w, const Target &t, double hitNucleonRadius) const
Pure abstract base class. Defines the NuclearModelI interface to be implemented by any physics model ...
A singleton holding random number generator classes. All random number generation in GENIE should tak...
double BindEnergyPerNucleon(const Target &target)
map< int, double > fNucRmvE
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
static constexpr double A
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
virtual void Configure(const Registry &config)
bool GenerateNucleon(const Target &t, double hitNucleonRadius) const
double fCurrRemovalEnergy
virtual void LoadConfig()
TH1D * ProbDistro(const Target &t, double r) const
bool HitNucIsSet(void) const
A registry. Provides the container for algorithm configuration parameters.
TRandom3 & RndGen(void) const
rnd number generator for generic usage
int IonPdgCode(int A, int Z)
virtual double LocalFermiMomentum(const Target &t, int nucleon_pdg, double radius) const
static constexpr double fermi
void Configure(const Registry &config)
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...