TkN 2.1
Toolkit for Nuclei
tklevel Class Reference

Stores information on a nuclear level. More...

Detailed Description

Stores information on a nuclear level.

For any nucleus, it is possible to access to its level scheme composed of the known levels and decays. Print the known levels as follows:

tknucleus nuc("8B");
nuc.get_level_scheme()->print("level")
A nucleus made of Z protons and N neutrons.
Definition: tknucleus.h:54
[ INFO ] dataset '8B : ADOPTED LEVELS, GAMMAS' contains 5 levels:
[ INFO ] Level energy = 0 keV [no uncertainty] ; Jpi: 2+ ; lifetime = 770 (3 ) ms
[ INFO ] Level energy = 769.5 (2.5 ) keV ; Jpi: 1+ ; lifetime = 35.6 (0.6 ) keV
[ INFO ] Level energy = 2320 (20 ) keV ; Jpi: 3+ ; lifetime = 350 (30 ) keV
[ INFO ] Level energy = 3500 (500 ) keV ; Jpi: 2- ; lifetime = 8 (4 ) MeV
[ INFO ] Level energy = 10619 (9 ) keV ; Jpi: 0+ ; lifetime < 60 keV [limit value]
The level list can be retrieved using:

tknucleus nuc("8B");
auto levels = nuc.get_level_scheme()->get_levels();

or using a lambda function to filter the levels (e.g. all the positive parity states in):

tknucleus nuc("8B");
auto levels = nuc.get_level_scheme()->get_levels( [](auto lvl) {
return lvl->get_spin_parity()->get_parity().is_parity(tkparity::kParityPlus);
});
for(auto &lev: levels) lev->print()
[ INFO ] Level energy = 0 keV [no uncertainty] ; Jpi: 2+ ; lifetime = 770 (3 ) ms
[ INFO ] Level energy = 769.5 (2.5 ) keV ; Jpi: 1+ ; lifetime = 35.6 (0.6 ) keV
[ INFO ] Level energy = 2320 (20 ) keV ; Jpi: 3+ ; lifetime = 350 (30 ) keV
[ INFO ] Level energy = 10619 (9 ) keV ; Jpi: 0+ ; lifetime < 60 keV [limit value]
A level can also been accessed directly by its name (e.g. the first 3⁺ state):

tknucleus nuc("8B");
nuc.get_level_scheme()->get_level("3+1")->print();
[ INFO ] Level energy = 2320 (20 ) keV ; Jpi: 3+ ; lifetime = 350 (30 ) keV

, or using its energy (the closest level in energy will be returned):

tknucleus nuc("8B");
nuc.get_level_scheme()->get_level(3000.)->print();
[ INFO ] Level energy = 3500 (500 ) keV ; Jpi: 2- ; lifetime = 8 (4 ) MeV
The get_level(...) methods return a tkn::tklevel object, and the get_levels(...) methods return a vector of tkn::tklevel objects.

In some cases, a level or a full band is known only relatively to an offset X because the bandhead energy is not known. The level energy in this case is its energy related to the bandhead offset (ex: X+100). The default method get_energy() in this case will return a "nan" value to avoid confusions. To test is a level is known only with an offset, use the method is_energy_offset(). To obtain its relative energy, use the get_energy() with the _with_offset option.

Here are the main method that can be applied on a tklevel:
method name description
get_energy() returns the energy in keV
is_energy_offset() to know is the level is only known relatively to an offset
get_offset_bandhead() returns the band offset value
get_lifetime() to get the lifetime in seconds
get_spin_parity() to get the spin and parity as a tkn::tkspin_parity object
get_spin_parity_str() to get the spin and parity as a string
is_stable() returns true is the level is stable
is_isomer() returns true is the level is an isomer
get_isomer_level() returns the isomer level (1st, second,...)
is_yrast() returns true is the level yrast
get_decays_up() returns the list of decays that populate this level
get_decays_down() returns the list of decays that depopulate this level
has_comment() returns true if a comment on this level exists
get_comment() returns the comment on this level
is_uncertain() returns true if a the level is uncertain
print() prints the main level informations (as already used above)
The above methods giving access to a measure (ex: get_lifetime() ), are directly returning the value as a double. Dedicated methods allows to access the tkn::tkmeasure to access to units, uncertainties... etc (see Measures and units).For exemple, for the lifetime, the method get_lifetime_measure() returns the tkmeasure object.

Definition at line 54 of file tklevel.h.

Inheritance diagram for tklevel:
tkproperty_list

#include <tklevel.h>

Public Member Functions

 tklevel (int _id, const tkdb_table::measure_data_struct &_struc)
 
virtual ~tklevel ()=default
 
void add_decay_down (shared_ptr< tkdecay > _dec)
 add a down decay to the level More...
 
void add_decay_up (shared_ptr< tkdecay > _dec)
 add a up decay to the level More...
 
const tkstringget_comment ()
 get the level comment string More...
 
vector< shared_ptr< tkdecay > > get_decays_down ()
 return a vector of tkdecay containing of the downward decays More...
 
vector< shared_ptr< tkdecay > > get_decays_up ()
 return a vector of tkdecay containing the upward decays More...
 
double get_energy (const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::keV, bool _with_offset=false)
 returns the energy in keV by default More...
 
shared_ptr< tkmeasureget_energy_measure ()
 returns the energy tkmeasure object More...
 
int get_id ()
 get the level id More...
 
int get_isomer_level ()
 get the isomer level (1 for the 1rst (lowest energy) isomer, 2 for the second, etc..) More...
 
double get_lifetime (const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::s)
 returns the lifetime (in second by default) More...
 
shared_ptr< tkmeasureget_lifetime_measure ()
 returns the lifetime tkmeasure object More...
 
tkstring get_lifetime_str ()
 returns the lifetime in string (using the best adapted unit) More...
 
tkstring get_offset_bandhead ()
 returns the bandhead string offset value (ex: X) More...
 
shared_ptr< tkspin_parityget_spin_parity ()
 returns the spin parity shared pointer object More...
 
const tkstringget_spin_parity_str ()
 returns the spin parity as as string More...
 
bool has_comment ()
 check if a comment exists More...
 
bool is_energy_offset ()
 to know if the energy is known with an energy offset More...
 
bool is_isomer ()
 returns true is the level an isomer More...
 
bool is_stable ()
 returns true if the level stable More...
 
bool is_uncertain ()
 check if the level is uncertain More...
 
bool is_yrast (bool _with_tentative=false)
 returns true is the leve is Yrast More...
 
void print (const tkstring &_option="")
 print the level properties More...
 
void set_comment (const tkstring &_comment)
 set the level comment string More...
 
void set_energy_offset (tkstring &_offset)
 define the energy offset More...
 
void set_jpi (double _spin, int _parity, const tkstring &_jpi_str)
 define the spin parity More...
 
void set_lifetime (tkdb_table::measure_data_struct &_struc)
 define the level lifetime More...
 
void set_uncertain_level (const tkstring &_uncertain)
 set the level as uncertain More...
 
- Public Member Functions inherited from tkproperty_list
 tkproperty_list (tkstring _name)
 
virtual ~tkproperty_list ()=default
 
shared_ptr< tkmeasureget (const tkstring &_property) const
 get the property as tkmeasure More...
 
vector< shared_ptr< tkmeasure > > get_data_properties (const tkstring &_opt="*")
 get a vector of data properties according to a regular expression More...
 
const std::map< tkstring, property_string > get_properties ()
 get the properties map More...
 
tkstring get_property (const tkstring &_property) const
 get the property value as a string More...
 
tkstring get_property_type (const tkstring &_property) const
 get the property type as a string More...
 
tkstring get_property_unit (const tkstring &_property) const
 get the property unnit as a string More...
 
bool has_property (const tkstring &_property) const
 to check if the property is available More...
 
void list_data_properties (const tkstring &_opt="*") const
 list the available tkmeasure properties More...
 
void list_properties (const tkstring &_opt="*") const
 list the available properties More...
 

Friends

class tkdataset
 
class tklevel_scheme
 

Constructor & Destructor Documentation

◆ tklevel()

tklevel ( int  _id,
const tkdb_table::measure_data_struct _struc 
)

Definition at line 55 of file tklevel.cpp.

◆ ~tklevel()

virtual ~tklevel ( )
virtualdefault

Member Function Documentation

◆ add_decay_down()

void add_decay_down ( shared_ptr< tkdecay _dec)
inline

add a down decay to the level

Definition at line 145 of file tklevel.h.

◆ add_decay_up()

void add_decay_up ( shared_ptr< tkdecay _dec)
inline

add a up decay to the level

Definition at line 147 of file tklevel.h.

◆ get_comment()

const tkstring & get_comment ( )
inline

get the level comment string

Definition at line 126 of file tklevel.h.

◆ get_decays_down()

vector< shared_ptr< tkdecay > > get_decays_down ( )
inline

return a vector of tkdecay containing of the downward decays

Definition at line 109 of file tklevel.h.

◆ get_decays_up()

vector< shared_ptr< tkdecay > > get_decays_up ( )
inline

return a vector of tkdecay containing the upward decays

Definition at line 111 of file tklevel.h.

◆ get_energy()

double get_energy ( const tkunit_manager::units_keys  _unit = tkunit_manager::units_keys::keV,
bool  _with_offset = false 
)

returns the energy in keV by default

Parameters
_unitunit of the returned result. keV is used by default
_with_offsetif energy known only relatively to an offset, returns the relative energy

This method returns the level energy in unit of _units. If the level is only known relatively to an offset value (ex: E=X, or E=X+100), a nan is returned if the option _with_offset is not specified. Use in this case get_offset_bandhead() to obtain the band ground state (X) If the option _with_offset is defined, the relative energy is returned (0. or 100 in the previous example)

Definition at line 111 of file tklevel.cpp.

◆ get_energy_measure()

shared_ptr< tkmeasure > get_energy_measure ( )
inline

returns the energy tkmeasure object

Definition at line 87 of file tklevel.h.

◆ get_id()

int get_id ( )
inline

get the level id

Definition at line 134 of file tklevel.h.

◆ get_isomer_level()

int get_isomer_level ( )
inline

get the isomer level (1 for the 1rst (lowest energy) isomer, 2 for the second, etc..)

Definition at line 118 of file tklevel.h.

◆ get_lifetime()

double get_lifetime ( const tkunit_manager::units_keys  _unit = tkunit_manager::units_keys::s)

returns the lifetime (in second by default)

Parameters
_unitunit of the returned result. second is used by default

This method returns the level lifetime in unit of _units. A std::nan(1) is returned in case no lifetime is known for this nucleus. It can be tested using tknucleus::has_property("lifetime") prior to call this method or std::is_nan() on the returned value.

Definition at line 136 of file tklevel.cpp.

◆ get_lifetime_measure()

shared_ptr< tkmeasure > get_lifetime_measure ( )
inline

returns the lifetime tkmeasure object

Definition at line 97 of file tklevel.h.

◆ get_lifetime_str()

tkstring get_lifetime_str ( )

returns the lifetime in string (using the best adapted unit)

This method returns the level lifetime as string using the best adapted unit

Definition at line 150 of file tklevel.cpp.

◆ get_offset_bandhead()

tkstring get_offset_bandhead ( )
inline

returns the bandhead string offset value (ex: X)

Definition at line 94 of file tklevel.h.

◆ get_spin_parity()

shared_ptr< tkspin_parity > get_spin_parity ( )
inline

returns the spin parity shared pointer object

Definition at line 104 of file tklevel.h.

◆ get_spin_parity_str()

const tkstring & get_spin_parity_str ( )
inline

returns the spin parity as as string

Definition at line 106 of file tklevel.h.

◆ has_comment()

bool has_comment ( )
inline

check if a comment exists

Definition at line 124 of file tklevel.h.

◆ is_energy_offset()

bool is_energy_offset ( )
inline

to know if the energy is known with an energy offset

Definition at line 92 of file tklevel.h.

◆ is_isomer()

bool is_isomer ( )
inline

returns true is the level an isomer

Definition at line 116 of file tklevel.h.

◆ is_stable()

bool is_stable ( )
inline

returns true if the level stable

Definition at line 114 of file tklevel.h.

◆ is_uncertain()

bool is_uncertain ( )
inline

check if the level is uncertain

Definition at line 128 of file tklevel.h.

◆ is_yrast()

bool is_yrast ( bool  _with_tentative = false)

returns true is the leve is Yrast

Parameters
_with_tentativeif enabled, consider also the tentative spin assignments

This method returns true if the level is Yrast: corresponding to the lowest energy level for a given spin value

Definition at line 181 of file tklevel.cpp.

◆ print()

void print ( const tkstring _option = "")

print the level properties

Parameters
_optionoption for the print mode

If _option equals "tab", print the level properties in a tabular view (usefull for the tklevel_scheme::print("level","tab") ) else, print the level properties with a verboser view

Definition at line 194 of file tklevel.cpp.

◆ set_comment()

void set_comment ( const tkstring _comment)
inline

set the level comment string

Definition at line 150 of file tklevel.h.

◆ set_energy_offset()

void set_energy_offset ( tkstring _offset)
inline

define the energy offset

Definition at line 137 of file tklevel.h.

◆ set_jpi()

void set_jpi ( double  _spin,
int  _parity,
const tkstring _jpi_str 
)

define the spin parity

Definition at line 94 of file tklevel.cpp.

◆ set_lifetime()

void set_lifetime ( tkdb_table::measure_data_struct _struc)

define the level lifetime

Definition at line 75 of file tklevel.cpp.

◆ set_uncertain_level()

void set_uncertain_level ( const tkstring _uncertain)
inline

set the level as uncertain

Definition at line 152 of file tklevel.h.

Friends And Related Function Documentation

◆ tkdataset

friend class tkdataset
friend

Definition at line 55 of file tklevel.h.

◆ tklevel_scheme

friend class tklevel_scheme
friend

Definition at line 56 of file tklevel.h.


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