MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
marley::KleinNystrandNuclearFormFactor Class Reference

#include <NuclearFormFactor.hh>

Inheritance diagram for marley::KleinNystrandNuclearFormFactor:
marley::NuclearFormFactor

Public Member Functions

 KleinNystrandNuclearFormFactor (int Z, int A, bool adapted=false, double r0=DUMMY_r0_VALUE)
 
virtual double F (double kappa) const override final
 
double r0 () const
 
- Public Member Functions inherited from marley::NuclearFormFactor
 NuclearFormFactor (int Z, int A)
 
int A () const
 
int Z () const
 

Static Public Attributes

static constexpr double DUMMY_r0_VALUE = std::numeric_limits< double >::lowest()
 

Static Protected Member Functions

static void initialize_r0_table ()
 

Protected Attributes

double a_ = 0.7
 Range (fm) of the assumed Yukawa potential.
 
bool adapted_ = false
 
double r0_ = DUMMY_r0_VALUE
 Value of the rms charge radius, used only for the adapted version.
 
double R_
 Effective nuclear radius (fm)
 
- Protected Attributes inherited from marley::NuclearFormFactor
int A_
 Nucleon number.
 
int Z_
 Proton number.
 

Static Protected Attributes

static const std::string r0_data_file_name_ = "nuclear_charge_radii.js"
 Name of the data file containing the measured rms charge radii.
 
static std::unique_ptr< std::map< int, double > > r0_table_
 Stores measured rms charge radii for many nucleii.
 

Additional Inherited Members

- Static Public Member Functions inherited from marley::NuclearFormFactor
static std::shared_ptr< marley::NuclearFormFactorcreate (int Z, int A, const JSON &ff_config)
 

Detailed Description

Implements a nuclear form factor based on Phys. Rev. C 60, 014903 (1999) Parameter values for the default and COHERENT's "adapted" version are described in Universe 9, 207 (2023)

Definition at line 134 of file NuclearFormFactor.hh.

Constructor & Destructor Documentation

◆ KleinNystrandNuclearFormFactor()

marley::KleinNystrandNuclearFormFactor::KleinNystrandNuclearFormFactor ( int Z,
int A,
bool adapted = false,
double r0 = DUMMY_r0_VALUE )
inline

Definition at line 137 of file NuclearFormFactor.hh.

139 : NuclearFormFactor( Z, A ), adapted_( adapted ), r0_( r0 )
140 {
141 // COHERENT-style "adapted" treatment uses the rms charge radius r0 to
142 // calculate the effective nuclear radius. If the user did not supply
143 // one, then look it up from the table of measurements.
144 if ( adapted_ ) {
145 if ( r0_ == DUMMY_r0_VALUE ) {
146 // Ensure that the table has been loaded
147 if ( !r0_table_ ) this->initialize_r0_table();
148
149 int pdg = marley_utils::get_nucleus_pid( Z, A );
150 auto iter = r0_table_->find( pdg );
151 if ( iter != r0_table_->end() ) {
152 r0_ = iter->second;
153 }
154 else {
155 throw marley::Error( "Unable to find tabulated rms charge"
156 " radius for nucleus with PDG code " + std::to_string( pdg )
157 + ". Please specify a value in fm using the \"r0\" JSON key." );
158 }
159 }
160
161 R_ = marley_utils::real_sqrt( 5.*r0_*r0_/3. - 10.*a_*a_ );
162 return;
163 }
164
165 // Default treatment assigns the effective nuclear radius based solely
166 // on the nucleon number
167 R_ = 1.23 * std::pow( A_, marley_utils::ONE_THIRD ); // fm
168 }
double a_
Range (fm) of the assumed Yukawa potential.
double r0_
Value of the rms charge radius, used only for the adapted version.
double R_
Effective nuclear radius (fm)
static std::unique_ptr< std::map< int, double > > r0_table_
Stores measured rms charge radii for many nucleii.

Member Function Documentation

◆ F()

double marley::KleinNystrandNuclearFormFactor::F ( double kappa) const
finaloverridevirtual

Evaluate the nuclear form factor at a given 3-momentum transfer

Parameters
kappaMagnitude of the 3-momentum transfer (MeV)

Implements marley::NuclearFormFactor.

Definition at line 100 of file NuclearFormFactor.cc.

100 {
101 if ( kappa == 0. ) return 1.;
102 double kappa_in_inverse_fm = kappa / marley_utils::hbar_c;
103 double x = kappa_in_inverse_fm * R_;
104 double j1 = ( std::sin( x ) / x - std::cos( x ) ) / x;
105 double F = 3. * j1 / x * ( 1. / ( 1.
106 + kappa_in_inverse_fm*kappa_in_inverse_fm*a_*a_ ) );
107 return F;
108}
virtual double F(double kappa) const override final

References a_, F(), and R_.

Referenced by F().

◆ initialize_r0_table()

void marley::KleinNystrandNuclearFormFactor::initialize_r0_table ( )
staticprotected

Definition at line 110 of file NuclearFormFactor.cc.

110 {
111
112 // Instantiate the file manager and use it to find the data file containing
113 // the rms charge radii for many nuclei
114 const auto& fm = marley::FileManager::Instance();
115 std::string full_r0_file_name = fm.find_file( r0_data_file_name_ );
116
117 if ( full_r0_file_name.empty() ) {
118 throw marley::Error( "Could not find the MARLEY nuclear rms charge radii"
119 " data file " + r0_data_file_name_ + ". Please ensure that"
120 " the folder containing it is on the MARLEY search path."
121 " If needed, the folder can be appended to the MARLEY_SEARCH_PATH"
122 " environment variable." );
123 }
124
125 MARLEY_LOG( INFO, "init.structure" ) << "Loading ground-state nuclear rms charge radii from "
126 << full_r0_file_name;
127
128 marley::JSON r0_json_obj = marley::JSON::load_file( full_r0_file_name );
129 if ( !r0_json_obj.has_key("nuclear_charge_radii") ) {
130 throw marley::Error( "Missing \"nuclear_charge_radii\" key in "
131 + full_r0_file_name );
132 }
133 const marley::JSON& r0_json_array = r0_json_obj.at( "nuclear_charge_radii" );
134 if ( !r0_json_array.is_array() ) {
135 throw marley::Error( "Invalid \"nuclear_charge_radii\" array in "
136 + full_r0_file_name );
137 }
138
139 r0_table_ = std::make_unique< std::map< int, double > >();
140
141 bool ok; // Helper flag to use when reading the JSON array elements
142 for ( const auto& r0_js : r0_json_array.array_range() ) {
143 int Z = assign_from_json< int >( "Z", r0_js, ok );
144 int A = assign_from_json< int >( "A", r0_js, ok );
145 double R = assign_from_json< double >( "R", r0_js, ok );
146
147 // TODO: load and use the uncertainty on the rms charge radius
148 //double R_unc = assign_from_json< double >( "R_unc", r0_js, ok );
149
150 // Add the completed entry to the table of nuclear radii
151 int pdg = marley_utils::get_nucleus_pid( Z, A );
152 r0_table_->operator[]( pdg ) = R;
153
154 MARLEY_LOG( TRACE, "init.structure.masstable" ) << "Nucleus with PDG code "
155 << pdg << " has rms charge radius " << R << " fm";
156 }
157
158}
static const FileManager & Instance()
Get a const reference to the singleton instance of the FileManager.
static const std::string r0_data_file_name_
Name of the data file containing the measured rms charge radii.

◆ r0()

double marley::KleinNystrandNuclearFormFactor::r0 ( ) const
inline

Returns the value of the rms charge radius used with the adapted version

Definition at line 176 of file NuclearFormFactor.hh.

176 {
177 if ( !adapted_ ) MARLEY_LOG( WARN, "physics.formfactor" )
178 << "Requested rms charge radius"
179 << " when using default Klein-Nystrand nuclear form factor";
180 return r0_;
181 }

References adapted_, and r0_.

Member Data Documentation

◆ a_

double marley::KleinNystrandNuclearFormFactor::a_ = 0.7
protected

Range (fm) of the assumed Yukawa potential.

Definition at line 202 of file NuclearFormFactor.hh.

Referenced by F().

◆ adapted_

bool marley::KleinNystrandNuclearFormFactor::adapted_ = false
protected

Flag indicating whether we are using the COHERENT-style "adapted" version

Definition at line 209 of file NuclearFormFactor.hh.

Referenced by r0().

◆ DUMMY_r0_VALUE

double marley::KleinNystrandNuclearFormFactor::DUMMY_r0_VALUE = std::numeric_limits< double >::lowest()
staticconstexpr

Dummy value used to signal the need to look up the rms charge radius from a table of measurements

Definition at line 185 of file NuclearFormFactor.hh.

◆ r0_

double marley::KleinNystrandNuclearFormFactor::r0_ = DUMMY_r0_VALUE
protected

Value of the rms charge radius, used only for the adapted version.

Definition at line 212 of file NuclearFormFactor.hh.

Referenced by r0().

◆ r0_data_file_name_

const std::string marley::KleinNystrandNuclearFormFactor::r0_data_file_name_ = "nuclear_charge_radii.js"
inlinestaticprotected

Name of the data file containing the measured rms charge radii.

Definition at line 198 of file NuclearFormFactor.hh.

◆ r0_table_

std::unique_ptr< std::map< int, double > > marley::KleinNystrandNuclearFormFactor::r0_table_
inlinestaticprotected

Stores measured rms charge radii for many nucleii.

Keys are nuclear PDG codes, values are rms charge radii (fm)

Definition at line 194 of file NuclearFormFactor.hh.

◆ R_

double marley::KleinNystrandNuclearFormFactor::R_
protected

Effective nuclear radius (fm)

Definition at line 205 of file NuclearFormFactor.hh.

Referenced by F().


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