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
MatrixElement.hh
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#pragma once
18
19#include "marley/Error.hh"
20#include "marley/Level.hh"
21
22namespace marley {
23
27
28 public:
29
33 FERMI = 0,
52
65 };
66
78 type, double err_low, double err_high,
79 marley::Level* final_level = nullptr)
81 strength_err_low_(err_low), strength_err_high_(err_high),
82 type_(type), final_level_(final_level) {}
83
87 type, marley::Level* final_level = nullptr)
88 : MatrixElement(level_energy, strength, type, 0., 0., final_level) {}
89
92 inline double level_energy() const {
93 // If this matrix element accesses a discrete final nuclear level,
94 // then return that level's excitation energy
95 if ( final_level_ ) return final_level_->energy();
96 // Otherwise, we're in the ubound continuum, and we can just
97 // use the tabulated value from the reaction matrix element data file
98 else return level_energy_;
99 }
100
115 inline double tabulated_level_energy() const { return level_energy_; }
116
118 inline double strength() const { return strength_; }
119
121 inline double strength_err_low() const { return strength_err_low_; }
122
124 inline double strength_err_high() const { return strength_err_high_; }
125
128 inline TransitionType type() const { return type_; }
129
133 inline const marley::Level* level() const { return final_level_; }
134
138 inline marley::Level* level() { return final_level_; }
139
142 inline void set_level_energy(double energy) { level_energy_ = energy; }
143
145 inline void set_strength(double strength) { strength_ = strength; }
146
150
153 inline void set_level(marley::Level* lev) { final_level_ = lev; }
154
159 inline double cos_theta_pdf(double cos_theta_c_cm, double beta_c_cm) const
160 {
161 double pdf = 0.;
162 if ( type_ == TransitionType::FERMI ) {
163 pdf = 1. + beta_c_cm * cos_theta_c_cm;
164 }
165 else if ( type_ == TransitionType::GAMOW_TELLER ) {
166 pdf = (3. - beta_c_cm * cos_theta_c_cm) / 3.;
167 }
168 else throw marley::Error("Unrecognized transition type encountered"
169 " in marley::MatrixElement::cos_theta_pdf()");
170
171 // Normalize to unit integral
172 pdf *= 0.5;
173 return pdf;
174 }
175
178 inline std::string type_str() const {
179 if ( type_ == TransitionType::FERMI ) return "Fermi";
180 else if ( type_ == TransitionType::GAMOW_TELLER ) return "Gamow-Teller";
181 else throw marley::Error( "Unrecognized transition type encountered"
182 " in marley::MatrixElement::type_str()" );
183 }
184
185 protected:
186
190
192 double strength_;
193
196 double strength_err_low_ = 0.;
197
201
205
209 };
210}
Base class for all exceptions thrown by MARLEY functions.
Definition Error.hh:26
A discrete nuclear energy level.
Definition Level.hh:29
double tabulated_level_energy() const
Get the excitation energy (MeV) listed for this level in the reaction matrix element data file.
TransitionType type() const
Get the kind of nuclear transition (e.g., Fermi, Gamow-Teller) represented by the matrix element.
double strength_
Numerical value of the matrix element (dimensionless)
void set_level_energy(double energy)
Set the excitation energy (MeV) of the final-state nuclear level accessed by the matrix element.
double level_energy_
Energy (MeV) of the final-state nuclear level accessed by this matrix element.
std::string type_str() const
Returns a string representation of the transition type for this matrix element.
void set_type(TransitionType type)
Set the kind of nuclear transition (e.g., Fermi, Gamow-Teller) represented by the matrix element.
double strength() const
Get the numerical value (dimensionless) of the matrix element.
MatrixElement(double level_energy, double strength, TransitionType type, double err_low, double err_high, marley::Level *final_level=nullptr)
double level_energy() const
Get the excitation energy (MeV) of the final-state nuclear level accessed by the matrix element.
void set_level(marley::Level *lev)
Set the pointer to the final nuclear Level object accessed by the matrix element.
TransitionType
Enumerated type that represents the possible kinds of nuclear transitions recognized by MARLEY.
void set_strength(double strength)
Set the numerical value (dimensionless) of the matrix element.
double strength_err_high() const
Get the upper uncertainty on the matrix element strength.
marley::Level * final_level_
Pointer to the final Level object for a transition to a discrete nuclear level, or nullptr for an unb...
MatrixElement(double level_energy, double strength, TransitionType type, marley::Level *final_level=nullptr)
Construct a MatrixElement without uncertainty information (errors default to zero)
double strength_err_high_
Upper uncertainty on the matrix element strength (zero if not specified)
double strength_err_low_
Lower uncertainty on the matrix element strength (zero if not specified)
TransitionType type_
The kind of transition represented by this matrix element (Fermi, Gamow-Teller, etc....
marley::Level * level()
Get a pointer to the final-state nuclear Level accessed by the matrix element, or nullptr if it is a ...
double cos_theta_pdf(double cos_theta_c_cm, double beta_c_cm) const
Compute the PDF for the CM frame scattering cosine.
double strength_err_low() const
Get the lower uncertainty on the matrix element strength.
const marley::Level * level() const
Get a pointer to the final-state nuclear Level accessed by the matrix element, or nullptr if it is a ...