Belle II Software  release-08-01-10
ParticleGenerator Class Reference

ParticleGenerator is a generator for all the particles combined from the given ParticleLists. More...

#include <ParticleCombiner.h>

Collaboration diagram for ParticleGenerator:

Public Member Functions

 ParticleGenerator (const std::string &decayString, const std::string &cutParameter="")
 Initialises the generator to produce the given type of sublist. More...
 
 ParticleGenerator (const DecayDescriptor &decaydescriptor, const std::string &cutParameter="")
 Initialises the generator to produce the given type of sublist. More...
 
void init ()
 Initialises the generator to produce the given type of sublist.
 
bool loadNext (bool loadAntiParticle=true)
 Loads the next combination. More...
 
Particle getCurrentParticle () const
 Returns the particle.
 
bool inputListsCollide () const
 True if input lists collide (can contain copies of particles in the input lists). More...
 
bool inputListsCollide (const std::pair< unsigned, unsigned > &pair) const
 True if the pair of input lists collide. More...
 
int getUniqueID (int index) const
 Returns the unique ID assigned to Particle with given index from the IndicesToUniqueID map. More...
 

Private Member Functions

Particle createCurrentParticle () const
 Create current particle object.
 
bool loadNextParticle (bool useAntiParticle)
 Loads the next combination. More...
 
bool loadNextSelfConjugatedParticle ()
 Loads the next combination. More...
 
bool currentCombinationHasDifferentSources ()
 Check that all FS particles of a combination differ. More...
 
bool currentCombinationIsUnique ()
 Check that the combination is unique. More...
 
bool currentCombinationIsECLCRUnique ()
 Check that: if the current combination has at least two particles from an ECL source, then they are from different connected regions or from the same connected region but have the same hypothesis. More...
 
void initIndicesToUniqueIDMap ()
 In the case input daughter particle lists collide (two or more lists contain copies of Particles) the Particle's Store Array index can not be longer used as its unique identifier, which is needed to check for uniqueness of accpeted combinations. More...
 
void fillIndicesToUniqueIDMap (const std::vector< int > &listA, const std::vector< int > &listB, int &uniqueID)
 Assigns unique IDs to all particles in list A, which do not have the unique ID already assigned. More...
 
void fillIndicesToUniqueIDMap (const std::vector< int > &listA, int &uniqueID)
 Assigns unique IDs to all particles in list A, which do not have the unique ID already assigned.
 

Private Attributes

int m_pdgCode
 PDG Code of the particle which is combined.
 
bool m_isSelfConjugated
 True if the combined particle is self-conjugated.
 
unsigned int m_iParticleType
 The type of particle which is currently generated.
 
int m_properties
 Particle property. More...
 
std::vector< int > m_daughterProperties
 Daughter's particle properties.
 
unsigned int m_numberOfLists
 Number of lists which are combined.
 
std::vector< StoreObjPtr< ParticleList > > m_plists
 particle lists
 
ListIndexGenerator m_listIndexGenerator
 listIndexGenerator makes the combinations of the types of sublists of the ParticleLists
 
ParticleIndexGenerator m_particleIndexGenerator
 particleIndexGenerator makes the combinations of indices stored in the sublists of the ParticleLists
 
const StoreArray< Particlem_particleArray
 Global list of particles.
 
std::vector< Particle * > m_particles
 Pointers to the particle objects of the current combination.
 
std::vector< int > m_indices
 Indices stored in the ParticleLists of the current combination.
 
std::unordered_set< std::set< int > > m_usedCombinations
 already used combinations (as sets of indices or unique IDs).
 
bool m_inputListsCollide
 True if the daughter lists can contain copies of Particles.
 
std::vector< std::pair< unsigned, unsigned > > m_collidingLists
 pairs of lists that can contain copies.
 
std::unordered_map< int, int > m_indicesToUniqueIDs
 map of store array indices of input Particles to their unique IDs. More...
 
std::unique_ptr< Variable::Cutm_cut
 cut object which performs the cuts
 
Particle m_current_particle
 The current Particle object generated by this combiner.
 

Detailed Description

ParticleGenerator is a generator for all the particles combined from the given ParticleLists.

Definition at line 126 of file ParticleCombiner.h.

Member Function Documentation

◆ inputListsCollide()

bool inputListsCollide ( ) const
inline

True if input lists collide (can contain copies of particles in the input lists).

When this is true the combiner uses specially determined unique particle's IDs instead of its StoreArray indices in order to check the uniqueness of each combination.

The function is needed only to (unit) test correct running of the combiner.

Definition at line 166 of file ParticleCombiner.h.

166 {return m_inputListsCollide; };
bool m_inputListsCollide
True if the daughter lists can contain copies of Particles.

Member Data Documentation

◆ m_indicesToUniqueIDs

std::unordered_map<int, int> m_indicesToUniqueIDs
private

map of store array indices of input Particles to their unique IDs.

Necessary if input lists collide.

Definition at line 278 of file ParticleCombiner.h.

◆ m_properties

int m_properties
private

Particle property.

Flags are defined in Particle::PropertyFlags

Definition at line 259 of file ParticleCombiner.h.


The documentation for this class was generated from the following files: