Belle II Software development
ParticleGenerator Class Reference

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

#include <ParticleCombiner.h>

Public Member Functions

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

Private Member Functions

Particle createCurrentParticle () const
 Create current particle object.
 
bool loadNextParticle (bool useAntiParticle)
 Loads the next combination.
 
bool loadNextSelfConjugatedParticle ()
 Loads the next combination.
 
bool currentCombinationHasDifferentSources ()
 Check that all FS particles of a combination differ.
 
bool currentCombinationIsUnique ()
 Check that the combination is unique.
 
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.
 
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 accepted combinations.
 
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.
 
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.
 
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.
 
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_collidingLists

std::vector<std::pair<unsigned, unsigned> > m_collidingLists
private

pairs of lists that can contain copies.

Definition at line 276 of file ParticleCombiner.h.

◆ m_current_particle

Particle m_current_particle
private

The current Particle object generated by this combiner.

Definition at line 282 of file ParticleCombiner.h.

◆ m_cut

std::unique_ptr<Variable::Cut> m_cut
private

cut object which performs the cuts

Definition at line 280 of file ParticleCombiner.h.

◆ m_daughterProperties

std::vector<int> m_daughterProperties
private

Daughter's particle properties.

Definition at line 260 of file ParticleCombiner.h.

◆ m_indices

std::vector<int> m_indices
private

Indices stored in the ParticleLists of the current combination.

Definition at line 272 of file ParticleCombiner.h.

◆ 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_inputListsCollide

bool m_inputListsCollide
private

True if the daughter lists can contain copies of Particles.

Definition at line 275 of file ParticleCombiner.h.

◆ m_iParticleType

unsigned int m_iParticleType
private

The type of particle which is currently generated.

Definition at line 258 of file ParticleCombiner.h.

◆ m_isSelfConjugated

bool m_isSelfConjugated
private

True if the combined particle is self-conjugated.

Definition at line 257 of file ParticleCombiner.h.

◆ m_listIndexGenerator

ListIndexGenerator m_listIndexGenerator
private

listIndexGenerator makes the combinations of the types of sublists of the ParticleLists

Definition at line 266 of file ParticleCombiner.h.

◆ m_numberOfLists

unsigned int m_numberOfLists
private

Number of lists which are combined.

Definition at line 262 of file ParticleCombiner.h.

◆ m_particleArray

const StoreArray<Particle> m_particleArray
private

Global list of particles.

Definition at line 270 of file ParticleCombiner.h.

◆ m_particleIndexGenerator

ParticleIndexGenerator m_particleIndexGenerator
private

particleIndexGenerator makes the combinations of indices stored in the sublists of the ParticleLists

Definition at line 268 of file ParticleCombiner.h.

◆ m_particles

std::vector<Particle*> m_particles
private

Pointers to the particle objects of the current combination.

Definition at line 271 of file ParticleCombiner.h.

◆ m_pdgCode

int m_pdgCode
private

PDG Code of the particle which is combined.

Definition at line 256 of file ParticleCombiner.h.

◆ m_plists

std::vector<StoreObjPtr<ParticleList> > m_plists
private

particle lists

Definition at line 263 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.

◆ m_usedCombinations

std::unordered_set<std::set<int> > m_usedCombinations
private

already used combinations (as sets of indices or unique IDs).

Definition at line 273 of file ParticleCombiner.h.


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