 |
Belle II Software
release-05-02-19
|
13 #include <analysis/dataobjects/Particle.h>
14 #include <framework/utilities/ArrayIterator.h>
25 template <
class T>
class StoreObjPtr;
142 class ParticleList :
public TObject {
146 typedef ArrayIterator<ParticleList, Particle>
iterator;
148 typedef ArrayIterator<ParticleList, const Particle>
const_iterator;
152 c_FlavorSpecificParticle = 0,
153 c_SelfConjugatedParticle
181 void initialize(
int pdg,
const std::string& name,
const std::string& particleStoreName =
"Particles");
227 void removeParticles(
const std::vector<unsigned int>& toRemove,
bool removeFromAntiList =
true);
230 void clear(
bool includingAntiList =
true);
305 return getList(K, forAntiParticle).size();
void setParticleCollectionName(const std::string &name, bool forAntiParticle=true)
Sets Particle store array name to which particle list refers.
iterator begin()
Return iterator to first entry.
std::vector< int > m_fsList
list of 0-based indices of flavor-specific Particles (particles that have an anti-particle)
ParticleList is a container class that stores a collection of Particle objects.
bool contains(const Particle *p, bool includingAntiList=true) const
Returns true if and only if 'p' is already in this list.
std::string m_thisListName
name of this ParticleList
int m_pdg
PDG code of Particle.
Particle * operator[](int index) const
Convenience function to get particle with index.
void print() const
Prints the list.
ParticleList()
Default constructor.
std::string m_antiListName
name of ParticleList for anti-particles
ArrayIterator< ParticleList, Particle > iterator
STL-like iterator over the particles (not Particle*).
EParticleType
Type of Particle (determines in which of the two internal lists the particle is stored).
ClassDef(ParticleList, 3)
transient
std::string getAntiParticleListName() const
Returns the name the anti-particle ParticleList.
iterator end()
Return iterator to last entry +1.
void bindAntiParticleList(ParticleList &antiList, bool includingAntiList=true)
Binds particle and anti-particle ParticleLists.
EFlavorType
describes flavor type, see getFlavorType().
Abstract base class for different kinds of events.
StoreObjPtr< ParticleList > * m_antiList
keep anti-list around for performance.
Type-safe access to single objects in the data store.
ArrayIterator< ParticleList, const Particle > const_iterator
STL-like const_iterator over the particles (not Particle*).
void clear(bool includingAntiList=true)
Remove all elements from list, afterwards getListSize() will be 0.
Specialised SelectSubset<Particle> that also fixes daughter indices and all ParticleLists.
int getAntiParticlePDGCode() const
Returns PDG code of anti-particle.
void initialize(int pdg, const std::string &name, const std::string &particleStoreName="Particles")
Sets the PDG code and name of this ParticleList.
unsigned getListSize(bool includingAntiList=true) const
Returns total number of particles in this list and anti list if requested.
int m_pdgbar
PDG code of antiparticle.
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...
Class to store reconstructed particles.
std::vector< int > m_scList
list of 0-based indices of self-conjugated Particles (particles that do not have an anti-particle)
const std::vector< int > & getList(EParticleType K, bool forAntiParticle=false) const
Returns list of StoreArray<Particle> indices.
std::string m_particleStore
name of Particle store array
std::string getParticleListName() const
Returns the name this ParticleList.
void addParticle(const Particle *particle)
Adds a new particle to the list (safe method)
ParticleList & getAntiParticleList() const
Returns bound anti-particle list.
std::string getInfoHTML() const
Return a short summary of this object's contents in HTML format.
std::string getParticleCollectionName() const
Returns Particle store array name to which particle list refers.
Particle * getParticle(unsigned i, bool includingAntiList=true) const
Returns i-th particle from the list and anti list if requested.
void removeParticles(const std::vector< unsigned int > &toRemove, bool removeFromAntiList=true)
Remove given elements from list.
int getPDGCode() const
Returns PDG code.