Reactions  0.1.2
Handling reaction trees and decays
Public Types | Public Member Functions | Static Public Attributes | List of all members
reactions::nubase_element Class Referencefinal

An element based on the NuBase database. More...

Inheritance diagram for reactions::nubase_element:
Inheritance graph
[legend]
Collaboration diagram for reactions::nubase_element:
Collaboration graph
[legend]

Public Types

using base_type = nubase_element_base
 Base class. More...
 
using fields_type = nubase_element_fields
 Fields of the element. More...
 

Public Member Functions

 nubase_element ()=delete
 
 nubase_element (nubase_element const &)=default
 
 nubase_element (nubase_element &&)=default
 
nubase_elementoperator= (nubase_element const &)=default
 
template<class... Args>
 nubase_element (Args &&...args)
 Construct the element from an initializer list. More...
 
 nubase_element (base_type &&other)
 Construct the element from the contents. More...
 
bool operator== (nubase_element const &other) const
 Compare the ID of the two particles. More...
 
bool operator!= (nubase_element const &other) const
 Compare the ID of the two particles. More...
 
template<class Field , class... Subfield>
units::return_type_t< Field, Subfield... > get () const
 Get an element using an accessor. More...
 
template<class Field >
constexpr bool has () const
 Check whether the given field information is missing or not. More...
 
std::string latex_name () const
 Representation of the element name as a LaTeX string. More...
 
std::string const & name () const
 Name of the particle. More...
 
int nubase_id () const
 NuBase ID. More...
 
int atomic_number () const
 Atomic number. More...
 
int mass_number () const
 Mass number. More...
 
bool is_ground_state () const
 Whether the element is its own charge-conjugate. More...
 
double mass_excess () const
 
bool has_mass_excess () const
 Whether the mass and its errors are defined or not. More...
 
double mass_excess_error () const
 Lower mass error. More...
 
bool mass_excess_from_systematics () const
 Whether the mass excess has been calculated from systematics. More...
 
double half_life () const
 Get the width of the element. More...
 
bool has_half_life () const
 Whether the width and its errors are defined or not. More...
 
double half_life_error () const
 Get the lower width error. More...
 
bool half_life_from_systematics () const
 Whether the half-life has been calculated from systematics. More...
 
bool is_stable () const
 Whether the element is its own charge-conjugate. More...
 

Static Public Attributes

static const size_t number_of_fields = std::tuple_size_v<base_type>
 Number of data fields. More...
 
static constexpr auto line_size
 Size of the line (in characters) associated to this class. More...
 

Detailed Description

An element based on the NuBase database.

Member Typedef Documentation

◆ base_type

Base class.

◆ fields_type

Fields of the element.

Constructor & Destructor Documentation

◆ nubase_element() [1/5]

reactions::nubase_element::nubase_element ( )
delete

◆ nubase_element() [2/5]

reactions::nubase_element::nubase_element ( nubase_element const &  )
explicitdefault

◆ nubase_element() [3/5]

reactions::nubase_element::nubase_element ( nubase_element &&  )
explicitdefault

◆ nubase_element() [4/5]

template<class... Args>
reactions::nubase_element::nubase_element ( Args &&...  args)
inline

Construct the element from an initializer list.

◆ nubase_element() [5/5]

reactions::nubase_element::nubase_element ( base_type &&  other)
inlineexplicit

Construct the element from the contents.

Member Function Documentation

◆ atomic_number()

int reactions::nubase_element::atomic_number ( ) const
inline

Atomic number.

◆ get()

template<class Field , class... Subfield>
units::return_type_t<Field, Subfield...> reactions::nubase_element::get ( ) const
inline

Get an element using an accessor.

For fields of std::optional type, the validity of the content must be checked before calling this function using the nubase_element::has member function. Otherwise the reactions::missing_fields_error exception is thrown, if missing.

The return type is a constant reference for values without units and a value for those with units.

◆ half_life()

double reactions::nubase_element::half_life ( ) const
inline

Get the width of the element.

You must check whether the width is defined or not before calling this member function, otherwise a reactions::missing_fields_error is thrown.

◆ half_life_error()

double reactions::nubase_element::half_life_error ( ) const
inline

Get the lower width error.

You must check whether the width is defined or not before calling this member function, otherwise a reactions::missing_fields_error is thrown.

◆ half_life_from_systematics()

bool reactions::nubase_element::half_life_from_systematics ( ) const
inline

Whether the half-life has been calculated from systematics.

◆ has()

template<class Field >
constexpr bool reactions::nubase_element::has ( ) const
inline

Check whether the given field information is missing or not.

◆ has_half_life()

bool reactions::nubase_element::has_half_life ( ) const
inline

Whether the width and its errors are defined or not.

◆ has_mass_excess()

bool reactions::nubase_element::has_mass_excess ( ) const
inline

Whether the mass and its errors are defined or not.

◆ is_ground_state()

bool reactions::nubase_element::is_ground_state ( ) const
inline

Whether the element is its own charge-conjugate.

◆ is_stable()

bool reactions::nubase_element::is_stable ( ) const
inline

Whether the element is its own charge-conjugate.

◆ latex_name()

std::string reactions::nubase_element::latex_name ( ) const
inline

Representation of the element name as a LaTeX string.

◆ mass_excess()

double reactions::nubase_element::mass_excess ( ) const
inline

Get the mass of the element

You must check whether the mass is defined or not before calling this member function, otherwise a reactions::missing_fields_error is thrown.

◆ mass_excess_error()

double reactions::nubase_element::mass_excess_error ( ) const
inline

Lower mass error.

You must check whether the mass is defined or not before calling this member function, otherwise a reactions::missing_fields_error is thrown.

◆ mass_excess_from_systematics()

bool reactions::nubase_element::mass_excess_from_systematics ( ) const
inline

Whether the mass excess has been calculated from systematics.

◆ mass_number()

int reactions::nubase_element::mass_number ( ) const
inline

Mass number.

◆ name()

std::string const& reactions::nubase_element::name ( ) const
inline

Name of the particle.

◆ nubase_id()

int reactions::nubase_element::nubase_id ( ) const
inline

NuBase ID.

◆ operator!=()

bool reactions::nubase_element::operator!= ( nubase_element const &  other) const
inline

Compare the ID of the two particles.

Parameters
otherelement to compare with
Returns
the result of comparing the NuBase IDs of the two elements

◆ operator=()

nubase_element& reactions::nubase_element::operator= ( nubase_element const &  )
default

◆ operator==()

bool reactions::nubase_element::operator== ( nubase_element const &  other) const
inline

Compare the ID of the two particles.

Parameters
otherelement to compare with
Returns
the result of comparing the NuBase IDs of the two elements

Member Data Documentation

◆ line_size

constexpr auto reactions::nubase_element::line_size
static
Initial value:
=
reactions::fields::overall_range_t<std::tuple_element_t<
number_of_fields - 1, fields_type>::range_type>::max

Size of the line (in characters) associated to this class.

◆ number_of_fields

const size_t reactions::nubase_element::number_of_fields = std::tuple_size_v<base_type>
static

Number of data fields.


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