NuclearModelI.cxx
Go to the documentation of this file.
1  //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2020, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6 
7  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
8  University of Liverpool & STFC Rutherford Appleton Laboratory
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 
33 using std::ostringstream;
34 using namespace genie;
35 using namespace genie::constants;
36 using namespace genie::controls;
37 
38 //____________________________________________________________________________
39 
41  double /*hitNucleonRadius*/) const
42  {
43  return GenerateNucleon(tgt);
44  }
45 
46 double NuclearModelI::Prob(double p, double w, const Target & tgt,
47  double /*hitNucleonRadius*/) const
48  {
49  return Prob(p,w,tgt);
50  }
51 
52 //____________________________________________________________________________
53 
54 double 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 
64 double 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 
86  fKFTable = kftp->GetTable(fKFTableName);
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 }
Basic constants.
virtual double LocalFermiMomentum(const Target &, int nucleon_pdg, double radius) const
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
#define GetString
Definition: config.cpp:1232
int Pdg(void) const
Definition: Target.h:71
static FermiMomentumTablePool * Instance(void)
virtual double FermiMomentum(const Target &, int nucleon_pdg) const
Singleton class to load & serve tables of Fermi momentum constants.
const FermiMomentumTable * GetTable(string name)
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
p
Definition: test.py:223
Misc GENIE control constants.
virtual void LoadConfig()
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
virtual bool GenerateNucleon(const Target &) const =0
virtual double Prob(double p, double w, const Target &) const =0
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
static AlgConfigPool * Instance()