MARLEY (Model of Argon Reaction Low Energy Yields)  v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Public Member Functions | Static Public Member Functions | List of all members
marley::Level Class Reference

A discrete nuclear energy level. More...

#include <Level.hh>

Public Member Functions

 Level (double E, int twoJ, marley::Parity pi)
 
marley::Gammaadd_gamma (const marley::Gamma &gamma)
 Add a new gamma-ray transition to this level. More...
 
marley::Gammaadd_gamma (double energy, double branching_ratio, marley::Level *end_lev=nullptr)
 Add a new gamma-ray transition to this level. More...
 
void clear_gammas ()
 Remove all gamma ray information from this level.
 
double energy () const
 Get the excitation energy of this level (MeV)
 
std::vector< marley::Gamma > & gammas ()
 Retrieve a reference to the vector of gamma rays owned by this level.
 
const std::vector< marley::Gamma > & gammas () const
 Retrieve a const reference to the vector of gamma rays owned by this level.
 
bool has_gammas () const
 
marley::Parity parity () const
 Get the level parity.
 
const marley::Gammasample_gamma (marley::Generator &gen)
 Choose a gamma owned by this level randomly based on the relative intensities of all of the gammas. More...
 
void set_energy (double E)
 Set the excitation energy of this level (MeV)
 
void set_parity (marley::Parity pi)
 Set the level parity.
 
void set_twoJ (int twoJ)
 Set two times the level spin.
 
std::string spin_parity_string () const
 Returns the level spin-parity as a string.
 
int twoJ () const
 Get two times the level spin.
 

Static Public Member Functions

template<typename It >
static marley::IteratorToPointerMember< It, double > make_energy_iterator (It it)
 Convert an iterator that points to a marley::Level* (or a smart pointer to a marley::Level) into an iterator that points to the Level's energy_ member variable. More...
 

Detailed Description

A discrete nuclear energy level.

Constructor & Destructor Documentation

◆ Level()

marley::Level::Level ( double  E,
int  twoJ,
marley::Parity  pi 
)
Parameters
Eexcitation energy of this level (MeV)
twoJtwo times the level spin
pilevel parity

Member Function Documentation

◆ add_gamma() [1/2]

marley::Gamma & marley::Level::add_gamma ( const marley::Gamma gamma)

Add a new gamma-ray transition to this level.

Returns
a reference to the newly added gamma

◆ add_gamma() [2/2]

marley::Gamma & marley::Level::add_gamma ( double  energy,
double  branching_ratio,
marley::Level end_lev = nullptr 
)

Add a new gamma-ray transition to this level.

Parameters
energyGamma-ray energy (MeV)
branching_ratioBranching ratio for the new gamma-ray transition
end_levPointer to the level that absorbs this gamma
Returns
a reference to the newly added gamma

◆ has_gammas()

bool marley::Level::has_gammas ( ) const
inline
Returns
true if the level owns at least one Gamma object

◆ make_energy_iterator()

template<typename It >
marley::IteratorToPointerMember< It, double > marley::Level::make_energy_iterator ( It  it)
inlinestatic

Convert an iterator that points to a marley::Level* (or a smart pointer to a marley::Level) into an iterator that points to the Level's energy_ member variable.

This function is used by the DecayScheme class to keep the vector of std::unique_ptr<marley::Level> objects that it owns sorted in order of increasing excitation energy.

◆ sample_gamma()

const marley::Gamma * marley::Level::sample_gamma ( marley::Generator gen)

Choose a gamma owned by this level randomly based on the relative intensities of all of the gammas.

Returns
a pointer to the selected Gamma object, or nullptr if the level doesn't have any gammas

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