11#include <analysis/dataobjects/Particle.h>
12#include <framework/utilities/ArrayIterator.h>
23 template <
class T>
class StoreObjPtr;
150 c_FlavorSpecificParticle = 0,
151 c_SelfConjugatedParticle
180 void initialize(
int pdg,
const std::string& name,
const std::string& particleStoreName =
"Particles");
226 void removeParticles(
const std::vector<unsigned int>& toRemove,
bool removeFromAntiList =
true);
229 void clear(
bool includingAntiList =
true);
285 unsigned getListSize(
bool includingAntiList =
true)
const;
312 return getList(
K, forAntiParticle).size();
Generic iterator class for arrays, allowing use of STL algorithms, range-based for etc.
ParticleList is a container class that stores a collection of Particle objects.
void bindAntiParticleList(ParticleList &antiList, bool includingAntiList=true)
Binds particle and anti-particle ParticleLists.
ArrayIterator< ParticleList, Particle > iterator
STL-like iterator over the particles (not Particle*).
int getPDGCode() const
Returns PDG code.
std::string m_antiListName
name of ParticleList for anti-particles
Particle * getParticle(unsigned i, bool includingAntiList=true) const
Returns i-th particle from the list and anti list if requested.
const_iterator begin() const
Return const_iterator to first entry.
int getAntiParticlePDGCode() const
Returns PDG code of anti-particle.
void addParticle(const Particle *particle)
Adds a new particle to the list (safe method)
bool getIsReserved() const
Returns m_isReserved.
bool m_isReserved
transient
bool contains(const Particle *p, bool includingAntiList=true) const
Returns true if and only if 'p' is already in this list.
std::string getParticleCollectionName() const
Returns Particle store array name to which particle list refers.
const std::vector< int > & getList(EParticleType K, bool forAntiParticle=false) const
Returns list of StoreArray<Particle> indices.
ParticleList & getAntiParticleList() const
Returns bound anti-particle list.
ClassDef(ParticleList, 4)
Class to hold a list of particles, anti-particles and self-conjugated particles.
unsigned getListSize(bool includingAntiList=true) const
Returns total number of particles in this list and anti list if requested.
ParticleList()
Default constructor.
void setEditable(bool editable, bool includingAntiList=true)
Sets m_isReserved so that the reserved list can be edited.
void setParticleCollectionName(const std::string &name, bool forAntiParticle=true)
Sets Particle store array name to which particle list refers.
int m_pdg
PDG code of Particle.
std::string m_particleStore
name of Particle store array
std::string getAntiParticleListName() const
Returns the name the anti-particle ParticleList.
int getIndex(const Particle *p, bool includingAntiList=true) const
Returns index of the given particle 'p' in this list.
std::string m_thisListName
name of this ParticleList
Particle * operator[](int index) const
Convenience function to get particle with index.
void clear(bool includingAntiList=true)
Remove all elements from list, afterwards getListSize() will be 0.
StoreObjPtr< ParticleList > * m_antiList
keep anti-list around for performance.
std::vector< int > m_fsList
list of 0-based indices of flavor-specific Particles (particles that have an anti-particle)
std::string getParticleListName() const
Returns the name this ParticleList.
unsigned getNParticlesOfType(EParticleType K, bool forAntiParticle=false) const
Returns the number of flavor-specific particles or self-conjugated particles in this list or its anti...
int m_pdgbar
PDG code of antiparticle.
EParticleType
Type of Particle (determines in which of the two internal lists the particle is stored).
iterator end()
Return iterator to last entry +1.
const_iterator end() const
Return const_iterator to last entry +1.
void print() const
Prints the list.
std::string getInfoHTML() const
Return a short summary of this object's contents in HTML format.
iterator begin()
Return iterator to first entry.
std::vector< int > m_scList
list of 0-based indices of self-conjugated Particles (particles that do not have an anti-particle)
Particle * getParticleWithMdstIdx(unsigned int mdstIdx, bool includingAntiList=true) const
Returns the particle from the list matching the given mdst array index, if any is found.
ArrayIterator< ParticleList, const Particle > const_iterator
STL-like const_iterator over the particles (not Particle*).
void initialize(int pdg, const std::string &name, const std::string &particleStoreName="Particles")
Sets the PDG code and name of this ParticleList.
void removeParticles(const std::vector< unsigned int > &toRemove, bool removeFromAntiList=true)
Remove given elements from list.
Specialised SelectSubset<Particle> that also fixes daughter indices and all ParticleLists.
Class to store reconstructed particles.
EFlavorType
describes flavor type, see getFlavorType().
Type-safe access to single objects in the data store.
Abstract base class for different kinds of events.