 |
Belle II Software
release-05-01-25
|
14 #include <analysis/dataobjects/ParticleList.h>
15 #include <analysis/dataobjects/Particle.h>
16 #include <analysis/VariableManager/Utility.h>
17 #include <analysis/DecayDescriptor/DecayDescriptor.h>
19 #include <framework/datastore/StoreArray.h>
20 #include <framework/datastore/StoreObjPtr.h>
24 #include <unordered_set>
25 #include <unordered_map>
29 #include <boost/functional/hash/extensions.hpp>
33 template<>
struct hash<std::set<int>> {
35 std::size_t operator()(
const std::set<int>& v)
const
37 return boost::hash_value(v);
64 void init(
const std::vector<unsigned int>& _sizes);
83 std::vector<unsigned int>
sizes;
105 void init(
unsigned int _numberOfLists);
122 std::vector<ParticleList::EParticleType>
m_types;
138 explicit ParticleGenerator(
const std::string& decayString,
const std::string& cutParameter =
"");
155 bool loadNext(
bool loadAntiParticle =
true);
280 std::unordered_map<int, int>
283 std::unique_ptr<Variable::Cut>
m_cut;
std::vector< int > m_indices
Indices stored in the ParticleLists of the current combination.
std::vector< unsigned int > indices
The indices of the current loaded combination.
ListIndexGenerator m_listIndexGenerator
listIndexGenerator makes the combinations of the types of sublists of the ParticleLists
void initIndicesToUniqueIDMap()
In the case input daughter particle lists collide (two or more lists contain copies of Particles) the...
void init()
Initialises the generator to produce the given type of sublist.
int getUniqueID(int index) const
Returns the unique ID assigned to Particle with given index from the IndicesToUniqueID map.
int m_pdgCode
PDG Code of the particle which is combined.
bool loadNextParticle(bool useAntiParticle)
Loads the next combination.
const std::vector< ParticleList::EParticleType > & getCurrentIndices() const
Returns the type of the sublist of the current loaded combination.
bool loadNext(bool loadAntiParticle=true)
Loads the next combination.
ListIndexGenerator is a generator for all the combinations of the sublists (FlavorSpecificParticle = ...
bool m_isSelfConjugated
True if the combined particle is self-conjugated.
const StoreArray< Particle > m_particleArray
Global list of particles.
std::unique_ptr< Variable::Cut > m_cut
cut object which performs the cuts
void fillIndicesToUniqueIDMap(const std::vector< int > &listA, const std::vector< int > &listB, int &uniqueID)
Assignes unique IDs to all particles in list A, which do not have the unique ID already assigned.
std::vector< std::pair< unsigned, unsigned > > m_collidingLists
pairs of lists that can contain copies.
ListIndexGenerator()
Default constructor.
std::vector< ParticleList::EParticleType > m_types
The current types of sublist of the ParticleLists for this combination.
unsigned int m_numberOfLists
Number of lists which are combined.
ParticleIndexGenerator m_particleIndexGenerator
particleIndexGenerator makes the combinations of indices stored in the sublists of the ParticleLists
ParticleIndexGenerator()
Default constructor.
bool inputListsCollide() const
True if input lists collide (can contain copies of particles in the input lists).
void init(const std::vector< unsigned int > &_sizes)
Initialises the generator to produce combinations with the given sizes of each particle list.
std::vector< Particle * > m_particles
Pointers to the particle objects of the current combination.
bool currentCombinationHasDifferentSources()
Check that all FS particles of a combination differ.
ParticleGenerator(const std::string &decayString, const std::string &cutParameter="")
Initialises the generator to produce the given type of sublist.
ParticleIndexGenerator is a generator for all the combinations of the particle indices stored in the ...
Abstract base class for different kinds of events.
unsigned int m_numberOfLists
Number of lists which are combined.
std::unordered_map< int, int > m_indicesToUniqueIDs
map of store array indices of input Particles to their unique IDs.
Particle getCurrentParticle() const
Returns the particle.
bool loadNext()
Loads the next combination.
unsigned int m_nCombinations
The total amount of combinations.
std::vector< int > m_daughterProperties
Daughter's particle properties.
unsigned int m_iCombination
The current position of the combination.
unsigned int m_iParticleType
The type of particle which is currently generated.
unsigned int m_iCombination
The current position of the combination.
std::unordered_set< std::set< int > > m_usedCombinations
already used combinations (as sets of indices or unique IDs).
void init(unsigned int _numberOfLists)
Initialises the generator to produce the given type of sublist.
const std::vector< unsigned int > & getCurrentIndices() const
Returns theindices of the current loaded combination.
bool m_inputListsCollide
True if the daughter lists can contain copies of Particles.
Particle m_current_particle
The current Particle object generated by this combiner.
Class to store reconstructed particles.
std::vector< StoreObjPtr< ParticleList > > m_plists
particle lists
unsigned int m_nCombinations
The total amount of combinations.
bool currentCombinationIsECLCRUnique()
Check that: if the current combination has at least two particles from an ECL source,...
unsigned int m_numberOfLists
Number of lists which are combined.
The DecayDescriptor stores information about a decay tree or parts of a decay tree.
bool currentCombinationIsUnique()
Check that the combination is unique.
std::vector< unsigned int > sizes
The sizes of the particle lists which are combined.
Particle createCurrentParticle() const
Create current particle object.
int m_properties
Particle property.
bool loadNextSelfConjugatedParticle()
Loads the next combination.
ParticleGenerator is a generator for all the particles combined from the given ParticleLists.