26#include "Framework/Conventions/GBuild.h"
37using std::ostringstream;
59 TH1D * hst = iter->second;
80 <<
"Null nucleon momentum probability distribution";
83 double p = prob->GetRandom();
84 LOG(
"BodekRitchie",
pINFO) <<
"|p,nucleon| = " << p;
88 double costheta = -1. + 2. * rnd->
RndGen().Rndm();
89 double sintheta = TMath::Sqrt(1.-costheta*costheta);
90 double fi = 2 *
kPi * rnd->
RndGen().Rndm();
91 double cosfi = TMath::Cos(fi);
92 double sinfi = TMath::Sin(fi);
94 double px = p*sintheta*cosfi;
95 double py = p*sintheta*sinfi;
96 double pz = p*costheta;
105 map<int,double>::const_iterator it =
fNucRmvE.find(Z);
120 int bin = prob_distr->FindBin(mom);
121 double y = prob_distr->GetBinContent(bin);
122 double dx = prob_distr->GetBinWidth(bin);
136 <<
"Computing P = f(p_nucleon) for: " << target.
AsString();
148 double C = 4. *
kPi * TMath::Power(KF,3) / 3.;
149 double R = 1. / (1.- KF/
fPMax);
150#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
152 LOG(
"BodekRitchie",
pDEBUG) <<
"C = " << C;
153 LOG(
"BodekRitchie",
pDEBUG) <<
"R = " << R;
158 int npbins = (int) (1000*
fPMax);
159 TH1D * prob =
new TH1D(
"",
"", npbins, 0,
fPMax);
160 prob->SetDirectory(0);
162 double dp =
fPMax / (npbins-1);
163 double iC = (C>0) ? 1./C : 0.;
164 double kfa_pi_2 = TMath::Power(KF*
a/
kPi,2);
166 for(
int i = 0; i < npbins; i++) {
168 double p2 = TMath::Power(p,2);
173 phi2 = iC * (1. - 6.*kfa_pi_2);
175 phi2 = iC * (2*R*kfa_pi_2*TMath::Power(KF/p,4.));
178 double dP_dp = 4*
kPi * p2 * phi2;
179#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
180 LOG(
"BodekRitchie",
pDEBUG) <<
"p = " << p <<
", dP/dp = " << dP_dp;
182 prob->Fill(p, dP_dp);
186 prob->Scale( 1.0 / prob->Integral(
"width") );
190 map<string, TH1D*>::value_type(target.
AsString(),prob));
211 double A = (double) t.
A() ;
213 double Z = (double) t.
Z() ;
214 kF *= TMath::Power( 2*Z/A, 1./3.);
217 double N = (double) t.
N() ;
218 kF *= TMath::Power( 2*N/A, 1./3.);
221 LOG(
"BodekRitchie",
pINFO) <<
"Corrected KF = " << kF;
256 const std::string keyStart =
"RFG-NucRemovalE@Pdg=";
260 for(RgIMap::const_iterator it = entries.begin(); it != entries.end(); ++it){
261 const std::string& key = it->first;
264 if (0 == key.compare(0, keyStart.size(), keyStart.c_str())) {
265 pdg = atoi(key.c_str() + keyStart.size());
268 if (0 !=
pdg && 0 != Z) {
269 ostringstream key_ss ;
270 key_ss << keyStart <<
pdg;
271 RgKey rgkey = key_ss.str();
274 eb = TMath::Max(eb, 0.);
276 <<
"Nucleus: " <<
pdg <<
" -> using Eb = " << eb <<
" GeV";
277 fNucRmvE.insert(map<int,double>::value_type(Z,eb));
282 <<
"Finished LoadConfig";
283#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
284 for (map<int,double>::iterator it =
fNucRmvE.begin(); it !=
fNucRmvE.end(); ++it) {
286 <<
"Z = " << (*it).first <<
"; eb = " << (*it).second;
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils.
virtual const Registry & GetConfig(void) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
virtual void Configure(const Registry &config)
bool GetParamDef(const RgKey &name, T &p, const T &def) const
void Configure(const Registry &config)
double Prob(double mom, double w, const Target &t) const
map< int, double > fNucRmvE
TH1D * ProbDistro(const Target &t) const
map< string, TH1D * > fProbDistroMap
virtual double FermiMomentum(const Target &t, int nucleon_pdg) const
virtual ~FGMBodekRitchie()
bool GenerateNucleon(const Target &t) const
virtual void LoadConfig()
double fCurrRemovalEnergy
virtual double FermiMomentum(const Target &, int nucleon_pdg) const
A singleton holding random number generator classes. All random number generation in GENIE should tak...
static RandomGen * Instance()
Access instance.
TRandom3 & RndGen(void) const
rnd number generator for generic usage
A registry. Provides the container for algorithm configuration parameters.
const RgIMap & GetItemMap(void) const
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
string AsString(void) const
int HitNucPdg(void) const
bool HitNucIsSet(void) const
Utilities for improving the code readability when using PDG codes.
int IonPdgCodeToZ(int pdgc)
Simple functions for loading and reading nucleus dependent keys from config files.
double FermiMomentumForIsoscalarNucleonParametrization(const Target &target)
double BindEnergyPerNucleon(const Target &target)
double BindEnergyPerNucleonParametrization(const Target &target)
Root of GENIE utility namespaces.
THE MAIN GENIE PROJECT NAMESPACE
map< RgKey, RegistryItemI * > RgIMap