19#include "Framework/Conventions/GBuild.h"
31using std::ostringstream;
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;
#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.
Registry * GetOwnedConfig(void)
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
double Prob(double mom, double w, const Target &t) const
map< pair< int, int >, std::vector< double > > fRangeProbDistParams
map< int, double > fNucRmvE
map< pair< int, int >, double > fRangeTransEnh1p1hMods
double Returnf1p1h(const Target &target) const
void Configure(const Registry &config)
double GetTransEnh1p1hMod(const Target &target) const
TH1D * MakeEffectiveSF(const Target &target) const
map< string, TH1D * > fProbDistroMap
map< pair< int, int >, double > fRangeNucRmvE
bool fEjectSecondNucleon2p2h
double ReturnBindingEnergy(const Target &target) const
map< pair< int, int >, double > fRange1p1hMap
map< int, double > f1p1hMap
map< int, double > fTransEnh1p1hMods
TH1D * ProbDistro(const Target &t) const
map< int, std::vector< double > > fProbDistParams
bool GenerateNucleon(const Target &t) const
virtual void LoadConfig()
FermiMoverInteractionType_t fFermiMoverInteractionType
double fCurrRemovalEnergy
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.
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
int IonPdgCode(int A, int Z)
Simple functions for loading and reading nucleus dependent keys from config files.
void LoadAllIsotopesForKey(const char *key_name, const char *log_tool_name, Registry *config, map< int, double > *nuc_to_val)
bool GetValueFromNuclearMaps(const Target &target, const map< int, double > &nuc_to_val, const map< pair< int, int >, double > &nucA_range_to_val, double *val)
void LoadAllNucARangesForKey(const char *key_name, const char *log_tool_name, Registry *config, map< pair< int, int >, double > *nuc_rangeA_to_val)
bool GetDoubleKeyPDG(const char *valName, const int pdgc, Registry *config, double *val)
bool GetDoubleKeyRangeNucA(const char *valName, const int lowA, const int highA, Registry *config, double *val)
Root of GENIE utility namespaces.
THE MAIN GENIE PROJECT NAMESPACE
@ kFermiMoveEffectiveSF2p2h_noeject
@ kFermiMoveEffectiveSF2p2h_eject
@ kFermiMoveEffectiveSF1p1h