Belle II Software  release-08-01-10
Const::ChargedStable Class Reference

Provides a type-safe way to pass members of the chargedStableSet set. More...

#include <Const.h>

Inheritance diagram for Const::ChargedStable:
Collaboration diagram for Const::ChargedStable:

Public Member Functions

 ChargedStable (const ParticleType &p)
 Constructor from the more general ParticleType. More...
 
 ChargedStable (int pdg)
 Constructor from PDG code. More...
 
bool operator< (const ParticleType &other) const
 Comparison operator to be usable in sets. More...
 
bool operator== (const ParticleType &o) const
 Test equality.
 
bool operator!= (const ParticleType &o) const
 Test inequality.
 
ParticleTypeoperator* ()
 dummy dereferencing for range-based for.
 
ParticleTypeoperator++ ()
 Prefix increment. More...
 
ParticleType operator++ (int)
 Postfix increment. More...
 
 operator ParticleSet () const
 Conversion of ParticleType to ParticleSet.
 
int getIndex () const
 This particle's index in the associated set. More...
 
const TParticlePDG * getParticlePDG () const
 Accessor for ROOT TParticlePDG object. More...
 
int getPDGCode () const
 PDG code. More...
 
double getMass () const
 Particle mass. More...
 
std::string __repr__ () const
 String for printing in python.
 

Static Public Attributes

static const unsigned int c_SetSize = 6
 Number of elements (for use in array bounds etc.)
 

Private Attributes

int m_pdgCode
 PDG code of the particle.
 
const ParticleSetm_set
 set this particle belongs to, or NULL if stand-alone.
 
int m_index
 index in the associated set, -1 if there's no set.
 

Detailed Description

Provides a type-safe way to pass members of the chargedStableSet set.

As the defined static members (Const::electron, etc. ) are members of this set, this also defines a fixed index from 0 to 4 for each particle.

Definition at line 580 of file Const.h.

Constructor & Destructor Documentation

◆ ChargedStable() [1/2]

ChargedStable ( const ParticleType p)
inline

Constructor from the more general ParticleType.

Throws a runtime_error if p is not in chargedStableSet.

Definition at line 587 of file Const.h.

◆ ChargedStable() [2/2]

ChargedStable ( int  pdg)
inlineexplicit

Constructor from PDG code.

Throws a runtime_error if pdg is not in chargedStableSet.

Definition at line 599 of file Const.h.

Member Function Documentation

◆ getIndex()

int getIndex ( ) const
inlineinherited

This particle's index in the associated set.

In case the particle has no set, -1 is returned.

Definition at line 452 of file Const.h.

◆ getMass()

double getMass ( void  ) const
inherited

Particle mass.

Returns
The mass of the particle.

Definition at line 356 of file UnitConst.cc.

◆ getParticlePDG()

const TParticlePDG * getParticlePDG ( ) const
inherited

Accessor for ROOT TParticlePDG object.

Returns
The TParticlePDG object for this type of particle.

Definition at line 351 of file UnitConst.cc.

◆ getPDGCode()

int getPDGCode ( void  ) const
inlineinherited

PDG code.

Returns
The PDG code of the particle.

Definition at line 464 of file Const.h.

◆ operator++() [1/2]

Const::ParticleType & operator++ ( )
inherited

Prefix increment.

Incrementing past the last element of a set will return an invalid particle.

Definition at line 333 of file UnitConst.cc.

◆ operator++() [2/2]

Const::ParticleType operator++ ( int  )
inherited

Postfix increment.

Incrementing past the last element of a set will yield an invalid particle.

Definition at line 344 of file UnitConst.cc.

◆ operator<()

bool operator< ( const ParticleType other) const
inherited

Comparison operator to be usable in sets.

Parameters
otherthe type of the other particle for the comparison.

Definition at line 328 of file UnitConst.cc.


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