![]() |
Belle II Software
light-2303-iriomote
|
A set of ParticleType objects, with defined order. More...
#include <Const.h>

Public Member Functions | |
| ParticleSet ()=default | |
| Emtpy constructor. | |
| ParticleSet (const ParticleSet &other) | |
| Copy constructor to make sure particles belong to correct set. | |
| ParticleSet & | operator= (const ParticleSet &other) |
| Assignment operator. | |
| void | add (const ParticleType &p) |
| Add a copy of the given ParticleType to this set. More... | |
| bool | contains (const ParticleType &p) const |
| Returns true if and only if the set contains 'p'. | |
| unsigned int | size () const |
| Returns number of particles in this set. | |
| const ParticleType & | at (unsigned int index) const |
| Return particle at given index, or end() if out of range. | |
| ParticleType | begin () const |
| Returns first particle. | |
| ParticleType | end () const |
| Returns an invalid particle to check if iteration should be stopped. | |
| const ParticleType & | find (int pdg) const |
| Returns particle in set with given PDG code, or invalidParticle if not found. | |
Private Attributes | |
| std::vector< ParticleType > | m_particles |
| Actual particles. | |
A set of ParticleType objects, with defined order.
Allows easy iteration over a set of particles, e.g. to print indices and PDG codes:
ParticleSets can be created by merging ParticleType objects or other ParticleSets:
| void add | ( | const ParticleType & | p | ) |
Add a copy of the given ParticleType to this set.
If the set already contains the given particle, it remains unchanged.
Definition at line 417 of file UnitConst.cc.