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::ElectronReaction Class Reference
Inheritance diagram for marley::ElectronReaction:
marley::Reaction

Public Member Functions

 ElectronReaction (int pdg_a, int target_atom_pdg, const std::string &source_file)
 
virtual marley::TargetAtom atomic_target () const override final
 Returns the target atom involved in this reaction.
 
virtual std::shared_ptr< HepMC3::GenEventcreate_event (int particle_id_a, double KEa, marley::Generator &gen) const override
 Create an event object for this reaction.
 
virtual double diff_xs (int pdg_a, double KEa, double cos_theta_c_cm) const
 
double g1 () const
 
double g2 () const
 
virtual double threshold_kinetic_energy () const override
 Get the minimum lab-frame kinetic energy (MeV) of the projectile that allows this reaction to proceed via a transition to the residue's ground state.
 
virtual double total_xs (int pdg_a, double KEa) const override
 Compute the reaction's total cross section (MeV -2)
 
- Public Member Functions inherited from marley::Reaction
 Reaction (const std::string &source_file)
 Construct a Reaction with the resolved path of the data file.
 
const std::string & get_description () const
 Get a string that contains the formula for this reaction.
 
int pdg_a () const
 Get the projectile PDG code.
 
int pdg_b () const
 Get the target PDG code.
 
ProcessType process_type () const
 Get the process type for this reaction.
 
const std::string & source_file () const
 Get the resolved path of the reaction data file used to construct this Reaction.
 

Additional Inherited Members

- Public Types inherited from marley::Reaction
enum  DataFormat { DiscreteStrengths = 0 , MultipoleResponses = 1 }
 Enumerated type describing the file format for reaction data. More...
 
enum  ProcessType {
  Unknown = -1 , NeutrinoCC_Discrete = 0 , AntiNeutrinoCC_Discrete = 1 , NC_Discrete = 2 ,
  NuElectronElastic = 3 , NeutrinoCC_Continuum = 4 , AntiNeutrinoCC_Continuum = 5 , NC_Continuum = 6 ,
  StandaloneDecay = 7
}
 Enumerated type describing the kind of scattering process represented by a Reaction. More...
 
- Static Public Member Functions inherited from marley::Reaction
static int get_ejectile_pdg (int pdg_a, ProcessType proc_type)
 
static void get_residue_pdg_and_charge (ProcessType proc_type, int pdg_b, int &pdg_d, int &q_d)
 
static std::vector< std::unique_ptr< Reaction > > load_from_file (const std::string &filename, StructureDatabase &db, CoulombCorrector::CoulombMode coulomb_mode, const JSON &ff_config)
 
static std::string proc_type_to_string (const ProcessType &pt)
 
- Protected Member Functions inherited from marley::Reaction
virtual std::shared_ptr< HepMC3::GenEventmake_event_object (double KEa, const std::shared_ptr< HepMC3::GenParticle > &ejectile, const std::shared_ptr< HepMC3::GenParticle > &residue) const
 Helper function that makes an event object.
 
virtual std::shared_ptr< HepMC3::GenEventmake_event_object (double KEa, double pc_cm, double cos_theta_c_cm, double phi_c_cm, double Ec_cm, double Ed_cm, int residue_status) const
 Helper function that makes an event object.
 
void two_two_scatter (double KEa, double &s, double &Ec_cm, double &pc_cm, double &Ed_cm) const
 Helper function that handles CM frame kinematics for the reaction.
 
- Static Protected Member Functions inherited from marley::Reaction
static const std::vector< int > & get_projectiles (ProcessType proc_type)
 
- Protected Attributes inherited from marley::Reaction
std::string description_
 String that contains a formula describing the reaction.
 
double ma_
 Projectile mass (MeV)
 
double mb_
 Target mass (MeV)
 
double mc_
 Ejectile mass (MeV)
 
double md_
 Residue mass (MeV)
 
int pdg_a_
 PDG code for the projectile.
 
int pdg_b_
 PDG code for the target.
 
int pdg_c_
 PDG code for the ejectile.
 
int pdg_d_
 PDG code for the residue.
 
ProcessType process_type_
 Type of scattering process (CC, NC) represented by this reaction.
 
const std::string source_file_
 Resolved path of the reaction data file.
 

Detailed Description

Definition at line 35 of file ElectronReaction.hh.

Constructor & Destructor Documentation

◆ ElectronReaction()

marley::ElectronReaction::ElectronReaction ( int pdg_a,
int target_atom_pdg,
const std::string & source_file )

Definition at line 31 of file ElectronReaction.cc.

33 : Reaction( source_file ), atom_( target_atom_pdg )
34{
36
37 pdg_a_ = pdg_a;
38 pdg_b_ = marley_utils::ELECTRON;
40 pdg_d_ = marley_utils::ELECTRON;
41
42 // Set the description string based on the particle PDG codes
43 description_ = marley_utils::get_particle_symbol( pdg_a_ )
44 + " + " + marley_utils::get_particle_symbol( pdg_b_ );
45 description_ += " --> " + marley_utils::get_particle_symbol( pdg_c_ );
46 description_ += " + " + marley_utils::get_particle_symbol( pdg_d_ );
47
48 const auto& mt = marley::MassTable::Instance();
49 ma_ = mt.get_particle_mass( pdg_a_ );
50 mb_ = mt.get_particle_mass( pdg_b_ );
51 mc_ = mt.get_particle_mass( pdg_c_ );
52 md_ = mt.get_particle_mass( pdg_d_ );
53
54 this->set_coupling_constants();
55
56 // Compute the kinetic energy of the projectile needed
57 // for this reaction to proceed at threshold
58 KEa_threshold_ = ( std::pow(mc_ + md_, 2)
59 - std::pow(ma_ + mb_, 2) ) / ( 2.*mb_ );
60
61 MARLEY_LOG( DEBUG, "physics.reaction" ) << "ElectronReaction: "
62 << description_ << ", g1 = " << g1_ << ", g2 = " << g2_
63 << ", threshold KE = " << KEa_threshold_ << " MeV";
64}
static const MassTable & Instance()
Get a const reference to the singleton instance of the MassTable.
Definition MassTable.cc:69
Reaction(const std::string &source_file)
Construct a Reaction with the resolved path of the data file.
Definition Reaction.cc:362
int pdg_a_
PDG code for the projectile.
Definition Reaction.hh:142
double md_
Residue mass (MeV)
Definition Reaction.hh:154
ProcessType process_type_
Type of scattering process (CC, NC) represented by this reaction.
Definition Reaction.hh:161
double mc_
Ejectile mass (MeV)
Definition Reaction.hh:149
static int get_ejectile_pdg(int pdg_a, ProcessType proc_type)
Definition Reaction.cc:329
@ NuElectronElastic
Neutrino-electron elastic scattering.
Definition Reaction.hh:63
const std::string & source_file() const
Get the resolved path of the reaction data file used to construct this Reaction.
Definition Reaction.hh:104
std::string description_
String that contains a formula describing the reaction.
Definition Reaction.hh:157
int pdg_c_
PDG code for the ejectile.
Definition Reaction.hh:144
int pdg_d_
PDG code for the residue.
Definition Reaction.hh:145
int pdg_a() const
Get the projectile PDG code.
Definition Reaction.hh:109
int pdg_b_
PDG code for the target.
Definition Reaction.hh:143
double ma_
Projectile mass (MeV)
Definition Reaction.hh:147
double mb_
Target mass (MeV)
Definition Reaction.hh:148

Member Function Documentation

◆ atomic_target()

virtual marley::TargetAtom marley::ElectronReaction::atomic_target ( ) const
inlinefinaloverridevirtual

Returns the target atom involved in this reaction.

For nuclear reactions, this is identical to the pdg_b_ member variable. For electron reactions, it is distinct (since particle b is the initial struck electron).

Implements marley::Reaction.

Definition at line 42 of file ElectronReaction.hh.

43 { return atom_; }

◆ create_event()

std::shared_ptr< HepMC3::GenEvent > marley::ElectronReaction::create_event ( int pdg_a,
double KEa,
marley::Generator & gen ) const
overridevirtual

Create an event object for this reaction.

Parameters
pdg_aPDG code for the incident projectile
KEaLab-frame kinetic energy of the projectile
genReference to the Generator to use for random sampling
Note
Functions that override create_event() should throw an Error if pdg_a != pdg_a_.

Implements marley::Reaction.

Definition at line 166 of file ElectronReaction.cc.

168{
169 // If the projectile's PDG code doesn't match that stored in this object,
170 // complain and refuse to create an event.
171 if ( pdg_a != pdg_a_ ) throw marley::Error("Could"
172 " not create this event. The requested projectile PDG code "
173 + std::to_string(pdg_a) + " does not match the value "
174 + std::to_string(pdg_a_) + " stored in the Reaction object.");
175
176 // Also complain if we're below threshold
177 if ( KEa < KEa_threshold_ ) throw marley::Error("Could not create"
178 " this event. The kinetic energy (" + std::to_string(KEa) + " MeV)"
179 " of the projectile is below the reaction threshold of "
180 + std::to_string(KEa_threshold_) + " MeV.");
181
182 double s, Ec_cm, pc_cm, Ed_cm;
183 two_two_scatter(KEa, s, Ec_cm, pc_cm, Ed_cm);
184
185 // Compute the maximum differential cross section to use for rejection
186 // sampling. To do this, we analytically solve for the value of
187 // cos_theta_c_cm (labeled cth below) for which the derivative of the
188 // differential cross section vanishes. This is an extremum of the function
189 // and might correspond to the maximum. If cth is within the allowed angular
190 // range, then it is considered alongside the two endpoints (COS_MIN and
191 // COS_MAX), and the largest of the three values (or just the endpoint values
192 // if cth is outside the allowed range) is chosen as the maximum.
193 double me2_over_s = md_*md_ / s;
194 double B = marley_utils::ONE_HALF * std::pow(g2_*(1. - me2_over_s), 2);
195 double A = g1_*g2_*me2_over_s + g2_*g2_*(1. - me2_over_s) - B;
196 double cth = -A / B;
197
198 // Set the differential cross section to a huge negative value
199 // at cth. This value will be compared to those at the angular
200 // endpoints if cth does not lie in the allowed range. Otherwise,
201 // the correct value will replace this one.
202 double dxs_at_cth = std::numeric_limits<double>::lowest();
203
204 double max = 0.;
205 if ( cth >= COS_MIN && cth <= COS_MAX ) {
206 dxs_at_cth = this->diff_xs(pdg_a, KEa, cth);
207 }
208
209 double dxs_at_min = this->diff_xs(pdg_a, KEa, COS_MIN);
210 double dxs_at_max = this->diff_xs(pdg_a, KEa, COS_MAX);
211
212 // Find the maximum value of the differential cross section
213 max = std::max( { dxs_at_min, dxs_at_max, dxs_at_cth } );
214
215 // Sample a CM frame scattering cosine for the ejectile.
216 double cos_theta_c_cm = gen.rejection_sample(
217 [this, pdg_a, KEa](double ctheta) -> double
218 { return this->diff_xs(pdg_a, KEa, ctheta); }, COS_MIN, COS_MAX, max);
219
220 // Sample a CM frame azimuthal scattering angle (phi) uniformly on [0, 2*pi).
221 // We can do this because the differential cross section is independent of
222 // the azimuthal angle.
223 double phi_c_cm = gen.uniform_random_double(0., marley_utils::two_pi, false);
224
225 MARLEY_LOG( DEBUG, "physics.reaction" ) << "ElectronReaction::create_event:"
226 " KEa = " << KEa << " MeV, sampled cos_theta_cm = " << cos_theta_c_cm
227 << ", phi_cm = " << phi_c_cm;
228
229 // Create and return the completed event object
230 return make_event_object( KEa, pc_cm, cos_theta_c_cm, phi_c_cm, Ec_cm, Ed_cm,
231 marley_hepmc3::NUHEPMC_FINAL_STATE_STATUS );
232}
virtual double diff_xs(int pdg_a, double KEa, double cos_theta_c_cm) const
double uniform_random_double(double min, double max, bool inclusive)
Sample a random number uniformly on either [min, max) or [min, max].
Definition Generator.cc:235
double rejection_sample(const std::function< double(double)> &f, double xmin, double xmax, double &fmax, double safety_factor=1.01, double max_search_tolerance=DEFAULT_REJECTION_SAMPLING_TOLERANCE_)
Sample from a given 1D probability density function f(x) on the interval [xmin, xmax] using a simple ...
Definition Generator.cc:281
void two_two_scatter(double KEa, double &s, double &Ec_cm, double &pc_cm, double &Ed_cm) const
Helper function that handles CM frame kinematics for the reaction.
Definition Reaction.cc:226
virtual std::shared_ptr< HepMC3::GenEvent > make_event_object(double KEa, double pc_cm, double cos_theta_c_cm, double phi_c_cm, double Ec_cm, double Ed_cm, int residue_status) const
Helper function that makes an event object.
Definition Reaction.cc:247

References diff_xs(), marley::Reaction::make_event_object(), marley::Reaction::md_, marley::Reaction::pdg_a(), marley::Reaction::pdg_a_, marley::Generator::rejection_sample(), marley::Reaction::two_two_scatter(), and marley::Generator::uniform_random_double().

◆ diff_xs()

double marley::ElectronReaction::diff_xs ( int pdg_a,
double KEa,
double cos_theta_c_cm ) const
virtual
Todo
Take into account effects of electron binding energy

Definition at line 127 of file ElectronReaction.cc.

129{
130 // If we're asked for the wrong projectile, then just return zero
131 if ( pdg_a != pdg_a_ ) return 0.;
132
133 // If we're below threshold, then just return zero
134 if ( KEa < KEa_threshold_ ) return 0.;
135
136 // If the kinetic energy is not positive, then just return zero
137 if ( KEa <= 0. ) return 0.;
138
139 // Mandelstam s (square of the total center of momentum frame energy)
140 double s = std::pow(ma_ + mb_, 2) + 2.*mb_*KEa;
141
142 // CM frame ejectile total energy
143 double Ec_cm = (s + mc_*mc_ - md_*md_) / ( 2. * std::sqrt(s) );
144
145 // Helper variables
146 double me2_over_s = md_*md_ / s;
147 double overall_factor = (2. / marley_utils::pi)
148 * std::pow(marley_utils::GF * Ec_cm, 2);
149 double terms = std::pow(g1_, 2) + g1_*g2_*me2_over_s*(cos_theta_c_cm - 1.)
150 + std::pow(g2_ * (1. + marley_utils::ONE_HALF*(1. - me2_over_s)
151 * (cos_theta_c_cm - 1.)), 2);
152
153 // Compute and return the cross section
154 double diff_xsec = overall_factor * terms;
155
156 // Multiply the single-electron cross section by the number of electrons
157 // present in this atom
159 diff_xsec *= atom_.Z();
160
161 return diff_xsec;
162}

References marley::Reaction::ma_, marley::Reaction::mb_, marley::Reaction::mc_, marley::Reaction::md_, marley::Reaction::pdg_a(), and marley::Reaction::pdg_a_.

Referenced by create_event().

◆ g1()

double marley::ElectronReaction::g1 ( ) const
inline

Definition at line 60 of file ElectronReaction.hh.

60{ return g1_; }

◆ g2()

double marley::ElectronReaction::g2 ( ) const
inline

Definition at line 61 of file ElectronReaction.hh.

61{ return g2_; }

◆ threshold_kinetic_energy()

virtual double marley::ElectronReaction::threshold_kinetic_energy ( ) const
inlineoverridevirtual

Get the minimum lab-frame kinetic energy (MeV) of the projectile that allows this reaction to proceed via a transition to the residue's ground state.

Implements marley::Reaction.

Definition at line 57 of file ElectronReaction.hh.

58 { return KEa_threshold_; }

◆ total_xs()

double marley::ElectronReaction::total_xs ( int pdg_a,
double KEa ) const
overridevirtual

Compute the reaction's total cross section (MeV -2)

Parameters
pdg_aProjectile's PDG code
KEaLab-frame kinetic energy of the incident projectile
Returns
Reaction total cross section (MeV -2)
Note
Functions that override total_xs() should always return zero if pdg_a != pdg_a_.
Todo
Take into account effects of electron binding energy

Implements marley::Reaction.

Definition at line 93 of file ElectronReaction.cc.

93 {
94
95 // If the cross section was requested for a different projectile,
96 // then just return zero.
97 if ( pdg_a != pdg_a_ ) return 0.;
98
99 // If we're below threshold, then just return zero
100 if ( KEa < KEa_threshold_ ) return 0.;
101
102 // If the kinetic energy is not positive, then just return zero
103 if ( KEa <= 0. ) return 0.;
104
105 // Mandelstam s (square of the total center of momentum frame energy)
106 double s = std::pow(ma_ + mb_, 2) + 2.*mb_*KEa;
107
108 // CM frame ejectile total energy
109 double Ec_cm = (s + mc_*mc_ - md_*md_) / ( 2. * std::sqrt(s) );
110
111 // Helper variables
112 double me2_over_s = md_*md_ / s;
113 double g2_squared_over_three = g2_*g2_ / 3.;
114
115 // Total cross section in natural units (MeV^(-2))
116 double xs = (4. / marley_utils::pi) * std::pow(marley_utils::GF * Ec_cm, 2)
117 * (std::pow(g1_, 2) + (g2_squared_over_three - g1_*g2_)*me2_over_s
118 + g2_squared_over_three*(1. + std::pow(me2_over_s, 2)));
119
120 // Multiply the single-electron cross section by the number of electrons
121 // present in this atom
123 xs *= atom_.Z();
124 return xs;
125}

References marley::Reaction::ma_, marley::Reaction::mb_, marley::Reaction::mc_, marley::Reaction::md_, marley::Reaction::pdg_a(), and marley::Reaction::pdg_a_.


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