MARLEY (Model of Argon Reaction Low Energy Yields)  v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
NuclearReaction.hh
1 //
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 #pragma once
18 #include <functional>
19 #include <map>
20 #include <memory>
21 #include <regex>
22 #include <string>
23 #include <vector>
24 
25 #include "marley/DecayScheme.hh"
26 #include "marley/Event.hh"
27 #include "marley/Level.hh"
28 #include "marley/MassTable.hh"
29 #include "marley/MatrixElement.hh"
30 #include "marley/Reaction.hh"
31 #include "marley/StructureDatabase.hh"
32 
33 namespace marley {
34 
35  class Generator;
36 
39 
40  public:
41 
51  NuclearReaction(ProcessType pt, int pdg_a, int pdg_b, int pdg_c,
52  int pdg_d, int q_d,
53  const std::shared_ptr<std::vector<marley::MatrixElement> >& mat_els);
54 
57  enum class CoulombMode { NO_CORRECTION, FERMI_FUNCTION, EMA, MEMA,
58  FERMI_AND_EMA, FERMI_AND_MEMA };
59 
60  inline virtual marley::TargetAtom atomic_target() const override final
61  { return marley::TargetAtom( pdg_b_ ); }
62 
64  virtual marley::Event create_event(int particle_id_a,
65  double KEa, marley::Generator& gen) const override;
66 
73  double fermi_function(double beta_c) const;
74 
78  double max_level_energy(double KEa) const;
79 
83 
87  double threshold_kinetic_energy() const override;
88 
95  virtual double total_xs(int pdg_a, double KEa) const override;
96 
106  double diff_xs(const marley::MatrixElement& mat_el, double KEa,
107  double cos_theta_c_cm) const;
108 
117  virtual double diff_xs(int pdg_a, double KEa,
118  double cos_theta_c_cm) const override;
119 
131  virtual double total_xs(const marley::MatrixElement& me, double KEa,
132  double& beta_c_cm, bool check_max_E_level = true) const;
133 
138  double coulomb_correction_factor(double beta_rel_cd) const;
139 
148  double ema_factor(double beta_rel_cd, bool& ok, bool modified_ema) const;
149 
155  double weak_nuclear_charge() const;
156 
158  inline const std::vector<marley::MatrixElement>& matrix_elements() const
159  { return *matrix_elements_; }
160 
163  inline CoulombMode coulomb_mode() const
164  { return coulomb_mode_; }
165 
167  inline void set_coulomb_mode( CoulombMode mode )
168  { coulomb_mode_ = mode; }
169 
171  static CoulombMode coulomb_mode_from_string( const std::string& str );
172 
174  static std::string string_from_coulomb_mode( CoulombMode mode );
175 
176  protected:
177 
180  static std::map<CoulombMode, std::string> coulomb_mode_string_map_;
181 
183  virtual marley::Event make_event_object(double KEa,
184  double pc_cm, double cos_theta_c_cm, double phi_c_cm, double Ec_cm,
185  double Ed_cm, double E_level, int twoJ, const marley::Parity& P)
186  const override;
187 
196  double sample_cos_theta_c_cm(const marley::MatrixElement& matrix_el,
197  double beta_c_cm, marley::Generator& gen) const;
198 
214  double summed_xs_helper(int pdg_a, double KEa, double cos_theta_c_cm,
215  std::vector<double>* level_xsecs, bool differential) const;
216 
219  void set_description();
220 
221  double md_gs_;
222 
223  int Zi_;
224  int Ai_;
225  int Zf_;
226  int Af_;
227 
230  int q_d_;
231 
236 
239  CoulombMode coulomb_mode_ = CoulombMode::FERMI_AND_MEMA;
240 
243  std::shared_ptr< std::vector<marley::MatrixElement> > matrix_elements_;
244  };
245 
246 }
Discrete level and γ-ray data for a specific nuclide.
Definition: DecayScheme.hh:30
Container for ingoing and outgoing momentum 4-vectors from a reaction.
Definition: Event.hh:66
The MARLEY Event generator.
Definition: Generator.hh:42
A reduced nuclear matrix element that represents a transition caused by a neutrino-nucleus reaction.
Definition: MatrixElement.hh:25
A neutrino-nucleus reaction.
Definition: NuclearReaction.hh:38
double coulomb_correction_factor(double beta_rel_cd) const
Definition: NuclearReaction.cc:592
int Ai_
Target mass number.
Definition: NuclearReaction.hh:224
double sample_cos_theta_c_cm(const marley::MatrixElement &matrix_el, double beta_c_cm, marley::Generator &gen) const
Samples a polar angle cosine for the ejectile using the relevant portion of the reaction nuclear matr...
Definition: NuclearReaction.cc:548
static std::string string_from_coulomb_mode(CoulombMode mode)
Convert a CoulombMode value to a string.
Definition: NuclearReaction.cc:749
double summed_xs_helper(int pdg_a, double KEa, double cos_theta_c_cm, std::vector< double > *level_xsecs, bool differential) const
Definition: NuclearReaction.cc:399
double weak_nuclear_charge() const
Definition: NuclearReaction.cc:711
double diff_xs(const marley::MatrixElement &mat_el, double KEa, double cos_theta_c_cm) const
Differential cross section (MeV -2) evaluated in the center-of-momentum frame for a transition to a ...
Definition: NuclearReaction.cc:387
double threshold_kinetic_energy() const override
Get the minimum lab-frame kinetic energy (MeV) of the projectile that allows this reaction to proceed...
Definition: NuclearReaction.cc:169
CoulombMode coulomb_mode() const
Definition: NuclearReaction.hh:163
void set_description()
Creates the description string based on the PDG code values for the initial and final particles.
Definition: NuclearReaction.cc:719
virtual marley::Event make_event_object(double KEa, double pc_cm, double cos_theta_c_cm, double phi_c_cm, double Ec_cm, double Ed_cm, double E_level, int twoJ, const marley::Parity &P) const override
Helper function used by NuclearReaction::create_event()
Definition: NuclearReaction.cc:576
double max_level_energy(double KEa) const
Get the maximum possible excitation energy (MeV) of the final-state residue that is kinematically all...
Definition: NuclearReaction.cc:157
static CoulombMode coulomb_mode_from_string(const std::string &str)
Convert a string to a CoulombMode value.
Definition: NuclearReaction.cc:738
NuclearReaction(ProcessType pt, int pdg_a, int pdg_b, int pdg_c, int pdg_d, int q_d, const std::shared_ptr< std::vector< marley::MatrixElement > > &mat_els)
Definition: NuclearReaction.cc:65
void set_decay_scheme(marley::DecayScheme *scheme)
Sets the DecayScheme object to use for sampling excited levels in the residue.
virtual marley::Event create_event(int particle_id_a, double KEa, marley::Generator &gen) const override
Produces a two-two scattering Event that proceeds via this reaction.
Definition: NuclearReaction.cc:175
int q_d_
Net charge of the residue (in units of the proton charge) following this reaction.
Definition: NuclearReaction.hh:230
virtual double total_xs(int pdg_a, double KEa) const override
Total reaction cross section (MeV -2), including all kinematically-allowed final nuclear levels.
Definition: NuclearReaction.cc:370
void set_coulomb_mode(CoulombMode mode)
Set the method for handling Coulomb corrections for this reaction.
Definition: NuclearReaction.hh:167
double ema_factor(double beta_rel_cd, bool &ok, bool modified_ema) const
Definition: NuclearReaction.cc:650
int Zi_
Target atomic number.
Definition: NuclearReaction.hh:223
virtual marley::TargetAtom atomic_target() const override final
Returns the target atom involved in this reaction.
Definition: NuclearReaction.hh:60
int Af_
Residue mass number.
Definition: NuclearReaction.hh:226
double KEa_threshold_
Lab-frame kinetic energy of the projectile at threshold for this reaction (i.e., the residue is produ...
Definition: NuclearReaction.hh:235
CoulombMode
Enumerated type used to set the method for handling Coulomb corrections for CC nuclear reactions.
Definition: NuclearReaction.hh:57
double fermi_function(double beta_c) const
Compute the Fermi function
Definition: NuclearReaction.cc:122
int Zf_
Residue atomic number.
Definition: NuclearReaction.hh:225
double md_gs_
Ground state mass (MeV) of the residue.
Definition: NuclearReaction.hh:221
static std::map< CoulombMode, std::string > coulomb_mode_string_map_
Definition: NuclearReaction.hh:180
const std::vector< marley::MatrixElement > & matrix_elements() const
Allows access to the owned vector of MatrixElement objects.
Definition: NuclearReaction.hh:158
std::shared_ptr< std::vector< marley::MatrixElement > > matrix_elements_
Matrix elements representing all of the possible nuclear transitions that may be caused by this react...
Definition: NuclearReaction.hh:243
CoulombMode coulomb_mode_
The method to use when computing Coulomb corrections (if needed) for this reaction.
Definition: NuclearReaction.hh:239
Type-safe representation of a parity value (either +1 or -1)
Definition: Parity.hh:25
Abstract base class that represents a two-two scattering reaction.
Definition: Reaction.hh:38
ProcessType
Enumerated type describing the kind of scattering process represented by a Reaction.
Definition: Reaction.hh:46
int pdg_a() const
Get the projectile PDG code.
Definition: Reaction.hh:90
int pdg_b_
PDG code for the target.
Definition: Reaction.hh:119
int pdg_b() const
Get the target PDG code.
Definition: Reaction.hh:93
An atomic target for a lepton scattering reaction.
Definition: TargetAtom.hh:26