19 #include "Framework/Conventions/GBuild.h"
31 using std::ostringstream;
32 using namespace genie;
33 using namespace genie::constants;
34 using namespace genie::utils;
35 using namespace genie::utils::config;
56 TH1D * hst = iter->second;
76 if ( target.
A() > 1 ) {
80 <<
"Null nucleon momentum probability distribution";
84 double p = prob->GetRandom();
86 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
87 LOG(
"EffectiveSF",
pDEBUG) <<
"|p,nucleon| = " << p;
92 double costheta = -1. + 2. * rnd->
RndGen().Rndm();
93 double sintheta = TMath::Sqrt(1.-costheta*costheta);
94 double fi = 2 *
kPi * rnd->
RndGen().Rndm();
95 double cosfi = TMath::Cos(fi);
96 double sinfi = TMath::Sin(fi);
98 double px = p*sintheta*cosfi;
99 double py = p*sintheta*sinfi;
100 double pz = p*costheta;
133 int bin = prob_distr->FindBin(mom);
134 double y = prob_distr->GetBinContent(bin);
135 double dx = prob_distr->GetBinWidth(bin);
136 double prob = y * dx;
152 <<
"Computing P = f(p_nucleon) for: " << target.
AsString();
185 map<int,vector<double> >::const_iterator it =
fProbDistParams.find(pdgc);
187 vector<double> v = it->second;
189 v[4], v[5], v[6], target);
195 if (target.
A() >= range_it->first.first && target.
A() <= range_it->first.second) {
196 vector<double> v = range_it->second;
198 v[4], v[5], v[6], target);
209 double beta,
double c1,
double c2,
210 double c3,
const Target & target)
const
213 int npbins = (int) (1000 *
fPMax);
215 TH1D * prob =
new TH1D(
"",
"", npbins, 0,
fPMax);
216 prob->SetDirectory(0);
218 double dp =
fPMax / (npbins-1);
219 for(
int i = 0; i < npbins; i++) {
221 double y = p / 0.197;
222 double as = c1 * exp(-pow(bs*y,2));
223 double ap = c2 * pow(bp * y, 2) * exp(-pow(bp * y, 2));
224 double at = c3 * pow(y, beta) * exp(-alpha * (y - 2));
225 double rr = (3.14159265 / 4) * (as + ap + at) * pow(y, 2) / 0.197;
226 double dP_dp = rr / 1.01691371;
231 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
232 LOG(
"EffectiveSF",
pDEBUG) <<
"p = " << p <<
", dP/dp = " << dP_dp;
234 prob->Fill(p, dP_dp);
238 prob->Scale( 1.0 / prob->Integral(
"width") );
242 map<string, TH1D*>::value_type(target.
AsString(),prob));
265 f1p1h >= 0 && f1p1h <= 1) {
301 <<
"Transverse enhancement not used; "
302 <<
"Do not increase the 2p2h cross section.";
317 for (
int Z = 1; Z < 140; Z++) {
318 for (
int A = Z;
A < 3*Z;
A++) {
320 double bs, bp, alpha, beta, c1, c2, c3;
328 vector<double> pars = vector<double>();
331 pars.push_back(alpha);
332 pars.push_back(beta);
337 <<
"Nucleus: " << pdgc <<
" -> using bs = " << bs <<
"; bp = "<< bp
338 <<
"; alpha = " << alpha <<
"; beta = "<<beta<<
"; c1 = "<<c1
339 <<
"; c2 = "<<c2<<
"; c3 = " << c3;
344 for(
int lowA = 1; lowA < 3 * 140; lowA++) {
345 for(
int highA = lowA; highA < 3 * 140; highA++) {
346 double bs, bp, alpha, beta, c1, c2, c3;
354 vector<double> pars = vector<double>();
357 pars.push_back(alpha);
358 pars.push_back(beta);
362 LOG(
"EffectiveSF",
pINFO) <<
"For "<< lowA - 1 <<
" < A < " << highA + 1
363 <<
" -> using bs = " << bs <<
"; bp = "<< bp
364 <<
"; alpha = " << alpha <<
"; beta = "<<beta<<
"; c1 = "<<c1
365 <<
"; c2 = "<<c2<<
"; c3 = " << c3;
Registry * GetOwnedConfig(void)
void Configure(const Registry &config)
string AsString(void) const
static RandomGen * Instance()
Access instance.
int HitNucPdg(void) const
map< string, TH1D * > fProbDistroMap
double Prob(double mom, double w, const Target &t) const
Pure abstract base class. Defines the NuclearModelI interface to be implemented by any physics model ...
map< int, std::vector< double > > fProbDistParams
A singleton holding random number generator classes. All random number generation in GENIE should tak...
TH1D * MakeEffectiveSF(const Target &target) const
map< pair< int, int >, std::vector< double > > fRangeProbDistParams
map< int, double > fTransEnh1p1hMods
void LoadAllIsotopesForKey(const char *key_name, const char *log_tool_name, Registry *config, map< int, double > *nuc_to_val)
map< int, double > f1p1hMap
static constexpr double as
map< pair< int, int >, double > fRangeNucRmvE
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
FermiMoverInteractionType_t fFermiMoverInteractionType
map< pair< int, int >, double > fRange1p1hMap
double GetTransEnh1p1hMod(const Target &target) const
static constexpr double A
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
virtual void Configure(const Registry &config)
double ReturnBindingEnergy(const Target &target) const
double Returnf1p1h(const Target &target) const
double fCurrRemovalEnergy
TH1D * ProbDistro(const Target &t) const
virtual void LoadConfig()
bool GetValueFromNuclearMaps(const Target &target, const map< int, double > &nuc_to_val, const map< pair< int, int >, double > &nucA_range_to_val, double *val)
bool HitNucIsSet(void) const
A registry. Provides the container for algorithm configuration parameters.
bool GetDoubleKeyRangeNucA(const char *valName, const int lowA, const int highA, Registry *config, double *val)
TRandom3 & RndGen(void) const
rnd number generator for generic usage
int IonPdgCode(int A, int Z)
bool GetDoubleKeyPDG(const char *valName, const int pdgc, Registry *config, double *val)
bool fEjectSecondNucleon2p2h
map< int, double > fNucRmvE
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
bool GenerateNucleon(const Target &t) const
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
void LoadAllNucARangesForKey(const char *key_name, const char *log_tool_name, Registry *config, map< pair< int, int >, double > *nuc_rangeA_to_val)
map< pair< int, int >, double > fRangeTransEnh1p1hMods