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
NuclearReaction.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#include <cmath>
18
19#include "HepMC3/Attribute.h"
20#include "HepMC3/GenEvent.h"
21#include "HepMC3/GenParticle.h"
22#include "marley/hepmc3_utils.hh"
23#include "marley/marley_utils.hh"
24#include "marley/Error.hh"
25#include "marley/Generator.hh"
26#include "marley/Level.hh"
27#include "marley/Logger.hh"
28#include "marley/MatrixElement.hh"
29#include "marley/NucleusDecayer.hh"
30#include "marley/Parity.hh"
31#include "marley/Reaction.hh"
32
33using ProcType = marley::Reaction::ProcessType;
34
36 int pdg_c, int pdg_d, int q_d, const std::string& source_file )
37 : Reaction( source_file ), q_d_( q_d )
38{
39 // Initialize the process type (NC, neutrino/antineutrino CC)
40 process_type_ = pt;
41
42 // Initialize the PDG codes for the 2->2 scatter particles
43 pdg_a_ = pdg_a;
44 pdg_b_ = pdg_b;
45 pdg_c_ = pdg_c;
46 pdg_d_ = pdg_d;
47
48 // Get initial and final values of the nuclear charge and mass number from
49 // the PDG codes
50 Zi_ = (pdg_b_ % 10000000) / 10000;
51 Ai_ = (pdg_b_ % 10000) / 10;
52 Zf_ = (pdg_d_ % 10000000) / 10000;
53 Af_ = (pdg_d_ % 10000) / 10;
54
56
57 // Get the particle masses from the mass table
60
61 // If the target (particle b) or residue (particle d)
62 // has a particle ID greater than 10^9, assume that it
63 // is an atom rather than a bare nucleus
64 if ( pdg_b_ > 1000000000 ) mb_ = mt.get_atomic_mass( pdg_b_ );
65 else mb_ = mt.get_particle_mass( pdg_b_ );
66
67 if ( pdg_d_ > 1000000000 ) {
68 // If particle d is an atom and is ionized as a result of this reaction
69 // (e.g., q_d_ != 0), then approximate its ground-state ionized mass by
70 // subtracting the appropriate number of electron masses from its atomic
71 // (i.e., neutral) ground state mass.
73 - ( q_d_ * mt.get_particle_mass(marley_utils::ELECTRON) );
74 }
75 else {
77 }
78
79 KEa_threshold_ = ( std::pow(mc_ + md_gs_, 2)
80 - std::pow(ma_ + mb_, 2) ) / ( 2.*mb_ );
81
82 this->set_description();
83}
84
85// Return the maximum residue excitation energy E_level that can
86// be achieved in the lab frame for a given projectile kinetic energy KEa
87// (this corresponds to the final particles all being produced
88// at rest in the CM frame). This maximum level energy is used
89// to find the allowed levels when creating events.
91 // Calculate the total CM frame energy using known quantities
92 // from the lab frame
93 double E_CM = std::sqrt( std::pow(ma_ + mb_, 2) + 2*mb_*KEa );
94 // The maximum level energy is achieved when the final state
95 // particles are produced at rest in the CM frame. Subtracting
96 // the ground-state rest masses of particles c and d from the
97 // total CM energy leaves us with the energy available to create
98 // an excited level in the residue (particle d).
99 return E_CM - mc_ - md_gs_;
100}
101
105
106// Factor that appears in the cross section for coherent elastic
107// neutrino-nucleus scattering (CEvNS), which corresponds to the Fermi
108// component of NC scattering under the allowed approximation
110{
111 int Ni = Ai_ - Zi_;
112 double Qw = Ni - ( 1. - 4.*marley_utils::sin2thetaw )*Zi_;
113 return Qw;
114}
115
116// Sets the description_ string based on the member PDG codes
118 description_ = marley_utils::get_particle_symbol( pdg_a_ ) + " + ";
119 description_ += std::to_string( Ai_ );
120 description_ += marley_utils::element_symbols.at( Zi_ ) + " --> ";
121 description_ += marley_utils::get_particle_symbol( pdg_c_ ) + " + ";
122 description_ += std::to_string( Af_ );
123 description_ += marley_utils::element_symbols.at( Zf_ );
124}
125
127 std::shared_ptr< HepMC3::GenEvent >& event ) const
128{
129 // Assume that the target is a neutral atom (q_b = 0)
130 auto target = marley_hepmc3::get_target( *event );
131 marley_hepmc3::set_particle_charge( *target, 0 );
132
133 // Assign the correct charge to the residue
134 auto residue = marley_hepmc3::get_residue( *event );
135 marley_hepmc3::set_particle_charge( *residue, q_d_ );
136}
137
139 const std::shared_ptr< HepMC3::GenParticle >& residue,
140 double E_level, int twoJ, const marley::Parity& P ) const
141{
142 // Add attributes needed to keep track of the nuclear de-excitation state
143 residue->add_attribute( "Ex",
144 std::make_shared< HepMC3::DoubleAttribute >(E_level) );
145 residue->add_attribute( "twoJ",
146 std::make_shared< HepMC3::IntAttribute >(twoJ) );
147 residue->add_attribute( "parity",
148 std::make_shared< HepMC3::IntAttribute >(static_cast<int>( P )) );
149}
150
151std::shared_ptr< HepMC3::GenEvent >
153 double KEa, double pc_cm, double cos_theta_c_cm, double phi_c_cm,
154 double Ec_cm, double Ed_cm, double E_level, int twoJ,
155 const marley::Parity& P ) const
156{
157 // Create the event skeleton, marking the residue as an undecayed
158 // intermediate state (it will be allowed to decay later if nuclear
159 // de-excitation is enabled)
160 auto event = marley::Reaction::make_event_object( KEa, pc_cm,
161 cos_theta_c_cm, phi_c_cm, Ec_cm, Ed_cm,
162 marley_hepmc3::NUHEPMC_UNDECAYED_RESIDUE_STATUS );
163
164 // Attach the charge attributes for the target and residue
165 this->set_charge_attributes( event );
166
167 // Add the nuclear level attributes needed to keep track of the residue's
168 // de-excitation state
169 auto residue = marley_hepmc3::get_residue( *event );
170 this->set_nuclear_residue_attributes( residue, E_level, twoJ, P );
171
172 return event;
173}
174
175std::shared_ptr< HepMC3::GenEvent >
177 double KEa, const std::shared_ptr< HepMC3::GenParticle >& ejectile,
178 const std::shared_ptr< HepMC3::GenParticle >& residue,
179 double E_level, int twoJ, const marley::Parity& P ) const
180{
181 // Create the event skeleton from the pre-made final-state particles
182 auto event = marley::Reaction::make_event_object( KEa, ejectile, residue );
183
184 // Attach the charge attributes for the target and residue
185 this->set_charge_attributes( event );
186
187 // Add the nuclear level attributes needed to keep track of the residue's
188 // de-excitation state
189 this->set_nuclear_residue_attributes( residue, E_level, twoJ, P );
190
191 return event;
192}
bool add_attribute(const std::string &name, std::shared_ptr< Attribute > att)
Add an attribute to this particle.
Singleton lookup table for particle and atomic masses.
Definition MassTable.hh:30
static const MassTable & Instance()
Get a const reference to the singleton instance of the MassTable.
Definition MassTable.cc:69
double get_atomic_mass(int pdg_code, bool theory_ok=true) const
Get the mass of an atom.
Definition MassTable.cc:95
double get_particle_mass(int pdg_code) const
Get the mass of a particle.
Definition MassTable.cc:84
int Ai_
Target mass number.
double weak_nuclear_charge() const
void set_nuclear_residue_attributes(const std::shared_ptr< HepMC3::GenParticle > &residue, double E_level, int twoJ, const marley::Parity &P) const
Helper function that adds the nuclear level attributes ( , , and parity) needed to keep track of the ...
double threshold_kinetic_energy() const override
Get the minimum lab-frame kinetic energy (MeV) of the projectile that allows this reaction to proceed...
virtual std::shared_ptr< HepMC3::GenEvent > make_nuclear_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
Helper function that makes a complete event object for a nuclear reaction.
virtual void set_description()
Creates the description string based on the PDG code values for the initial and final particles.
double max_level_energy(double KEa) const
Get the maximum possible excitation energy (MeV) of the final-state residue that is kinematically all...
int q_d_
Net charge of the residue (in units of the proton charge) following this reaction.
NuclearReaction(ProcessType pt, int pdg_a, int pdg_b, int pdg_c, int pdg_d, int q_d, const std::string &source_file)
int Zi_
Target atomic number.
int Af_
Residue mass number.
double KEa_threshold_
Lab-frame kinetic energy of the projectile at threshold for this reaction (i.e., the residue is produ...
int Zf_
Residue atomic number.
double md_gs_
Ground state mass (MeV) of the residue.
void set_charge_attributes(std::shared_ptr< HepMC3::GenEvent > &event) const
Helper function that sets the charges of the target and residue in an otherwise complete event record...
Type-safe representation of a parity value (either +1 or -1)
Definition Parity.hh:25
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
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
ProcessType
Enumerated type describing the kind of scattering process represented by a Reaction.
Definition Reaction.hh:58
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
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
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
int pdg_b() const
Get the target PDG code.
Definition Reaction.hh:112
double mb_
Target mass (MeV)
Definition Reaction.hh:148