int32_t id_
Each particle has a unique identifier.
void reset()
Reset the state of the Particles object to an empty list and a new id counter.
ParticleTypePtr type_
A reference to the ParticleType object for this particle (this contains all the static information).
std::vector< unsigned > dirty_
Stores the indexes in data_ that do not hold valid particle data and should be reused when new partic...
static const ParticleType & find(PdgCode pdgcode)
Returns the ParticleType object for the given pdgcode.
void replace(const ParticleList &to_remove, ParticleList &to_add)
Replace the particles in to_remove with the particles in to_add in the list of current particles.
void create(size_t n, PdgCode pdg)
Add n particles of the same type (pdg) to the list.
bool hole_
If true, the object is an entry in Particles::data_ and does not hold valid particle data.
void copy_in(ParticleData &to, const ParticleData &from)
int id_max_
Highest id of a given particle.
void copy_to(ParticleData &dst) const
Copies some information of the particle to the given particle dst.
std::unique_ptr< ParticleData[]> data_
Points to a dynamically allocated array of ParticleData objects.
const ParticleData & insert(const ParticleData &p)
Inserts the particle into the list of particles.
bool is_valid(const ParticleData ©) const
Check whether the ParticleData copy is still a valid copy of the one stored in the Particles object.
void ensure_capacity(unsigned to_add)
void increase_capacity(unsigned new_capacity)
Particles()
Creates a new (empty) Particles object.
void remove(const ParticleData &p)
Remove the given particle p from the list.