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

A PDG particle, based on the fields of a particle in the PDG database. More...

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

Public Types

using base_type = pdg_element_base
 Base class. More...
 
using fields_type = pdg_element_fields
 Fields of the element. More...
 

Public Member Functions

 pdg_element ()=delete
 
 pdg_element (pdg_element const &)=default
 
 pdg_element (pdg_element &&)=default
 
pdg_elementoperator= (pdg_element const &)=default
 
template<class... Args>
 pdg_element (Args &&... args)
 Construct the element from an initializer list. More...
 
 pdg_element (base_type &&other)
 Construct the element from the contents. More...
 
bool operator== (pdg_element const &other) const
 Compare the ID of the two particles. More...
 
bool operator!= (pdg_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 pdg_id () const
 PDG ID. More...
 
int three_charge () const
 Three times the charge, as an integer. More...
 
double charge () const
 Charge as a doubleing point number. More...
 
bool is_self_cc () const
 Whether the element is its own charge-conjugate. More...
 
double mass () const
 
bool has_mass () const
 Whether the mass and its errors are defined or not. More...
 
double mass_error_lower () const
 Lower mass error. More...
 
double mass_error_upper () const
 Upper mass error. More...
 
double mass_error () const
 
double mass_error_squared () const
 
double width () const
 Get the width of the element. More...
 
bool has_width () const
 Whether the width and its errors are defined or not. More...
 
double width_error_lower () const
 Get the lower width error. More...
 
double width_error_upper () const
 Get the upper width error. More...
 
double width_error () const
 
double width_error_squared () const
 

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

A PDG particle, based on the fields of a particle in the PDG database.

Member Typedef Documentation

◆ base_type

Base class.

◆ fields_type

Fields of the element.

Constructor & Destructor Documentation

◆ pdg_element() [1/5]

reactions::pdg_element::pdg_element ( )
delete

◆ pdg_element() [2/5]

reactions::pdg_element::pdg_element ( pdg_element const &  )
explicitdefault

◆ pdg_element() [3/5]

reactions::pdg_element::pdg_element ( pdg_element &&  )
explicitdefault

◆ pdg_element() [4/5]

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

Construct the element from an initializer list.

◆ pdg_element() [5/5]

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

Construct the element from the contents.

Member Function Documentation

◆ charge()

double reactions::pdg_element::charge ( ) const
inline

Charge as a doubleing point number.

◆ get()

template<class Field , class... Subfield>
units::return_type_t<Field, Subfield...> reactions::pdg_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 pdg_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.

◆ has()

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

Check whether the given field information is missing or not.

◆ has_mass()

bool reactions::pdg_element::has_mass ( ) const
inline

Whether the mass and its errors are defined or not.

◆ has_width()

bool reactions::pdg_element::has_width ( ) const
inline

Whether the width and its errors are defined or not.

◆ is_self_cc()

bool reactions::pdg_element::is_self_cc ( ) const
inline

Whether the element is its own charge-conjugate.

◆ latex_name()

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

Representation of the element name as a LaTeX string.

◆ mass()

double reactions::pdg_element::mass ( ) 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_error()

double reactions::pdg_element::mass_error ( ) const
inline

◆ mass_error_lower()

double reactions::pdg_element::mass_error_lower ( ) 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_error_squared()

double reactions::pdg_element::mass_error_squared ( ) const
inline

◆ mass_error_upper()

double reactions::pdg_element::mass_error_upper ( ) const
inline

Upper 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.

◆ name()

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

Name of the particle.

◆ operator!=()

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

Compare the ID of the two particles.

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

◆ operator=()

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

◆ operator==()

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

Compare the ID of the two particles.

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

◆ pdg_id()

int reactions::pdg_element::pdg_id ( ) const
inline

PDG ID.

◆ three_charge()

int reactions::pdg_element::three_charge ( ) const
inline

Three times the charge, as an integer.

◆ width()

double reactions::pdg_element::width ( ) 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.

◆ width_error()

double reactions::pdg_element::width_error ( ) const
inline

Calculate the 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.

◆ width_error_lower()

double reactions::pdg_element::width_error_lower ( ) 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.

◆ width_error_squared()

double reactions::pdg_element::width_error_squared ( ) const
inline

Calculate the width error squared

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

◆ width_error_upper()

double reactions::pdg_element::width_error_upper ( ) const
inline

Get the upper 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.

Member Data Documentation

◆ line_size

constexpr auto reactions::pdg_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::pdg_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: