24#include "marley/Logger.hh"
25#include "marley/marley_utils.hh"
44 virtual double F(
double kappa )
const = 0;
46 inline int Z()
const {
return Z_; }
47 inline int A()
const {
return A_; }
54 static std::shared_ptr< marley::NuclearFormFactor >
create(
int Z,
int A,
55 const JSON& ff_config );
70 inline TrivialNuclearFormFactor(
int Z,
int A )
73 virtual ~TrivialNuclearFormFactor() =
default;
75 inline virtual double F(
double )
const override final
87 c_ = 1.23*std::pow( A, marley_utils::ONE_THIRD ) - 0.6;
88 this->update_effective_radius();
91 virtual ~HelmNuclearFormFactor() =
default;
93 virtual double F(
double kappa )
const override final;
95 inline double s()
const {
return s_; }
96 inline void set_s(
double s ) {
98 this->update_effective_radius();
101 inline double a()
const {
return a_; }
103 inline void set_a(
double a ) {
105 this->update_effective_radius();
108 inline double c()
const {
return c_; }
109 inline void set_c(
double c ) {
111 this->update_effective_radius();
114 inline void update_effective_radius() {
115 R_ = marley_utils::real_sqrt( c_*c_ + 7.*marley_utils::pi
116 *marley_utils::pi*a_*a_/3. - 5.*
s_*
s_ );
137 inline KleinNystrandNuclearFormFactor(
int Z,
int A,
147 if ( !
r0_table_ ) this->initialize_r0_table();
149 int pdg = marley_utils::get_nucleus_pid( Z, A );
156 " radius for nucleus with PDG code " + std::to_string( pdg )
157 +
". Please specify a value in fm using the \"r0\" JSON key." );
161 R_ = marley_utils::real_sqrt( 5.*
r0_*
r0_/3. - 10.*
a_*
a_ );
167 R_ = 1.23 * std::pow(
A_, marley_utils::ONE_THIRD );
170 virtual ~KleinNystrandNuclearFormFactor() =
default;
172 virtual double F(
double kappa )
const override final;
176 inline double r0()
const {
177 if ( !
adapted_ ) MARLEY_LOG( WARN,
"physics.formfactor" )
178 <<
"Requested rms charge radius"
179 <<
" when using default Klein-Nystrand nuclear form factor";
186 = std::numeric_limits< double >::lowest();
190 static void initialize_r0_table();
194 inline static std::unique_ptr< std::map< int, double > >
r0_table_;
199 =
"nuclear_charge_radii.js";
Base class for all exceptions thrown by MARLEY functions.