Belle II Software development
|
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. | |
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:
|
inline |
Copy constructor to make sure particles belong to correct set.
Definition at line 523 of file Const.h.
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.
|
inline |
Return particle at given index, or end() if out of range.
Definition at line 549 of file Const.h.
|
inline |
Returns first particle.
Definition at line 557 of file Const.h.
bool contains | ( | const ParticleType & | p | ) | const |
Returns true if and only if the set contains 'p'.
Definition at line 424 of file UnitConst.cc.
|
inline |
Returns an invalid particle to check if iteration should be stopped.
|
inline |
|
inline |
Assignment operator.
|
inline |
|
private |