MARLEY (Model of Argon Reaction Low Energy Yields)  v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
MatrixElement.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 
19 #include "marley/Level.hh"
20 
21 namespace marley {
22 
25  class MatrixElement {
26 
27  public:
28 
32  FERMI = 0,
51 
52  GAMOW_TELLER = 1
64  };
65 
74  type, marley::Level* final_level = nullptr)
76  final_level_(final_level) {}
77 
80  inline double level_energy() const {
81  // If this matrix element accesses a discrete final nuclear level,
82  // then return that level's excitation energy
83  if ( final_level_ ) return final_level_->energy();
84  // Otherwise, we're in the ubound continuum, and we can just
85  // use the tabulated value from the reaction matrix element data file
86  else return level_energy_;
87  }
88 
103  inline double tabulated_level_energy() const { return level_energy_; }
104 
106  inline double strength() const { return strength_; }
107 
110  inline TransitionType type() const { return type_; }
111 
115  inline const marley::Level* level() const { return final_level_; }
116 
120  inline marley::Level* level() { return final_level_; }
121 
124  inline void set_level_energy(double energy) { level_energy_ = energy; }
125 
127  inline void set_strength(double strength) { strength_ = strength; }
128 
131  inline void set_type(TransitionType type) { type_ = type; }
132 
135  inline void set_level(marley::Level* lev) { final_level_ = lev; }
136 
141  inline double cos_theta_pdf(double cos_theta_c_cm, double beta_c_cm) const
142  {
143  double pdf = 0.;
144  if ( type_ == TransitionType::FERMI ) {
145  pdf = 1. + beta_c_cm * cos_theta_c_cm;
146  }
147  else if ( type_ == TransitionType::GAMOW_TELLER ) {
148  pdf = (3. - beta_c_cm * cos_theta_c_cm) / 3.;
149  }
150  else throw marley::Error("Unrecognized transition type encountered"
151  " in marley::MatrixElement::cos_theta_pdf()");
152 
153  // Normalize to unit integral
154  pdf *= 0.5;
155  return pdf;
156  }
157 
160  inline std::string type_str() const {
161  if ( type_ == TransitionType::FERMI ) return "Fermi";
162  else if ( type_ == TransitionType::GAMOW_TELLER ) return "Gamow-Teller";
163  else throw marley::Error( "Unrecognized transition type encountered"
164  " in marley::MatrixElement::type_str()" );
165  }
166 
167  protected:
168 
172 
174  double strength_;
175 
179 
183  };
184 }
Base class for all exceptions thrown by MARLEY functions.
Definition: Error.hh:32
A discrete nuclear energy level.
Definition: Level.hh:29
double energy() const
Get the excitation energy of this level (MeV)
Definition: Level.hh:120
A reduced nuclear matrix element that represents a transition caused by a neutrino-nucleus reaction.
Definition: MatrixElement.hh:25
double tabulated_level_energy() const
Get the excitation energy (MeV) listed for this level in the reaction matrix element data file.
Definition: MatrixElement.hh:103
TransitionType type() const
Get the kind of nuclear transition (e.g., Fermi, Gamow-Teller) represented by the matrix element.
Definition: MatrixElement.hh:110
double strength_
Numerical value of the matrix element (dimensionless)
Definition: MatrixElement.hh:174
void set_level_energy(double energy)
Set the excitation energy (MeV) of the final-state nuclear level accessed by the matrix element.
Definition: MatrixElement.hh:124
double level_energy_
Energy (MeV) of the final-state nuclear level accessed by this matrix element.
Definition: MatrixElement.hh:171
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 ...
Definition: MatrixElement.hh:115
std::string type_str() const
Returns a string representation of the transition type for this matrix element.
Definition: MatrixElement.hh:160
void set_type(TransitionType type)
Set the kind of nuclear transition (e.g., Fermi, Gamow-Teller) represented by the matrix element.
Definition: MatrixElement.hh:131
double strength() const
Get the numerical value (dimensionless) of the matrix element.
Definition: MatrixElement.hh:106
double level_energy() const
Get the excitation energy (MeV) of the final-state nuclear level accessed by the matrix element.
Definition: MatrixElement.hh:80
void set_level(marley::Level *lev)
Set the pointer to the final nuclear Level object accessed by the matrix element.
Definition: MatrixElement.hh:135
TransitionType
Enumerated type that represents the possible kinds of nuclear transitions recognized by MARLEY.
Definition: MatrixElement.hh:31
@ GAMOW_TELLER
Definition: MatrixElement.hh:52
@ FERMI
Definition: MatrixElement.hh:32
void set_strength(double strength)
Set the numerical value (dimensionless) of the matrix element.
Definition: MatrixElement.hh:127
marley::Level * final_level_
Pointer to the final Level object for a transition to a discrete nuclear level, or nullptr for an unb...
Definition: MatrixElement.hh:182
MatrixElement(double level_energy, double strength, TransitionType type, marley::Level *final_level=nullptr)
Definition: MatrixElement.hh:73
marley::Level * level()
Get a pointer to the final-state nuclear Level accessed by the matrix element, or nullptr if it is a ...
Definition: MatrixElement.hh:120
TransitionType type_
The kind of transition represented by this matrix element (Fermi, Gamow-Teller, etc....
Definition: MatrixElement.hh:178
double cos_theta_pdf(double cos_theta_c_cm, double beta_c_cm) const
Compute the PDF for the CM frame scattering cosine.
Definition: MatrixElement.hh:141