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
NucleonFormFactors.cc
1
4//
5// This file is part of MARLEY (Model of Argon Reaction Low Energy Yields)
6//
7// MARLEY is free software: you can redistribute it and/or modify it under the
8// terms of version 3 of the GNU General Public License as published by the
9// Free Software Foundation.
10//
11// For the full text of the license please see COPYING or
12// visit http://opensource.org/licenses/GPL-3.0
13//
14// Please respect the MCnet academic usage guidelines. See GUIDELINES
15// or visit https://www.montecarlonet.org/GUIDELINES for details.
16
17// MARLEY includes
18#include "marley/Error.hh"
19#include "marley/JSON.hh"
20#include "marley/JSONConfig.hh"
21#include "marley/NucleonFormFactors.hh"
22#include "marley/marley_utils.hh"
23
25 return marley_utils::g_V * this->dipole( Q2 );
26}
27
29 return marley_utils::mu_p * this->dipole( Q2 );
30}
31
33 return marley_utils::mu_n * this->dipole( Q2 );
34}
35
36// Implements Eq. (6) from Nucl. Phys. B Proc. Suppl. 159, 127 (2006)
37// https://doi.org/10.1016/j.nuclphysbps.2006.08.028
39 const std::vector< double >& a_coeffs,
40 const std::vector< double >& b_coeffs )
41{
42 double numer = 0.;
43 double denom = 1.;
44
45 double tau_pow = 1.;
46 for ( const auto& a : a_coeffs ) {
47 numer += a * tau_pow;
48 tau_pow *= tau;
49 }
50
51 tau_pow = tau;
52 for ( const auto& b : b_coeffs ) {
53 denom += b * tau_pow;
54 tau_pow *= tau;
55 }
56
57 double ff_G = numer / denom;
58 return ff_G;
59}
60
62 double tau = this->tau( Q2 );
63 // TODO: remove hard-coding here and make the parameters configurable
64 return marley_utils::g_V * this->bbba05_G( tau, { 1., -0.0578 },
65 { 11.1, 13.6, 33. } );
66}
67
69 double tau = this->tau( Q2 );
70 // TODO: remove hard-coding here and make the parameters configurable
71 return marley_utils::mu_p * this->bbba05_G( tau, { 1., 0.150 },
72 { 11.1, 19.6, 7.54 } );
73}
74
76 double tau = this->tau( Q2 );
77 // TODO: remove hard-coding here and make the parameters configurable
78 return this->bbba05_G( tau, { 0., 1.25, 1.30 },
79 { -9.86, 305., -758., 802. } );
80}
81
83 double tau = this->tau( Q2 );
84 // TODO: remove hard-coding here and make the parameters configurable
85 return marley_utils::mu_n * this->bbba05_G( tau, { 1., 1.81 },
86 { 14.1, 20.7, 68.7 } );
87}
88
90 { return marley_utils::g_V; }
91
92double marley::TrivialSachsFormFactors::GEn( double /*Q2*/ ) { return 0.; }
93
95 { return marley_utils::mu_p; }
96
98 { return marley_utils::mu_n; }
99
101 { return -marley_utils::g_A; }
102
103double marley::TrivialAxialFormFactors::FP( double /*Q2*/ ) {
104 return -2. * marley_utils::g_A * marley_utils::m_nucleon
105 / marley_utils::m_pion / marley_utils::m_pion;
106}
107
108double marley::NucleonFormFactors::F1p( double Q2 ) const {
109 double tau = sachs_ff_->tau( Q2 );
110 double GEp = sachs_ff_->GEp( Q2 );
111 double GMp = sachs_ff_->GMp( Q2 );
112 double F1p = ( GEp + tau*GMp ) / ( 1. + tau );
113 return F1p;
114}
115
116double marley::NucleonFormFactors::F1n( double Q2 ) const {
117 double tau = sachs_ff_->tau( Q2 );
118 double GEn = sachs_ff_->GEn( Q2 );
119 double GMn = sachs_ff_->GMn( Q2 );
120 double F1n = ( GEn + tau*GMn ) / ( 1. + tau );
121 return F1n;
122}
123
124double marley::NucleonFormFactors::F2p( double Q2 ) const {
125 double tau = sachs_ff_->tau( Q2 );
126 double GEp = sachs_ff_->GEp( Q2 );
127 double GMp = sachs_ff_->GMp( Q2 );
128 double F2p = ( GMp - GEp ) / ( 1. + tau ) / 2. / marley_utils::m_nucleon;
129 return F2p;
130}
131
132double marley::NucleonFormFactors::F2n( double Q2 ) const {
133 double tau = sachs_ff_->tau( Q2 );
134 double GEn = sachs_ff_->GEn( Q2 );
135 double GMn = sachs_ff_->GMn( Q2 );
136 double F2n = ( GMn - GEn ) / ( 1. + tau ) / 2. / marley_utils::m_nucleon;
137 return F2n;
138}
139
140marley::NucleonFormFactors::NucleonFormFactors( const marley::JSON& config ) {
141
142 // Flag used to ensure that we send information about the form factor
143 // configuration to the logger exactly once when this function is first
144 // called
145 static bool need_to_log = true;
146
147 // If the user has requested use of the allowed approximation, then
148 // configure trivial form factor models and return without logging this
149 // choice (it will be handled elsewhere)
151 sachs_ff_ = std::make_shared< TrivialSachsFormFactors >();
152 axial_ff_ = std::make_shared< TrivialAxialFormFactors >();
153 need_to_log = false;
154 return;
155 }
156
157 if ( !config.has_key("sachs_model") ) {
158 throw marley::Error( "Missing Sachs form factor model configuration" );
159 }
160 const auto& sachs_json = config.at( "sachs_model" );
161 if ( !sachs_json.is_string() ) {
162 throw marley::Error( "Invalid Sachs form factor model "
163 + sachs_json.dump_string() );
164 }
165 std::string sachs_ff_model = sachs_json.to_string();
166
167 if ( !config.has_key("axial_model") ) {
168 throw marley::Error( "Missing axial form factor model configuration" );
169 }
170 const auto& axial_json = config.at( "axial_model" );
171 if ( !axial_json.is_string() ) {
172 throw marley::Error( "Invalid axial form factor model "
173 + axial_json.dump_string() );
174 }
175 std::string axial_ff_model = axial_json.to_string();
176
177 // Choose the model to use for the Sachs form factors
178 if ( sachs_ff_model == "trivial" ) {
179 sachs_ff_ = std::make_shared< TrivialSachsFormFactors >();
180 if ( need_to_log ) {
181 MARLEY_LOG( INFO, "physics.formfactor" ) << "Using trivial Sachs form factors";
182 }
183 }
184 else if ( sachs_ff_model == "dipole" ) {
185 sachs_ff_ = std::make_shared< DipoleSachsFormFactors >( marley_utils::M_V );
186 if ( need_to_log ) {
187 MARLEY_LOG( INFO, "physics.formfactor" ) << "Using dipole Sachs form factors";
188 }
189 }
190 else if ( sachs_ff_model == "bbba05" ) {
191 sachs_ff_ = std::make_shared< BBBA05SachsFormFactors >();
192 if ( need_to_log ) {
193 MARLEY_LOG( INFO, "physics.formfactor" ) << "Using BBBA05 Sachs form factors";
194 }
195 }
196 else throw marley::Error( "Unrecognized Sachs form factor model name \""
197 + sachs_ff_model + "\" in constructor of marley::NucleonFormFactors" );
198
199 // Choose the model to use for the axial form factors
200 if ( axial_ff_model == "trivial" ) {
201 axial_ff_ = std::make_shared< TrivialAxialFormFactors >();
202 if ( need_to_log ) {
203 MARLEY_LOG( INFO, "physics.formfactor" ) << "Using trivial axial form factors";
204 }
205 }
206 else if ( axial_ff_model == "dipole" ) {
207 axial_ff_ = std::make_shared< DipoleAxialFormFactors >( marley_utils::g_A,
208 marley_utils::M_A );
209 if ( need_to_log ) {
210 MARLEY_LOG( INFO, "physics.formfactor" ) << "Using dipole axial form factors";
211 }
212 }
213 else throw marley::Error( "Unrecognized axial form factor model name \""
214 + axial_ff_model + "\" in constructor of marley::NucleonFormFactors" );
215
216 need_to_log = false;
217}
218
219double marley::SachsFormFactors::tau( double Q2 ) {
220 return Q2 / 4. / marley_utils::m_nucleon / marley_utils::m_nucleon;
221}
222
224 return 2. * marley_utils::m_nucleon * this->FA( Q2 )
225 / ( marley_utils::m_pion*marley_utils::m_pion + Q2 );
226}
virtual double GMp(double Q2) override final
virtual double GEn(double Q2) override final
virtual double GEp(double Q2) override final
virtual double GMn(double Q2) override final
double bbba05_G(double tau, const std::vector< double > &a_coeffs, const std::vector< double > &b_coeffs)
Helper function for the form factor calculation.
double FA(double Q2) override final
Axial-vector form factor.
double FP(double Q2) override final
Pseudoscalar form factor.
virtual double GEp(double Q2) override final
virtual double GMp(double Q2) override final
virtual double GMn(double Q2) override final
Base class for all exceptions thrown by MARLEY functions.
Definition Error.hh:26
static bool check_for_allowed_approximation(const marley::JSON &ff_config)
double F1p(double Q2) const
double F1n(double Q2) const
double F2n(double Q2) const
double F2p(double Q2) const
virtual double tau(double Q2)
double FA(double Q2) override final
Axial-vector form factor.
double FP(double Q2) override final
Pseudoscalar form factor.
virtual double GEp(double Q2) override final
virtual double GEn(double Q2) override final
virtual double GMn(double Q2) override final
virtual double GMp(double Q2) override final