GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
genie::FGMBodekRitchie Class Reference

The Bodek Richie Fermi Gass model. Implements the NuclearModelI interface. More...

#include <FGMBodekRitchie.h>

Inheritance diagram for genie::FGMBodekRitchie:
Inheritance graph
[legend]
Collaboration diagram for genie::FGMBodekRitchie:
Collaboration graph
[legend]

Public Member Functions

 FGMBodekRitchie ()
 
 FGMBodekRitchie (string config)
 
virtual ~FGMBodekRitchie ()
 
bool GenerateNucleon (const Target &t) const
 
double Prob (double mom, double w, const Target &t) const
 
NuclearModel_t ModelType (const Target &) const
 
virtual double FermiMomentum (const Target &t, int nucleon_pdg) const
 
void Configure (const Registry &config)
 
void Configure (string param_set)
 
- Public Member Functions inherited from genie::NuclearModelI
virtual ~NuclearModelI ()
 
virtual bool GenerateNucleon (const Target &tgt, double hitNucleonRadius) const
 
virtual double Prob (double p, double w, const Target &tgt, double hitNucleonRadius) const
 
virtual double LocalFermiMomentum (const Target &, int nucleon_pdg, double radius) 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. More...
 
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status. More...
 
virtual bool AllowReconfig (void) const
 
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm. More...
 
virtual void SetId (const AlgId &id)
 Set algorithm ID. More...
 
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. More...
 

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. More...
 
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. More...
 
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. More...
 
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 More...
 
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership More...
 
int MergeTopRegistry (const Registry &r)
 
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships. More...
 

Private Member Functions

TH1D * ProbDistro (const Target &t) const
 

Private Attributes

map< string, TH1D * > fProbDistroMap
 
map< int, double > fNucRmvE
 
double fPMax
 
double fPCutOff
 
bool fUseParametrization
 

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,...) More...
 
AlgId fID
 algorithm name and configuration set More...
 
vector< Registry * > fConfVect
 
vector< bool > fOwnerships
 ownership for every registry in fConfVect More...
 
AlgStatus_t fStatus
 algorithm execution status More...
 
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool) More...
 

Detailed Description

The Bodek Richie Fermi Gass model. Implements the NuclearModelI interface.

References:
Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
October 09, 2004
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 35 of file FGMBodekRitchie.h.

Constructor & Destructor Documentation

FGMBodekRitchie::FGMBodekRitchie ( )

Definition at line 43 of file FGMBodekRitchie.cxx.

43  :
44 NuclearModelI("genie::FGMBodekRitchie")
45 {
46 
47 }
FGMBodekRitchie::FGMBodekRitchie ( string  config)

Definition at line 49 of file FGMBodekRitchie.cxx.

49  :
50 NuclearModelI("genie::FGMBodekRitchie", config)
51 {
52 
53 }
FGMBodekRitchie::~FGMBodekRitchie ( )
virtual

Definition at line 55 of file FGMBodekRitchie.cxx.

References fProbDistroMap.

56 {
57  map<string, TH1D*>::iterator iter = fProbDistroMap.begin();
58  for( ; iter != fProbDistroMap.end(); ++iter) {
59  TH1D * hst = iter->second;
60  if(hst) {
61  delete hst;
62  hst=0;
63  }
64  }
65  fProbDistroMap.clear();
66 }
map< string, TH1D * > fProbDistroMap

Member Function Documentation

void FGMBodekRitchie::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 229 of file FGMBodekRitchie.cxx.

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

230 {
231  Algorithm::Configure(config);
232  this->LoadConfig();
233 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void FGMBodekRitchie::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 235 of file FGMBodekRitchie.cxx.

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

236 {
237  Algorithm::Configure(param_set);
238  this->LoadConfig();
239 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
double FGMBodekRitchie::FermiMomentum ( const Target t,
int  nucleon_pdg 
) const
virtual

Reimplemented from genie::NuclearModelI.

Definition at line 195 of file FGMBodekRitchie.cxx.

References genie::Target::A(), genie::units::A, genie::NuclearModelI::FermiMomentum(), genie::utils::nuclear::FermiMomentumForIsoscalarNucleonParametrization(), fUseParametrization, genie::Target::HitNucIsSet(), genie::pdg::IsNeutron(), genie::pdg::IsProton(), LOG, genie::Target::N(), pINFO, and genie::Target::Z().

Referenced by ProbDistro().

195  {
196 
197  assert( pdg::IsProton(nucleon_pdg) || pdg::IsNeutron(nucleon_pdg) );
198 
199  if ( t.A()<6 || !fUseParametrization ) {
200  //-- look up the Fermi momentum for this Target from tables
201  return NuclearModelI::FermiMomentum( t, nucleon_pdg ) ;
202  }
203  else
204  {
205  //-- define the Fermi momentum for this Target
207 
208  //-- correct the Fermi momentum for the struck nucleon
209  assert(t.HitNucIsSet());
210 
211  double A = (double) t.A() ;
212  if( pdg::IsProton(nucleon_pdg) ) {
213  double Z = (double) t.Z() ;
214  kF *= TMath::Power( 2*Z/A, 1./3.);
215  }
216  else {
217  double N = (double) t.N() ;
218  kF *= TMath::Power( 2*N/A, 1./3.);
219  }
220 
221  LOG("BodekRitchie", pINFO) << "Corrected KF = " << kF;
222 
223  return kF ;
224 
225  }
226 
227 }
int A(void) const
Definition: Target.h:70
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:341
virtual double FermiMomentum(const Target &, int nucleon_pdg) const
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:336
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
static constexpr double A
Definition: Units.h:74
int Z(void) const
Definition: Target.h:68
#define pINFO
Definition: Messenger.h:62
double FermiMomentumForIsoscalarNucleonParametrization(const Target &target)
int N(void) const
Definition: Target.h:69
bool HitNucIsSet(void) const
Definition: Target.cxx:283
bool FGMBodekRitchie::GenerateNucleon ( const Target t) const
virtual

Implements genie::NuclearModelI.

Definition at line 68 of file FGMBodekRitchie.cxx.

References genie::Target::A(), genie::utils::nuclear::BindEnergyPerNucleon(), genie::utils::nuclear::BindEnergyPerNucleonParametrization(), genie::NuclearModelI::fCurrMomentum, genie::NuclearModelI::fCurrRemovalEnergy, fNucRmvE, fUseParametrization, genie::Target::HitNucIsSet(), genie::RandomGen::Instance(), genie::constants::kPi, LOG, pINFO, pNOTICE, ProbDistro(), genie::RandomGen::RndGen(), and genie::Target::Z().

69 {
70  assert(target.HitNucIsSet());
71 
73  fCurrMomentum.SetXYZ(0,0,0);
74 
75  //-- set fermi momentum vector
76  //
77  TH1D * prob = this->ProbDistro(target);
78  if ( ! prob ) {
79  LOG("BodekRitchie", pNOTICE)
80  << "Null nucleon momentum probability distribution";
81  exit(1);
82  }
83  double p = prob->GetRandom();
84  LOG("BodekRitchie", pINFO) << "|p,nucleon| = " << p;
85 
87 
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);
93 
94  double px = p*sintheta*cosfi;
95  double py = p*sintheta*sinfi;
96  double pz = p*costheta;
97 
98  fCurrMomentum.SetXYZ(px,py,pz);
99 
100  //-- set removal energy
101  //
102  if ( target.A() < 6 || ! fUseParametrization )
103  {
104  int Z = target.Z();
105  map<int,double>::const_iterator it = fNucRmvE.find(Z);
106  if(it != fNucRmvE.end()) fCurrRemovalEnergy = it->second;
107  else fCurrRemovalEnergy = nuclear::BindEnergyPerNucleon(target);
108  }
109  else {
110  fCurrRemovalEnergy = nuclear::BindEnergyPerNucleonParametrization(target);
111  }
112 
113  return true;
114 }
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
map< int, double > fNucRmvE
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
double BindEnergyPerNucleon(const Target &target)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
double BindEnergyPerNucleonParametrization(const Target &target)
#define pINFO
Definition: Messenger.h:62
TH1D * ProbDistro(const Target &t) const
TRandom3 & RndGen(void) const
rnd number generator for generic usage
Definition: RandomGen.h:80
#define pNOTICE
Definition: Messenger.h:61
void FGMBodekRitchie::LoadConfig ( void  )
protectedvirtual

Reimplemented from genie::NuclearModelI.

Definition at line 241 of file FGMBodekRitchie.cxx.

References fNucRmvE, fPCutOff, fPMax, fUseParametrization, genie::Algorithm::GetConfig(), genie::Registry::GetItemMap(), genie::Algorithm::GetParam(), genie::Algorithm::GetParamDef(), genie::pdg::IonPdgCodeToZ(), genie::NuclearModelI::LoadConfig(), LOG, pDEBUG, and pINFO.

Referenced by Configure().

242 {
243 
245 
246  // Default value 4.0 from original paper by A. Bodek and J. L. Ritchie. Phys. Rev. D 23, 1070
247  this->GetParamDef("MomentumMax", fPMax, 4.0);
248  this->GetParam("RFG-MomentumCutOff", fPCutOff);
249  this->GetParam("RFG-UseParametrization", fUseParametrization);
250 
251  assert(fPMax > 0 && fPCutOff > 0 && fPCutOff < fPMax);
252 
253  // Load removal energy for specific nuclei from either the algorithm's
254  // configuration file or the UserPhysicsOptions file.
255  // If none is used use Wapstra's semi-empirical formula.
256  const std::string keyStart = "RFG-NucRemovalE@Pdg=";
257 
258  RgIMap entries = GetConfig().GetItemMap();
259 
260  for(RgIMap::const_iterator it = entries.begin(); it != entries.end(); ++it){
261  const std::string& key = it->first;
262  int pdg = 0;
263  int Z = 0;
264  if (0 == key.compare(0, keyStart.size(), keyStart.c_str())) {
265  pdg = atoi(key.c_str() + keyStart.size());
266  Z = pdg::IonPdgCodeToZ(pdg);
267  }
268  if (0 != pdg && 0 != Z) {
269  ostringstream key_ss ;
270  key_ss << keyStart << pdg;
271  RgKey rgkey = key_ss.str();
272  double eb ;
273  GetParam( rgkey, eb ) ;
274  eb = TMath::Max(eb, 0.);
275  LOG("BodekRitchie", pINFO)
276  << "Nucleus: " << pdg << " -> using Eb = " << eb << " GeV";
277  fNucRmvE.insert(map<int,double>::value_type(Z,eb));
278  }
279  }
280 
281  LOG("BodekRitchie", pDEBUG)
282  << "Finished LoadConfig";
283 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
284  for (map<int,double>::iterator it = fNucRmvE.begin(); it != fNucRmvE.end(); ++it) {
285  LOG("BodekRitchie", pDEBUG)
286  << "Z = " << (*it).first << "; eb = " << (*it).second;
287  }
288 #endif
289 }
map< int, double > fNucRmvE
virtual const Registry & GetConfig(void) const
Definition: Algorithm.cxx:246
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const RgIMap & GetItemMap(void) const
Definition: Registry.h:161
#define pINFO
Definition: Messenger.h:62
virtual void LoadConfig()
string RgKey
int IonPdgCodeToZ(int pdgc)
Definition: PDGUtils.cxx:55
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
#define pDEBUG
Definition: Messenger.h:63
map< RgKey, RegistryItemI * > RgIMap
Definition: Registry.h:45
NuclearModel_t genie::FGMBodekRitchie::ModelType ( const Target ) const
inlinevirtual

Implements genie::NuclearModelI.

Definition at line 48 of file FGMBodekRitchie.h.

References genie::kNucmFermiGas.

49  {
50  return kNucmFermiGas;
51  }
double FGMBodekRitchie::Prob ( double  mom,
double  w,
const Target t 
) const
virtual

Implements genie::NuclearModelI.

Definition at line 116 of file FGMBodekRitchie.cxx.

References ProbDistro().

117 {
118  if(w<0) {
119  TH1D * prob_distr = this->ProbDistro(target);
120  int bin = prob_distr->FindBin(mom);
121  double y = prob_distr->GetBinContent(bin);
122  double dx = prob_distr->GetBinWidth(bin);
123  double prob = y*dx;
124  return prob;
125  }
126  return 1;
127 }
TH1D * ProbDistro(const Target &t) const
TH1D * FGMBodekRitchie::ProbDistro ( const Target t) const
private

Definition at line 129 of file FGMBodekRitchie.cxx.

References a, genie::Target::AsString(), FermiMomentum(), fPCutOff, fPMax, fProbDistroMap, genie::Target::HitNucPdg(), genie::pdg::IsNeutron(), genie::pdg::IsProton(), genie::constants::kPi, LOG, pDEBUG, and pNOTICE.

Referenced by GenerateNucleon(), and Prob().

130 {
131  //-- return stored /if already computed/
132  map<string, TH1D*>::iterator it = fProbDistroMap.find(target.AsString());
133  if(it != fProbDistroMap.end()) return it->second;
134 
135  LOG("BodekRitchie", pNOTICE)
136  << "Computing P = f(p_nucleon) for: " << target.AsString();
137  LOG("BodekRitchie", pNOTICE)
138  << "P(cut-off) = " << fPCutOff << ", P(max) = " << fPMax;
139 
140  //-- get information for the nuclear target
141  //int target_pdgc = pdg::IonPdgCode(target.A(), target.Z());
142  int nucleon_pdgc = target.HitNucPdg();
143  assert( pdg::IsProton(nucleon_pdgc) || pdg::IsNeutron(nucleon_pdgc) );
144 
145  double KF = FermiMomentum( target, nucleon_pdgc ) ;
146 
147  double a = 2.0;
148  double C = 4. * kPi * TMath::Power(KF,3) / 3.;
149  double R = 1. / (1.- KF/fPMax);
150 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
151  LOG("BodekRitchie", pDEBUG) << "a = " << a;
152  LOG("BodekRitchie", pDEBUG) << "C = " << C;
153  LOG("BodekRitchie", pDEBUG) << "R = " << R;
154 #endif
155 
156  //-- create the probability distribution
157 
158  int npbins = (int) (1000*fPMax);
159  TH1D * prob = new TH1D("", "", npbins, 0, fPMax);
160  prob->SetDirectory(0);
161 
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);
165 
166  for(int i = 0; i < npbins; i++) {
167  double p = i * dp;
168  double p2 = TMath::Power(p,2);
169 
170  // calculate |phi(p)|^2
171  double phi2 = 0;
172  if (p <= KF)
173  phi2 = iC * (1. - 6.*kfa_pi_2);
174  else if ( p > KF && p < fPCutOff)
175  phi2 = iC * (2*R*kfa_pi_2*TMath::Power(KF/p,4.));
176 
177  // calculate probability density : dProbability/dp
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;
181 #endif
182  prob->Fill(p, dP_dp);
183  }
184 
185  //-- normalize the probability distribution
186  prob->Scale( 1.0 / prob->Integral("width") );
187 
188  //-- store
189  fProbDistroMap.insert(
190  map<string, TH1D*>::value_type(target.AsString(),prob));
191 
192  return prob;
193 }
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:341
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:336
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const double a
map< string, TH1D * > fProbDistroMap
virtual double FermiMomentum(const Target &t, int nucleon_pdg) const
#define pNOTICE
Definition: Messenger.h:61
#define pDEBUG
Definition: Messenger.h:63

Member Data Documentation

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

Definition at line 69 of file FGMBodekRitchie.h.

Referenced by GenerateNucleon(), and LoadConfig().

double genie::FGMBodekRitchie::fPCutOff
private

Definition at line 72 of file FGMBodekRitchie.h.

Referenced by LoadConfig(), and ProbDistro().

double genie::FGMBodekRitchie::fPMax
private

Definition at line 71 of file FGMBodekRitchie.h.

Referenced by LoadConfig(), and ProbDistro().

map<string, TH1D *> genie::FGMBodekRitchie::fProbDistroMap
mutableprivate

Definition at line 67 of file FGMBodekRitchie.h.

Referenced by ProbDistro(), and ~FGMBodekRitchie().

bool genie::FGMBodekRitchie::fUseParametrization
private

Definition at line 73 of file FGMBodekRitchie.h.

Referenced by FermiMomentum(), GenerateNucleon(), and LoadConfig().


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