29 using std::ostringstream;
30 using namespace genie;
53 double hitNucleonRadius)
const 62 TH1D * prob = this->
ProbDistro(target,hitNucleonRadius);
65 <<
"Null nucleon momentum probability distribution";
68 double p = prob->GetRandom();
70 LOG(
"LocalFGM",
pINFO) <<
"|p,nucleon| = " <<
p;
74 double costheta = -1. + 2. * rnd->
RndGen().Rndm();
75 double sintheta =
TMath::Sqrt(1.-costheta*costheta);
76 double fi = 2 *
kPi * rnd->
RndGen().Rndm();
77 double cosfi = TMath::Cos(fi);
78 double sinfi = TMath::Sin(fi);
80 double px = p*sintheta*cosfi;
81 double py = p*sintheta*sinfi;
82 double pz = p*costheta;
89 map<int,double>::const_iterator
it =
fNucRmvE.find(Z);
90 if(it !=
fNucRmvE.end()) fCurrRemovalEnergy = it->second;
97 double hitNucleonRadius)
const 100 TH1D * prob = this->
ProbDistro(target, hitNucleonRadius);
101 int bin = prob->FindBin(p);
102 double y = prob->GetBinContent(bin);
103 double dx = prob->GetBinWidth(bin);
115 <<
"Computing P = f(p_nucleon) for: " << target.
AsString()
116 <<
", Nucleon Radius = " <<
r;
118 <<
", P(max) = " <<
fPMax;
127 double numNuc = (is_p) ? (
double)target.
Z():(double)target.
N();
137 double C = 4. *
kPi * TMath::Power(KF,3) / 3.;
141 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 150 TH1D * prob =
new TH1D(
"",
"", npbins, 0,
fPMax);
151 prob->SetDirectory(0);
153 double dp =
fPMax / (npbins-1);
154 double iC = (C>0) ? 1./C : 0.;
155 double kfa_pi_2 = TMath::Power(KF*a/
kPi,2);
157 for(
int i = 0;
i < npbins;
i++) {
159 double p2 = TMath::Power(p,2);
164 phi2 = iC * (1. - 6.*kfa_pi_2);
171 double dP_dp = 4*
kPi * p2 * phi2;
172 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 173 LOG(
"LocalFGM",
pDEBUG) <<
"p = " << p <<
", dP/dp = " << dP_dp;
175 prob->Fill(p, dP_dp);
179 prob->Scale( 1.0 / prob->Integral(
"width") );
206 for(
int Z=1;
Z<140;
Z++) {
207 for(
int A=
Z;
A<3*
Z;
A++) {
210 key <<
"RFG-NucRemovalE@Pdg=" << pdgc;
211 RgKey rgkey = key.str();
213 if (
GetParam( rgkey, eb,
false ) ) {
214 eb = TMath::Max(eb, 0.);
215 LOG(
"LocalFGM",
pINFO) <<
"Nucleus: " << pdgc <<
" -> using Eb = " << eb <<
" GeV";
216 fNucRmvE.insert(map<int,double>::value_type(Z,eb));
string AsString(void) const
THE MAIN GENIE PROJECT NAMESPACE
static RandomGen * Instance()
Access instance.
int HitNucPdg(void) const
double Density(double r, int A, double ring=0.)
static const double fermi
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...
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
static const double kLightSpeed
double fCurrRemovalEnergy
TH1D * ProbDistro(const Target &t, double r) const
bool HitNucIsSet(void) const
Var Sqrt(const Var &v)
Use to take sqrt of a var.
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)
assert(nhit_max >=nhit_nbins)
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
static const double kPlankConstant
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
Root of GENIE utility namespaces.