GENIEGenerator
Loading...
Searching...
No Matches
genie::LocalFGM Class Reference

local Fermi gas model. Implements the NuclearModelI interface. More...

#include <LocalFGM.h>

Inheritance diagram for genie::LocalFGM:
[legend]
Collaboration diagram for genie::LocalFGM:
[legend]

Public Member Functions

 LocalFGM ()
 LocalFGM (string config)
virtual ~LocalFGM ()
bool GenerateNucleon (const Target &t, double hitNucleonRadius) const
double Prob (double p, double w, const Target &t, double hitNucleonRadius) const
bool GenerateNucleon (const Target &t) const
double Prob (double p, double w, const Target &t) const
NuclearModel_t ModelType (const Target &) const
virtual double LocalFermiMomentum (const Target &t, int nucleon_pdg, double radius) const
void Configure (const Registry &config)
void Configure (string param_set)
Public Member Functions inherited from genie::NuclearModelI
virtual ~NuclearModelI ()
virtual double FermiMomentum (const Target &, int nucleon_pdg) const
double RemovalEnergy (void) const
double Momentum (void) const
const TVector3 & Momentum3 (void) const
FermiMoverInteractionType_t GetFermiMoverInteractionType (void) const
void SetMomentum3 (const TVector3 &mom) const
void SetRemovalEnergy (double E) const
Public Member Functions inherited from genie::Algorithm
virtual ~Algorithm ()
virtual void FindConfig (void)
virtual const RegistryGetConfig (void) const
RegistryGetOwnedConfig (void)
virtual const AlgIdId (void) const
 Get algorithm ID.
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status.
virtual bool AllowReconfig (void) const
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm.
virtual void SetId (const AlgId &id)
 Set algorithm ID.
virtual void SetId (string name, string config)
const AlgorithmSubAlg (const RgKey &registry_key) const
void AdoptConfig (void)
void AdoptSubstructure (void)
virtual void Print (ostream &stream) const
 Print algorithm info.

Protected Member Functions

void LoadConfig (void)
Protected Member Functions inherited from genie::NuclearModelI
 NuclearModelI ()
 NuclearModelI (std::string name)
 NuclearModelI (std::string name, std::string config)
const string & FermiMomentumTableName () const
const genie::FermiMomentumTableFermiMomentumTable () const
Protected Member Functions inherited from genie::Algorithm
 Algorithm ()
 Algorithm (string name)
 Algorithm (string name, string config)
void Initialize (void)
void DeleteConfig (void)
void DeleteSubstructure (void)
RegistryExtractLocalConfig (const Registry &in) const
RegistryExtractLowerConfig (const Registry &in, const string &alg_key) const
 Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key.
template<class T>
bool GetParam (const RgKey &name, T &p, bool is_top_call=true) const
template<class T>
bool GetParamDef (const RgKey &name, T &p, const T &def) const
template<class T>
int GetParamVect (const std::string &comm_name, std::vector< T > &v, bool is_top_call=true) const
 Handle to load vectors of parameters.
int GetParamVectKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
template<class T>
int GetParamMat (const std::string &comm_name, TMatrixT< T > &mat, bool is_top_call=true) const
 Handle to load matrix of parameters.
template<class T>
int GetParamMatSym (const std::string &comm_name, TMatrixTSym< T > &mat, bool is_top_call=true) const
int GetParamMatKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
int AddTopRegistry (Registry *rp, bool owns=true)
 add registry with top priority, also update ownership
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership
int MergeTopRegistry (const Registry &r)
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships.

Private Member Functions

TH1D * ProbDistro (const Target &t, double r) const
double MaxwellBoltzmannRemovalE (const Target &t, double Ermv_min, double Ermv_max) const

Private Attributes

map< int, double > fNucRmvE
double fPMax
bool fMomDepErmv
bool fForcePositiveErmv
bool fUseMBDist
double fSRC_Fraction
double fPCutOff
double fSRC_Ermv_C
double fSRC_Ermv_sigma

Additional Inherited Members

Static Public Member Functions inherited from genie::Algorithm
static string BuildParamVectKey (const std::string &comm_name, unsigned int i)
static string BuildParamVectSizeKey (const std::string &comm_name)
static string BuildParamMatKey (const std::string &comm_name, unsigned int i, unsigned int j)
static string BuildParamMatRowSizeKey (const std::string &comm_name)
static string BuildParamMatColSizeKey (const std::string &comm_name)
Protected Attributes inherited from genie::NuclearModelI
double fCurrRemovalEnergy
TVector3 fCurrMomentum
FermiMoverInteractionType_t fFermiMoverInteractionType
Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...)
AlgId fID
 algorithm name and configuration set
vector< Registry * > fConfVect
vector< bool > fOwnerships
 ownership for every registry in fConfVect
AlgStatus_t fStatus
 algorithm execution status
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool)

Detailed Description

local Fermi gas model. Implements the NuclearModelI interface.

References:\n
Author
Joe Johnston, Steven Dytman
Created:\n December 2015
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Definition at line 34 of file LocalFGM.h.

Constructor & Destructor Documentation

◆ LocalFGM() [1/2]

LocalFGM::LocalFGM ( )

Definition at line 36 of file LocalFGM.cxx.

36 :
37NuclearModelI("genie::LocalFGM")
38{
39
40}

References genie::NuclearModelI::NuclearModelI().

◆ LocalFGM() [2/2]

LocalFGM::LocalFGM ( string config)

Definition at line 42 of file LocalFGM.cxx.

42 :
43NuclearModelI("genie::LocalFGM", config)
44{
45
46}

References genie::NuclearModelI::NuclearModelI().

◆ ~LocalFGM()

LocalFGM::~LocalFGM ( )
virtual

Definition at line 48 of file LocalFGM.cxx.

49{
50
51}

Member Function Documentation

◆ Configure() [1/2]

void LocalFGM::Configure ( const Registry & config)
virtual

Configure the algorithm with an external registry The registry is merged with the top level registry if it is owned, Otherwise a copy of it is added with the highest priority

Reimplemented from genie::Algorithm.

Definition at line 312 of file LocalFGM.cxx.

313{
314 Algorithm::Configure(config);
315 this->LoadConfig();
316}
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62
void LoadConfig(void)
Definition LocalFGM.cxx:324

References genie::Algorithm::Configure(), and LoadConfig().

◆ Configure() [2/2]

void LocalFGM::Configure ( string config)
virtual

Configure the algorithm from the AlgoConfigPool based on param_set string given in input An algorithm contains a vector of registries coming from different xml configuration files, which are loaded according a very precise prioriy This methods will load a number registries in order of priority: 1) "Tunable" parameter set from CommonParametes. This is loaded with the highest prioriry and it is designed to be used for tuning procedure Usage not expected from the user. 2) For every string defined in "CommonParame" the corresponding parameter set will be loaded from CommonParameter.xml 3) parameter set specified by the config string and defined in the xml file of the algorithm 4) if config is not "Default" also the Default parameter set from the same xml file will be loaded Effectively this avoids the repetion of a parameter when it is not changed in the requested configuration

Reimplemented from genie::Algorithm.

Definition at line 318 of file LocalFGM.cxx.

319{
320 Algorithm::Configure(param_set);
321 this->LoadConfig();
322}

References genie::Algorithm::Configure(), and LoadConfig().

◆ GenerateNucleon() [1/2]

bool genie::LocalFGM::GenerateNucleon ( const Target & t) const
inlinevirtual

Implements genie::NuclearModelI.

Definition at line 50 of file LocalFGM.h.

50 {
51 return GenerateNucleon(t,0.0);
52 }
bool GenerateNucleon(const Target &t, double hitNucleonRadius) const
Definition LocalFGM.cxx:53

References GenerateNucleon().

◆ GenerateNucleon() [2/2]

bool LocalFGM::GenerateNucleon ( const Target & t,
double hitNucleonRadius ) const
virtual

Reimplemented from genie::NuclearModelI.

Definition at line 53 of file LocalFGM.cxx.

55{
56 assert(target.HitNucIsSet());
57
58 fCurrRemovalEnergy = -99999.0;
59 fCurrMomentum.SetXYZ(0,0,0);
60
61 //-- set fermi momentum vector
62 //
63 TH1D * prob = this->ProbDistro(target,hitNucleonRadius);
64 if(!prob) {
65 LOG("LocalFGM", pNOTICE)
66 << "Null nucleon momentum probability distribution";
67 exit(1);
68 }
69
70 RandomGen * rnd = RandomGen::Instance();
71
72 double costheta = -1. + 2. * rnd->RndGen().Rndm();
73 double sintheta = TMath::Sqrt(1.-costheta*costheta);
74 double fi = 2 * kPi * rnd->RndGen().Rndm();
75 double cosfi = TMath::Cos(fi);
76 double sinfi = TMath::Sin(fi);
77
78 double px;
79 double py;
80 double pz;
81
82 int Z = target.Z();
83 map<int,double>::const_iterator it = fNucRmvE.find(Z);
84
85 double p;
86
87 bool doThrow = true;
88 while(doThrow){
89 p = prob->GetRandom();
90
91 LOG("LocalFGM", pINFO) << "|p,nucleon| = " << p;
92
93 px = p*sintheta*cosfi;
94 py = p*sintheta*sinfi;
95 pz = p*costheta;
96
97 fCurrMomentum.SetXYZ(px,py,pz);
98
99 if (fMomDepErmv) {
100 // hit nucleon mass
101 double nucl_mass = target.HitNucMass();
102 // get the local Fermi momentum
103 double KF = LocalFermiMomentum( target, target.HitNucPdg(), hitNucleonRadius);
104
105 //initial nucleon kinetic energy at the Fermi surface
106 double T_F = TMath::Sqrt(TMath::Power(nucl_mass,2)+TMath::Power(KF,2)) - nucl_mass;
107
108 //the minimum removal energy to keep nucleons bound is equal to
109 //the nucleon kinetic energy at the Fermi surface
110 double localEb = T_F;
111
112 //initial state nucleon kinetic energy (already present and contributing to its escape from the nucleus)
113 double T_nucl = TMath::Sqrt(TMath::Power(fCurrMomentum.Mag(),2)+TMath::Power(nucl_mass,2))- nucl_mass;
114
115 //set the Qvalue (separation energy) to the RFG removal energy in the CommonParams file
116 double q_val_offset;
117 if(it != fNucRmvE.end()) q_val_offset = it->second;
118 else q_val_offset = nuclear::BindEnergyPerNucleon(target);
119
120 //set the removal energy to be the sum of the removal energy at the Fermi surface
121 //and the Q value offset, minus the nucleon kinetic energy
122 fCurrRemovalEnergy = localEb + q_val_offset - T_nucl;
123
124
125 }
126 else {
127 //else, use already existing treatment, i.e. set removal energy to RFG value from table or use
128 //Wapstra's semi-empirical formula.
129 if(it != fNucRmvE.end()) fCurrRemovalEnergy = it->second;
131 }
132
133 // we keep the event unless otherwise specified
134 doThrow = false;
135
136 if (fCurrRemovalEnergy < 0)
137 {
139 {
140 LOG("LocalFGM", pDEBUG)
141 << " ^-- sampled nucleon resulted in negative LFG removal"
142 << " energy and was rejected. Resampling ...";
143 doThrow = true;
144 }
145 else if ( fUseMBDist )
146 {
147 // Spectral function fits to electron scattering nuclear data typically
148 // use Maxwell-Boltzmann removal energies. The approach here was
149 // inspired by conversations with Artur Ankowski. However, if the
150 // binding energy is too large, the off-shell nucleon's mass can wind
151 // up negative, which is completely unphysical and causes NaNs when
152 // trying to boost into its reference frame (in, e.g.,
153 // QELEventGenerator). We thus have to truncate the MB distribution
154 // below where SF models typically max out in Emiss. This max binding
155 // energy comes from insisting that the mass (which is computed from
156 // the on-shell masses of the struck nucleus and nucleon, and the Fermi
157 // momentum) be positive.
158 const double maxBindE = std::sqrt( target.Mass()*target.Mass()
159 - 2*target.Mass()*p ) - ( target.Mass() - target.HitNucMass() );
160 LOG("LocalFGM", pDEBUG) << " using max removalE = " << maxBindE;
161 fCurrRemovalEnergy = MaxwellBoltzmannRemovalE( target, 0, maxBindE );
162
163 LOG("LocalFGM", pDEBUG) << " ^-- note: sampled nucleon resulted"
164 << " in negative LFG removal energy, so its removal energy was"
165 << " resampled from an SRC-like Maxwell-Boltzmann distribution:"
166 << " Ermv = " << fCurrRemovalEnergy;
167 }
168 }
169 } // while (doThrow)
170
171 delete prob;
172
173 return true;
174}
#define pNOTICE
Definition Messenger.h:61
#define pINFO
Definition Messenger.h:62
#define pDEBUG
Definition Messenger.h:63
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
bool fForcePositiveErmv
Definition LocalFGM.h:84
virtual double LocalFermiMomentum(const Target &t, int nucleon_pdg, double radius) const
Definition LocalFGM.cxx:296
map< int, double > fNucRmvE
Definition LocalFGM.h:80
double MaxwellBoltzmannRemovalE(const Target &t, double Ermv_min, double Ermv_max) const
Definition LocalFGM.cxx:267
TH1D * ProbDistro(const Target &t, double r) const
Definition LocalFGM.cxx:192
static RandomGen * Instance()
Access instance.
Definition RandomGen.cxx:74
TRandom3 & RndGen(void) const
rnd number generator for generic usage
Definition RandomGen.h:80
double BindEnergyPerNucleon(const Target &target)

References genie::utils::nuclear::BindEnergyPerNucleon(), genie::NuclearModelI::fCurrMomentum, genie::NuclearModelI::fCurrRemovalEnergy, fForcePositiveErmv, fMomDepErmv, fNucRmvE, fUseMBDist, genie::Target::HitNucIsSet(), genie::Target::HitNucMass(), genie::Target::HitNucPdg(), genie::RandomGen::Instance(), genie::constants::kPi, LocalFermiMomentum(), LOG, genie::Target::Mass(), MaxwellBoltzmannRemovalE(), pDEBUG, pINFO, pNOTICE, ProbDistro(), genie::RandomGen::RndGen(), and genie::Target::Z().

Referenced by GenerateNucleon().

◆ LoadConfig()

void LocalFGM::LoadConfig ( void )
protectedvirtual

Reimplemented from genie::NuclearModelI.

Definition at line 324 of file LocalFGM.cxx.

325{
326
328
329 this->GetParamDef("LFG-MomentumMax", fPMax, 1.0);
330 assert(fPMax > 0);
331
332 this->GetParamDef("SRC-Fraction", fSRC_Fraction, 0.0);
333
334 // Default value from work by A. Ankowski (private communication to J.
335 // Wolcott, Nov. 27 2024)
336 this->GetParamDef("SRC-Ermv-C", fSRC_Ermv_C, 0.120);
337
338 // Default value from work by A. Ankowski (private communication to J.
339 // Wolcott, Nov. 27 2024)
340 this->GetParamDef("SRC-Ermv-sigma", fSRC_Ermv_sigma, 0.100);
341
342 this->GetParam("LFG-MomentumCutOff", fPCutOff);
343 this->GetParam("LFG-MomentumDependentErmv", fMomDepErmv);
344 this->GetParam("LFG-ForcePositiveErmv", fForcePositiveErmv);
345 this->GetParamDef( "LFG-UseMBDistForNegativeErmv", fUseMBDist, false );
346
347 if (fPCutOff > fPMax) {
348 LOG("LocalFGM", pFATAL) << "Momentum CutOff greater than Momentum Max";
349 exit(78);
350 }
351
352 if (fSRC_Fraction > 0 && fSRC_Ermv_sigma <= 0)
353 {
354 LOG("LocalFGM", pFATAL) << "Configured SRC Maxwell-Boltzmann sigma (" << fSRC_Ermv_sigma << ") invalid: must be nonnegative";
355 exit(78);
356 }
357
358 // Load removal energy for specific nuclei from either the algorithm's
359 // configuration file or the UserPhysicsOptions file.
360 // If none is used use Wapstra's semi-empirical formula.
361 //
362
363 for(int Z=1; Z<140; Z++) {
364 for(int A=Z; A<3*Z; A++) {
365 ostringstream key ;
366 int pdgc = pdg::IonPdgCode(A,Z);
367 key << "RFG-NucRemovalE@Pdg=" << pdgc;
368 RgKey rgkey = key.str();
369 double eb ;
370 if ( GetParam( rgkey, eb, false ) ) {
371 eb = TMath::Max(eb, 0.);
372 LOG("LocalFGM", pINFO) << "Nucleus: " << pdgc << " -> using Eb = " << eb << " GeV";
373 fNucRmvE.insert(map<int,double>::value_type(Z,eb));
374 }
375 }
376 }
377}
#define pFATAL
Definition Messenger.h:56
string RgKey
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
bool GetParamDef(const RgKey &name, T &p, const T &def) const
double fSRC_Ermv_sigma
Definition LocalFGM.h:97
double fPCutOff
Definition LocalFGM.h:89
double fSRC_Fraction
Definition LocalFGM.h:88
double fSRC_Ermv_C
Definition LocalFGM.h:93
virtual void LoadConfig()
int IonPdgCode(int A, int Z)
Definition PDGUtils.cxx:71

References fForcePositiveErmv, fMomDepErmv, fNucRmvE, fPCutOff, fPMax, fSRC_Ermv_C, fSRC_Ermv_sigma, fSRC_Fraction, fUseMBDist, genie::Algorithm::GetParam(), genie::Algorithm::GetParamDef(), genie::pdg::IonPdgCode(), genie::NuclearModelI::LoadConfig(), LOG, pFATAL, and pINFO.

Referenced by Configure(), and Configure().

◆ LocalFermiMomentum()

double LocalFGM::LocalFermiMomentum ( const Target & t,
int nucleon_pdg,
double radius ) const
virtual

Reimplemented from genie::NuclearModelI.

Definition at line 296 of file LocalFGM.cxx.

296 {
297
298 assert(pdg::IsProton(nucleon_pdg) || pdg::IsNeutron(nucleon_pdg)) ;
299
300 bool is_p = pdg::IsProton(nucleon_pdg);
301 double numNuc = (double) ( (is_p) ? t.Z() : t.N() );
302
303 // double hbarc = kLightSpeed*kPlankConstant/genie::units::fermi;
304
305 double kF = TMath::Power( 3*kPi2*numNuc*genie::utils::nuclear::Density( radius, t.A() ),
306 1.0/3.0 )
308
309 return kF ;
310}
int N(void) const
Definition Target.h:69
int Z(void) const
Definition Target.h:68
int A(void) const
Definition Target.h:70
bool IsProton(int pdgc)
Definition PDGUtils.cxx:336
bool IsNeutron(int pdgc)
Definition PDGUtils.cxx:341
static constexpr double fermi
Definition Units.h:55
double Density(double r, int A, double ring=0.)

References genie::Target::A(), genie::utils::nuclear::Density(), genie::units::fermi, genie::pdg::IsNeutron(), genie::pdg::IsProton(), genie::constants::kPi2, genie::Target::N(), and genie::Target::Z().

Referenced by GenerateNucleon(), and ProbDistro().

◆ MaxwellBoltzmannRemovalE()

double LocalFGM::MaxwellBoltzmannRemovalE ( const Target & t,
double Ermv_min,
double Ermv_max ) const
private

Throw a value from the Maxwell-Boltzmann distribution with the configured parameters

Definition at line 267 of file LocalFGM.cxx.

268{
269 // the target is currently unused,
270 // but the fSRC_Ermv_C and fSRC_Ermv_sigma could (should?)
271 // in principle be a function of nucleus
272
273 const double normFactor = 4 / sqrt(M_PI) / fSRC_Ermv_sigma;
274
275 RandomGen * rnd = RandomGen::Instance();
276
277 // rejection sample --- draw until success
278 double x;
279 while (true)
280 {
281 x = rnd->RndGen().Uniform( Ermv_min, Ermv_max );
282
283 const double arg = (x - fSRC_Ermv_C + fSRC_Ermv_sigma) / fSRC_Ermv_sigma;
284 const double arg2 = arg * arg;
285
286 const double MB = normFactor * arg2 * exp(-arg2);
287
288 if (MB >= rnd->RndGen().Uniform())
289 break;
290 }
291
292 return x;
293}

References fSRC_Ermv_C, fSRC_Ermv_sigma, genie::RandomGen::Instance(), and genie::RandomGen::RndGen().

Referenced by GenerateNucleon().

◆ ModelType()

NuclearModel_t genie::LocalFGM::ModelType ( const Target & ) const
inlinevirtual

Implements genie::NuclearModelI.

Definition at line 56 of file LocalFGM.h.

57 {
58 return kNucmLocalFermiGas;
59 }
@ kNucmLocalFermiGas

References genie::kNucmLocalFermiGas.

◆ Prob() [1/2]

double genie::LocalFGM::Prob ( double p,
double w,
const Target & t ) const
inlinevirtual

Implements genie::NuclearModelI.

Definition at line 53 of file LocalFGM.h.

53 {
54 return Prob(p,w,t,0.0);
55 }
double Prob(double p, double w, const Target &t, double hitNucleonRadius) const
Definition LocalFGM.cxx:176

References Prob().

◆ Prob() [2/2]

double LocalFGM::Prob ( double p,
double w,
const Target & t,
double hitNucleonRadius ) const
virtual

Reimplemented from genie::NuclearModelI.

Definition at line 176 of file LocalFGM.cxx.

178{
179 if(w<0) {
180 TH1D * prob = this->ProbDistro(target, hitNucleonRadius);
181 int bin = prob->FindBin(p);
182 double y = prob->GetBinContent(bin);
183 double dx = prob->GetBinWidth(bin);
184 double pr = y*dx;
185 delete prob;
186 return pr;
187 }
188 return 1;
189}

References ProbDistro().

Referenced by Prob().

◆ ProbDistro()

TH1D * LocalFGM::ProbDistro ( const Target & t,
double r ) const
private

Definition at line 192 of file LocalFGM.cxx.

193{
194 LOG("LocalFGM", pNOTICE)
195 << "Computing P = f(p_nucleon) for: " << target.AsString()
196 << ", Nucleon Radius = " << r;
197 LOG("LocalFGM", pNOTICE)
198 << ", P(max) = " << fPMax;
199
200 assert(target.HitNucIsSet());
201
202 //-- get information for the nuclear target
203 int nucleon_pdgc = target.HitNucPdg();
204 assert(pdg::IsProton(nucleon_pdgc) || pdg::IsNeutron(nucleon_pdgc));
205
206 // bool is_p = pdg::IsProton(nucleon_pdgc);
207 // double numNuc = (is_p) ? (double)target.Z():(double)target.N();
208
209 // Calculate Fermi Momentum using Local FG equations
210 double KF = LocalFermiMomentum( target, nucleon_pdgc, r ) ;
211
212 LOG("LocalFGM",pNOTICE) << "KF = " << KF;
213
214 //double a = 2.0;
215 //double C = 4. * kPi * TMath::Power(KF,3) / 3.;
216
217 // Do not include nucleon correlation tail
218 //double R = 1. / (1.- KF/4.);
219//#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
220 //LOG("LocalFGM", pDEBUG) << "a = " << a;
221 //LOG("LocalFGM", pDEBUG) << "C = " << C;
222 //LOG("LocalFGM", pDEBUG) << "R = " << R;
223//#endif
224
225 //-- create the probability distribution
226
227 int npbins = (int) (1000*fPMax);
228 TH1D * prob = new TH1D("", "", npbins, 0, fPMax);
229 prob->SetDirectory(0);
230
231 double dp = fPMax / (npbins-1);
232// double iC = (C>0) ? 1./C : 0.; // unused variables
233// double kfa_pi_2 = TMath::Power(KF*a/kPi,2); // unused variables
234
235 for(int i = 0; i < npbins; i++) {
236 double p = i * dp;
237 double p2 = TMath::Power(p,2);
238
239 // use expression with fSRC_Fraction to allow the possibility of
240 // using the Correlated Fermi Gas Model with a high momentum tail
241
242 // calculate |phi(p)|^2
243 double phi2 = 0;
244 if (p <= KF){
245 phi2 = (1./(4*kPi)) * (3/TMath::Power(KF,3.)) * ( 1 - fSRC_Fraction );
246 }else if( p > KF && p < fPCutOff ){
247 phi2 = (1./(4*kPi)) * ( fSRC_Fraction / (1./KF - 1./fPCutOff) ) / TMath::Power(p,4.);
248 }
249
250 // calculate probability density : dProbability/dp
251 double dP_dp = 4*kPi * p2 * phi2;
252#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
253 LOG("LocalFGM", pDEBUG) << "p = " << p << ", dP/dp = " << dP_dp;
254#endif
255 prob->Fill(p, dP_dp);
256 }
257
258 double normfactor = prob->Integral("width");
259
260 //-- normalize the probability distribution
261 if (normfactor > 0) prob->Scale(1/normfactor);
262
263 return prob;
264}

References genie::Target::AsString(), fPCutOff, fPMax, fSRC_Fraction, genie::Target::HitNucIsSet(), genie::Target::HitNucPdg(), genie::pdg::IsNeutron(), genie::pdg::IsProton(), genie::constants::kPi, LocalFermiMomentum(), LOG, pDEBUG, and pNOTICE.

Referenced by GenerateNucleon(), and Prob().

Member Data Documentation

◆ fForcePositiveErmv

bool genie::LocalFGM::fForcePositiveErmv
private

Definition at line 84 of file LocalFGM.h.

Referenced by GenerateNucleon(), and LoadConfig().

◆ fMomDepErmv

bool genie::LocalFGM::fMomDepErmv
private

Definition at line 83 of file LocalFGM.h.

Referenced by GenerateNucleon(), and LoadConfig().

◆ fNucRmvE

map<int, double> genie::LocalFGM::fNucRmvE
private

Definition at line 80 of file LocalFGM.h.

Referenced by GenerateNucleon(), and LoadConfig().

◆ fPCutOff

double genie::LocalFGM::fPCutOff
private

Definition at line 89 of file LocalFGM.h.

Referenced by LoadConfig(), and ProbDistro().

◆ fPMax

double genie::LocalFGM::fPMax
private

Definition at line 82 of file LocalFGM.h.

Referenced by LoadConfig(), and ProbDistro().

◆ fSRC_Ermv_C

double genie::LocalFGM::fSRC_Ermv_C
private

Center of Maxwell-Boltmann distribution used for SRC removal energy distribution, GeV

Definition at line 93 of file LocalFGM.h.

Referenced by LoadConfig(), and MaxwellBoltzmannRemovalE().

◆ fSRC_Ermv_sigma

double genie::LocalFGM::fSRC_Ermv_sigma
private

Sigma of Maxwell-Boltmann distribution used for SRC removal energy distribution, GeV

Definition at line 97 of file LocalFGM.h.

Referenced by LoadConfig(), and MaxwellBoltzmannRemovalE().

◆ fSRC_Fraction

double genie::LocalFGM::fSRC_Fraction
private

Definition at line 88 of file LocalFGM.h.

Referenced by LoadConfig(), and ProbDistro().

◆ fUseMBDist

bool genie::LocalFGM::fUseMBDist
private

Definition at line 85 of file LocalFGM.h.

Referenced by GenerateNucleon(), and LoadConfig().


The documentation for this class was generated from the following files: