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

Pure abstract base class. Defines the NuclearModelI interface to be implemented by any physics model describing the distribution of nucleons within a nuclei. More...

#include <NuclearModelI.h>

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

Public Member Functions

virtual ~NuclearModelI ()
 
virtual bool GenerateNucleon (const Target &) const =0
 
virtual bool GenerateNucleon (const Target &tgt, double hitNucleonRadius) const
 
virtual double Prob (double p, double w, const Target &) const =0
 
virtual double Prob (double p, double w, const Target &tgt, double hitNucleonRadius) const
 
virtual NuclearModel_t ModelType (const Target &) const =0
 
virtual double FermiMomentum (const Target &, int nucleon_pdg) 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 Configure (const Registry &config)
 
virtual void Configure (string config)
 
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

 NuclearModelI ()
 
 NuclearModelI (std::string name)
 
 NuclearModelI (std::string name, std::string config)
 
virtual void LoadConfig ()
 
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...
 

Protected Attributes

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...
 

Private Attributes

const genie::FermiMomentumTablefKFTable
 
string fKFTableName
 

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)
 

Detailed Description

Pure abstract base class. Defines the NuclearModelI interface to be implemented by any physics model describing the distribution of nucleons within a nuclei.

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

Important revisions after version 2.0.0 : @ Mar 18, 2016 - JJ (SD) Added option for GenerateNucleon() to be called with a target and a radius as the arguments. Currently used by LocalFGM. Calls GenerateNucleon() with the radius set to 0 for all other NuclearModelI implementations.

@ Jul 2020 - Marco Roda Added fooks for FermiMomentum and LocalFermiMomentum

Definition at line 46 of file NuclearModelI.h.

Constructor & Destructor Documentation

virtual genie::NuclearModelI::~NuclearModelI ( )
inlinevirtual

Definition at line 49 of file NuclearModelI.h.

49 {};
genie::NuclearModelI::NuclearModelI ( )
inlineprotected

Definition at line 96 of file NuclearModelI.h.

97  : Algorithm()
99  , fCurrMomentum(0,0,0)
101  , fKFTable(nullptr)
102  , fKFTableName("Unspecified")
103  {};
FermiMoverInteractionType_t fFermiMoverInteractionType
const genie::FermiMomentumTable * fKFTable
genie::NuclearModelI::NuclearModelI ( std::string  name)
inlineprotected

Definition at line 104 of file NuclearModelI.h.

105  : Algorithm(name)
106  , fCurrRemovalEnergy(0)
107  , fCurrMomentum(0,0,0)
109  , fKFTable(nullptr)
110  , fKFTableName("Unspecified")
111  {};
FermiMoverInteractionType_t fFermiMoverInteractionType
const genie::FermiMomentumTable * fKFTable
const char * name
genie::NuclearModelI::NuclearModelI ( std::string  name,
std::string  config 
)
inlineprotected

Definition at line 112 of file NuclearModelI.h.

113  : Algorithm(name, config)
114  , fCurrRemovalEnergy(0)
115  , fCurrMomentum(0,0,0)
117  , fKFTable(nullptr)
118  , fKFTableName("Unspecified")
119  {};
FermiMoverInteractionType_t fFermiMoverInteractionType
const genie::FermiMomentumTable * fKFTable
const char * name

Member Function Documentation

double NuclearModelI::FermiMomentum ( const Target t,
int  nucleon_pdg 
) const
virtual

Reimplemented in genie::NuclearModelMap, and genie::FGMBodekRitchie.

Definition at line 54 of file NuclearModelI.cxx.

References genie::Target::Pdg().

Referenced by genie::FGMBodekRitchie::FermiMomentum().

54  {
55 
56  if ( ! fKFTable ) return 0. ;
57 
58  return fKFTable->FindClosestKF( t.Pdg(), nucleon_pdg);
59 
60 }
int Pdg(void) const
Definition: Target.h:71
const genie::FermiMomentumTable * fKFTable
double FindClosestKF(int target_pdgc, int nucleon_pdgc) const
const genie::FermiMomentumTable& genie::NuclearModelI::FermiMomentumTable ( ) const
inlineprotected

Definition at line 124 of file NuclearModelI.h.

References fKFTable.

124 { return *fKFTable ; }
const genie::FermiMomentumTable * fKFTable
const string& genie::NuclearModelI::FermiMomentumTableName ( ) const
inlineprotected

Definition at line 123 of file NuclearModelI.h.

References fKFTableName.

123 { return fKFTableName; }
virtual bool genie::NuclearModelI::GenerateNucleon ( const Target ) const
pure virtual
bool NuclearModelI::GenerateNucleon ( const Target tgt,
double  hitNucleonRadius 
) const
virtual

Reimplemented in genie::LocalFGM, and genie::NuclearModelMap.

Definition at line 40 of file NuclearModelI.cxx.

42  {
43  return GenerateNucleon(tgt);
44  }
virtual bool GenerateNucleon(const Target &) const =0
FermiMoverInteractionType_t genie::NuclearModelI::GetFermiMoverInteractionType ( void  ) const
inline
void NuclearModelI::LoadConfig ( void  )
protectedvirtual

Reimplemented in genie::EffectiveSF, genie::LocalFGM, genie::NuclearModelMap, genie::FGMBodekRitchie, genie::SpectralFunc1d, and genie::SpectralFunc.

Definition at line 72 of file NuclearModelI.cxx.

References genie::utils::xml::GetString(), genie::FermiMomentumTablePool::GetTable(), genie::FermiMomentumTablePool::Instance(), and genie::AlgConfigPool::Instance().

Referenced by genie::SpectralFunc::LoadConfig(), genie::SpectralFunc1d::LoadConfig(), genie::FGMBodekRitchie::LoadConfig(), genie::LocalFGM::LoadConfig(), and genie::EffectiveSF::LoadConfig().

72  {
73 
74  string fermi_table_key = "FermiMomentumTable" ;
75 
76  // first try to get the Fermi Momentum table from the specific model configurtaion
77  if ( ! GetParam( fermi_table_key, fKFTableName, false ) ) {
78 
79  // if that fails, the information should come from the Global Config
80  Registry * algos = AlgConfigPool::Instance() -> GlobalParameterList() ;
81  fKFTableName = algos -> GetString( fermi_table_key ) ;
82 
83  }
84 
87 
88  // Note that model specifications can abvoid the usage of the table
89  // but if this configuration is called it's necessary that the table is set.
90  assert(fKFTable);
91 
92 }
static FermiMomentumTablePool * Instance(void)
Singleton class to load &amp; serve tables of Fermi momentum constants.
const FermiMomentumTable * GetTable(string name)
const genie::FermiMomentumTable * fKFTable
string GetString(xmlDocPtr xml_doc, string node_path)
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
static AlgConfigPool * Instance()
double NuclearModelI::LocalFermiMomentum ( const Target t,
int  nucleon_pdg,
double  radius 
) const
virtual

Reimplemented in genie::LocalFGM, and genie::NuclearModelMap.

Definition at line 64 of file NuclearModelI.cxx.

Referenced by genie::utils::BindHitNucleon().

65  {
66  return FermiMomentum( t, nucleon_pdg ) ;
67 
68 }
virtual double FermiMomentum(const Target &, int nucleon_pdg) const
virtual NuclearModel_t genie::NuclearModelI::ModelType ( const Target ) const
pure virtual
double genie::NuclearModelI::Momentum ( void  ) const
inline

Definition at line 70 of file NuclearModelI.h.

References fCurrMomentum.

71  {
72  return fCurrMomentum.Mag();
73  }
const TVector3& genie::NuclearModelI::Momentum3 ( void  ) const
inline
virtual double genie::NuclearModelI::Prob ( double  p,
double  w,
const Target  
) const
pure virtual
double NuclearModelI::Prob ( double  p,
double  w,
const Target tgt,
double  hitNucleonRadius 
) const
virtual

Reimplemented in genie::LocalFGM, and genie::NuclearModelMap.

Definition at line 46 of file NuclearModelI.cxx.

48  {
49  return Prob(p,w,tgt);
50  }
virtual double Prob(double p, double w, const Target &) const =0
double genie::NuclearModelI::RemovalEnergy ( void  ) const
inline
void genie::NuclearModelI::SetMomentum3 ( const TVector3 &  mom) const
inline
void genie::NuclearModelI::SetRemovalEnergy ( double  E) const
inline

Member Data Documentation

TVector3 genie::NuclearModelI::fCurrMomentum
mutableprotected
double genie::NuclearModelI::fCurrRemovalEnergy
mutableprotected
FermiMoverInteractionType_t genie::NuclearModelI::fFermiMoverInteractionType
mutableprotected
const genie::FermiMomentumTable* genie::NuclearModelI::fKFTable
private

Definition at line 133 of file NuclearModelI.h.

Referenced by FermiMomentumTable().

string genie::NuclearModelI::fKFTableName
private

Definition at line 134 of file NuclearModelI.h.

Referenced by FermiMomentumTableName().


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