A discrete nuclear energy level.
More...
#include <Level.hh>
A discrete nuclear energy level.
Definition at line 29 of file Level.hh.
◆ Level()
| marley::Level::Level |
( |
double | E, |
|
|
int | twoJ, |
|
|
marley::Parity | pi, |
|
|
double | half_life ) |
- Parameters
-
| E | excitation energy of this level (MeV) |
| twoJ | two times the level spin |
| pi | level parity |
| half_life | half-life of the level (s) |
Definition at line 26 of file Level.cc.
27 : energy_( E ), twoJ_(
twoJ ), parity_( pi ), half_life_(
half_life )
28{}
double half_life() const
Get the level half-life (s)
int twoJ() const
Get two times the level spin.
References half_life(), and twoJ().
◆ add_gamma() [1/2]
Add a new gamma-ray transition to this level.
- Returns
- a reference to the newly added gamma
Definition at line 55 of file Level.cc.
55 {
56
57 gammas_.push_back( gamma );
58
59
60 update_gamma_distribution();
61
62
63 return gammas_.back();
64}
Referenced by marley::DecayScheme::read_from_stream().
◆ add_gamma() [2/2]
Add a new gamma-ray transition to this level.
- Parameters
-
| energy | Gamma-ray energy (MeV) |
| branching_ratio | Branching ratio for the new gamma-ray transition |
| end_lev | Pointer to the level that absorbs this gamma |
- Returns
- a reference to the newly added gamma
Definition at line 66 of file Level.cc.
68{
69
70 gammas_.emplace_back(
energy, branching_ratio,
this, end_lev );
71
72
73 update_gamma_distribution();
74
75
76 return gammas_.back();
77}
double energy() const
Get the excitation energy of this level (MeV)
References energy().
◆ clear_gammas()
| void marley::Level::clear_gammas |
( |
| ) |
|
Remove all gamma ray information from this level.
Definition at line 79 of file Level.cc.
79 {
80 gammas_.clear();
81
82
83
84 update_gamma_distribution();
85}
◆ energy()
| double marley::Level::energy |
( |
| ) |
const |
|
inline |
◆ gammas() [1/2]
Retrieve a reference to the vector of gamma rays owned by this level.
Definition at line 150 of file Level.hh.
◆ gammas() [2/2]
| const std::vector< marley::Gamma > & marley::Level::gammas |
( |
| ) |
const |
|
inline |
Retrieve a const reference to the vector of gamma rays owned by this level.
Definition at line 148 of file Level.hh.
◆ half_life()
| double marley::Level::half_life |
( |
| ) |
const |
|
inline |
◆ has_gammas()
| bool marley::Level::has_gammas |
( |
| ) |
const |
|
inline |
- Returns
- true if the level owns at least one Gamma object
Definition at line 152 of file Level.hh.
152{ return !gammas_.empty(); }
◆ make_energy_iterator()
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.
Definition at line 155 of file Level.hh.
156 {
157 return marley::IteratorToPointerMember< It, double >( it,
158 &marley::Level::energy_ );
159 }
Referenced by marley::DecayScheme::level_lower_bound_index().
◆ parity()
◆ sample_gamma()
Choose a gamma owned by this level randomly based on the relative intensities of all of the gammas.
- Parameters
-
| gen | Reference to the Generator object to use for random sampling |
| [out] | prob_ptr | Optional double* that, if not nullptr, will be used to store the probability of choosing the sampled gamma |
- Returns
- a pointer to the selected Gamma object, or nullptr if the level doesn't have any gammas
Definition at line 30 of file Level.cc.
32{
33
34 if ( prob_ptr ) *prob_ptr = 0.;
35
36 if ( gammas_.empty() ) return nullptr;
37 else {
38
39
40
42
43
44
45 if ( prob_ptr ) {
46 std::vector< double > probs = gamma_dist_.probabilities();
47 *prob_ptr = probs.at( g_index );
48 }
49
50
51 return &( gammas_[ g_index ] );
52 }
53}
auto sample_from_distribution(RandomNumberDistribution &rnd) -> decltype(std::declval< RandomNumberDistribution & >().operator()(std::declval< std::mt19937_64 & >()))
Sample from an arbitrary probability distribution (defined here as any object that implements an oper...
References marley::Generator::sample_from_distribution().
Referenced by marley::DecayScheme::do_cascade().
◆ set_energy()
| void marley::Level::set_energy |
( |
double | E | ) |
|
|
inline |
Set the excitation energy of this level (MeV)
Definition at line 136 of file Level.hh.
◆ set_half_life()
| void marley::Level::set_half_life |
( |
double | half_life | ) |
|
|
inline |
◆ set_parity()
Set the level parity.
Definition at line 142 of file Level.hh.
◆ set_twoJ()
| void marley::Level::set_twoJ |
( |
int | twoJ | ) |
|
|
inline |
Set two times the level spin.
Definition at line 139 of file Level.hh.
References twoJ().
◆ spin_parity_string()
| std::string marley::Level::spin_parity_string |
( |
| ) |
const |
Returns the level spin-parity as a string.
Definition at line 87 of file Level.cc.
87 {
88 std::string str = std::to_string( twoJ_ / 2 );
89
90 if ( twoJ_ % 2 ) str += "/2";
91 return str + parity_.to_char();
92}
◆ twoJ()
| int marley::Level::twoJ |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files:
- /home/sjg/Desktop/marley/include/marley/Level.hh
- /home/sjg/Desktop/marley/src/Level.cc