GENIEGenerator
Loading...
Searching...
No Matches
NuclearModelI.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6
7 Costas Andreopoulos <c.andreopoulos \at cern.ch>
8 University of Liverpool
9
10 For the class documentation see the corresponding header file.
11
12 Important revisions after version 2.0.0 :
13
14 @ Mar 18, 2016- Joe Johnston (SD)
15 Update GenerateNucleon() and Prob() to accept a radius as the argument,
16 and call the corresponding methods in the nuclear model with a radius.
17
18*/
19//____________________________________________________________________________
20
21
32
33using std::ostringstream;
34using namespace genie;
35using namespace genie::constants;
36using namespace genie::controls;
37
38//____________________________________________________________________________
39
41 double /*hitNucleonRadius*/) const
42 {
43 return GenerateNucleon(tgt);
44 }
45
46double NuclearModelI::Prob(double p, double w, const Target & tgt,
47 double /*hitNucleonRadius*/) const
48 {
49 return Prob(p,w,tgt);
50 }
51
52//____________________________________________________________________________
53
54double NuclearModelI::FermiMomentum( const Target & t, int nucleon_pdg ) const {
55
56 if ( ! fKFTable ) return 0. ;
57
58 return fKFTable->FindClosestKF( t.Pdg(), nucleon_pdg);
59
60}
61
62//____________________________________________________________________________
63
64double NuclearModelI::LocalFermiMomentum( const Target & t, int nucleon_pdg,
65 double /*radius*/ ) const {
66 return FermiMomentum( t, nucleon_pdg ) ;
67
68}
69
70//____________________________________________________________________________
71
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}
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils.
static AlgConfigPool * Instance()
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
Singleton class to load & serve tables of Fermi momentum constants.
const FermiMomentumTable * GetTable(string name)
static FermiMomentumTablePool * Instance(void)
virtual void LoadConfig()
virtual double Prob(double p, double w, const Target &) const =0
virtual bool GenerateNucleon(const Target &) const =0
const genie::FermiMomentumTable * fKFTable
virtual double FermiMomentum(const Target &, int nucleon_pdg) const
virtual double LocalFermiMomentum(const Target &, int nucleon_pdg, double radius) const
A registry. Provides the container for algorithm configuration parameters.
Definition Registry.h:65
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition Target.h:40
int Pdg(void) const
Definition Target.h:71
Basic constants.
Misc GENIE control constants.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25