TkN 2.1
Toolkit for Nuclei
tklevel_scheme Class Reference

Collection of levels and decay. More...

Detailed Description

Collection of levels and decay.

For all the nuclei with known data on the ENSDF or XUNDL databases, it is possible to access to a tkn::tklevel_scheme object.

The level scheme is determined for a given dataset see tkn::tkdataset documentation.

For one dataset, the level scheme gives access to the nuclear levels and decay information. Refer to the tkn::tklevel or tkn::tkdecay documentation.

Definition at line 109 of file tklevel_scheme.h.

#include <tklevel_scheme.h>

Public Member Functions

 tklevel_scheme (const tkstring &_nuc, int _zz, int _aa)
 
virtual ~tklevel_scheme ()=default
 
const shared_ptr< tkdataset > & get_dataset ()
 returns the current dataset More...
 
const std::map< int, shared_ptr< tkdataset > > get_datasets ()
 returns the list of available datasets More...
 
template<typename T >
const shared_ptr< T > get_decay (const tkstring &_name, bool _exact=true)
 Template method to get the decay of type T (ex: tkgammadecay) corresponding to the given name. More...
 
template<typename T >
const shared_ptr< T > get_decay (double _energy)
 Template method to get the decay of type T (ex: tkgammadecay) corresponding to the closest energy. More...
 
const std::vector< shared_ptr< tkdecay > > & get_decays ()
 get the vector containing all the decays More...
 
template<typename T >
const std::vector< shared_ptr< T > > get_decays ()
 Template method to get the vector containing all the decays of type T (ex: tkgammadecay) More...
 
template<typename T >
const std::vector< shared_ptr< T > > get_decays (const std::function< bool(shared_ptr< T >)> &_selection)
 Template method to get the vector containing all the decays of type T (ex: tkgammadecay) filtered by the selection fonction. More...
 
std::vector< shared_ptr< tkdecay > > get_decays (std::function< bool(shared_ptr< tkdecay >)>const &_selection)
 get the vector containing decays filtered by the selection fonction More...
 
shared_ptr< tklevelget_level (const tkstring &_name, bool _exact=true)
 get the level corresponding to the given name More...
 
shared_ptr< tklevelget_level (double _energy, tkstring _offset="")
 get the level corresponding to the given energy More...
 
const std::vector< shared_ptr< tklevel > > & get_levels ()
 get the vector containing all the levels More...
 
std::vector< shared_ptr< tklevel > > get_levels (std::function< bool(shared_ptr< tklevel >)>const &_selection)
 get the vector containing all the levels filtered by the selection fonction More...
 
void print (const tkstring &_data="", const tkstring &_option="")
 print the level scheme information More...
 
bool select_dataset (const tkstring &_dataset_name)
 select a dataset using its name More...
 
bool select_dataset (int _dataset_id=0)
 select a dataset using its id More...
 

Constructor & Destructor Documentation

◆ tklevel_scheme()

tklevel_scheme ( const tkstring _nuc,
int  _zz,
int  _aa 
)

Definition at line 70 of file tklevel_scheme.cpp.

◆ ~tklevel_scheme()

virtual ~tklevel_scheme ( )
virtualdefault

Member Function Documentation

◆ get_dataset()

const shared_ptr< tkdataset > & get_dataset ( )
inline

returns the current dataset

Definition at line 133 of file tklevel_scheme.h.

◆ get_datasets()

const std::map< int, shared_ptr< tkdataset > > get_datasets ( )
inline

returns the list of available datasets

Definition at line 135 of file tklevel_scheme.h.

◆ get_decay() [1/2]

const shared_ptr< T > get_decay ( const tkstring _name,
bool  _exact = true 
)
inline

Template method to get the decay of type T (ex: tkgammadecay) corresponding to the given name.

Parameters
_namestring expression of the required level (spin + parity (level from) -> spin + parity (level to))
_exactif set to true, temptative spin assignments will be ignored

Example:

tknucleus nuc("8B");
nuc.get_level_scheme()->get_decay<tkgammadecay>("3+1->2+1")->print();
Stores information on a gamma-ray decay.
Definition: tkdecay.h:131
void print(const tkstring &_data="", const tkstring &_option="")
print the level scheme information
A nucleus made of Z protons and N neutrons.
Definition: tknucleus.h:54
[ INFO ] gamma decay energy = 2320 (30 ) keV, mult M1

Definition at line 203 of file tklevel_scheme.h.

◆ get_decay() [2/2]

const shared_ptr< T > get_decay ( double  _energy)
inline

Template method to get the decay of type T (ex: tkgammadecay) corresponding to the closest energy.

Parameters
_energyapproximative decay energy

Example:

tknucleus nuc("8B");
nuc.get_level_scheme()->get_decay<tkgammadecay>(700.)->print();
[ INFO ] gamma decay energy = 769.5 (2.4 ) keV, mult M1

Definition at line 229 of file tklevel_scheme.h.

◆ get_decays() [1/4]

const std::vector< shared_ptr< tkdecay > > & get_decays ( )
inline

get the vector containing all the decays

Definition at line 143 of file tklevel_scheme.h.

◆ get_decays() [2/4]

const std::vector< shared_ptr< T > > get_decays ( )
inline

Template method to get the vector containing all the decays of type T (ex: tkgammadecay)

Example:

tknucleus nuc("8B");
auto levels = nuc.get_level_scheme()->get_decays<tkgammadecay>();

Definition at line 154 of file tklevel_scheme.h.

◆ get_decays() [3/4]

const std::vector< shared_ptr< T > > get_decays ( const std::function< bool(shared_ptr< T >)> &  _selection)
inline

Template method to get the vector containing all the decays of type T (ex: tkgammadecay) filtered by the selection fonction.

Example:

tknucleus nuc("8B");
auto decays = nuc.get_level_scheme()->get_decays<tkgammadecay>( [](auto dec) {
return dec->get_level_from()->get_energy_measure()->get_value(tkunit_manager::MeV) < 1.;
});
for(auto &dec: decays) dec->print()
void print(const tkstring &_option="") const
print the decay properties
Definition: tkdecay.cpp:92
[ INFO ] gamma decay energy = 769.5 (2.4 ) keV, mult M1

Definition at line 179 of file tklevel_scheme.h.

◆ get_decays() [4/4]

std::vector< shared_ptr< tkdecay > > get_decays ( std::function< bool(shared_ptr< tkdecay >)>const &  _selection)

get the vector containing decays filtered by the selection fonction

Parameters
_selectionlambda function to filter the list of decays to be returned

Example:

tknucleus nuc("8B");
auto decays = nuc.get_level_scheme()->get_decays( [](auto dec) {
return dec->get_energy() < 1000.;
});
for(auto &dec: decays) dec->print()
[ INFO ] gamma decay energy = 769.5 (2.4 ) keV, mult M1

Definition at line 114 of file tklevel_scheme.cpp.

◆ get_level() [1/2]

shared_ptr< tklevel > get_level ( const tkstring _name,
bool  _exact = true 
)

get the level corresponding to the given name

Parameters
_namestring expression of the required level (spin + parity)
_exactif set to true, temptative spin assignments will be ignored

Example:

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

Definition at line 213 of file tklevel_scheme.cpp.

◆ get_level() [2/2]

shared_ptr< tklevel > get_level ( double  _energy,
tkstring  _offset = "" 
)

get the level corresponding to the given energy

get the level corresponding to the closest energy

Parameters
_energyenergy value of the desired level
_offsetif the level is supposed to be part of a band with unkown bandhead energy, offset of the band (ex: X)

if offset is set to *, all offset values will be considered. if offset contains "dec", only levels that have known decays will be considered

Definition at line 263 of file tklevel_scheme.cpp.

◆ get_levels() [1/2]

const std::vector< shared_ptr< tklevel > > & get_levels ( )
inline

get the vector containing all the levels

Definition at line 138 of file tklevel_scheme.h.

◆ get_levels() [2/2]

std::vector< shared_ptr< tklevel > > get_levels ( std::function< bool(shared_ptr< tklevel >)>const &  _selection)

get the vector containing all the levels filtered by the selection fonction

Parameters
_selectionlambda function to filter the list of levels to be returned

Example:

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]

Definition at line 93 of file tklevel_scheme.cpp.

◆ print()

void print ( const tkstring _data = "",
const tkstring _option = "" 
)

print the level scheme information

Parameters
_datadata type to be printed (dataset, level, decay, level-decay, *)
_optionprint option relative to the data type to be printed (see the dedicated print methods in tkn::tklevel::print and tkn::tkdecay::print)

Details for each _data type:

dataset list the available datasets for the current nucleus
level list the levels by increasing energy order
decay list the decays sorted by the emmiting level energy
level-decay list the levels by increasing energy order, and its associated decays
* list the level and decays for all datasets

Available _option values:

tab print data as sorted in a tabular view
yrast only confirmed yrast levels will be printed
yrastt only confirmed and tentative yrast levels will be printed
com print comments

Definition at line 143 of file tklevel_scheme.cpp.

◆ select_dataset() [1/2]

bool select_dataset ( const tkstring _dataset_name)

select a dataset using its name

Parameters
_dataset_namename of the dataset to be selected

to list the available datasets, use tkn::tklevel_scheme::print("dataset")

Definition at line 173 of file tklevel_scheme.cpp.

◆ select_dataset() [2/2]

bool select_dataset ( int  _dataset_id = 0)

select a dataset using its id

Parameters
_dataset_idid of the dataset to be selected

to list the available datasets, use tkn::tklevel_scheme::print("dataset")

Definition at line 188 of file tklevel_scheme.cpp.


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