 |
Belle II Software
release-05-02-19
|
11 #ifndef MCPARTICLEGRAPH_H
12 #define MCPARTICLEGRAPH_H
14 #include <framework/core/FrameworkExceptions.h>
15 #include <framework/core/MemoryPool.h>
16 #include <mdst/dataobjects/MCParticle.h>
40 class MCParticleGraph {
51 BELLE2_DEFINE_EXCEPTION(NonContinousDaughtersError, "Can not represent decay graph, non continuous indices for daughters")
54 "A daughter particle was already assigned to a mother. A particle can't have two mothers!")
59 typedef std::pair<
unsigned int,
unsigned int> DecayLine;
267 void loadList(
const std::string& name =
"");
283 class ParticleSorter;
307 if (
this != mother.m_graph ||
this != daughter.m_graph)
throw NotSameGraphError();
309 m_decays.insert(DecayLine(mother.m_vertexId, daughter.m_vertexId));
310 daughter.m_primary =
false;
316 #endif //MCPARTICLEGRAPH_H
void generateList(const std::string &name="", int options=c_setNothing)
Generates the MCParticle list and stores it in the StoreArray with the given name.
void setTrackID(int trackID)
Set the track ID for the particle.
virtual ~MCParticleGraph()
Destructor.
int m_lastDaughter
1-based index of last daughter particle in collection, 0 if no daughters
size_t size() const
Return the number of particles in the graph.
void setIgnore(bool ignore=true)
Set or remove the ignore flag.
void setIndex(int index)
Set the 1-based index of the particle.
TClonesArray * m_plist
Internal pointer to DataStore Array containing particles belonging to this collection.
RelationsInterface & operator=(const RelationsInterface &relationsInterface)
Assignment operator.
bool m_primary
Is this a primary particle ?
int m_trackID
The track ID from geant4 that created this particle.
GraphOptions
The exception is thrown if a cyclic reference in the graph was detected.
Class to build, validate and sort a particle decay chain.
Class to go over all the particles in the Graph an sort them in a sensible way.
@ c_checkCyclic
Check for cyclic dependencies.
@ c_setNothing
Do nothing special.
GraphParticle & operator=(const MCParticle &particle)
Assign the values of an existing MCParticle to this GraphParticle.
@ c_setDecayTime
Set decay time to the largest production time of the daughters.
int getTrackID() const
Returns the track ID assigned to this MCParticle.
void loadList(const std::string &name="")
Load the MCParticle list given by name into the Graph.
@ c_setDecayInfo
Set decay time and vertex.
MCParticleGraph * m_graph
internal pointer to the graph this particle belongs to
GraphParticle(TClonesArray *, const MCParticle &)
Hide MCParticle "almost copy" constructor.
@ c_setDecayVertex
Set the decay vertex to the production vertex of the last daughter (ordered by production time)
void setLastDaughter(int daughter)
Set the 1-based index of the last daughter, 0 means no daughters.
int m_firstDaughter
1-based index of first daughter particle in collection, 0 if no daughters
Abstract base class for different kinds of events.
MCParticleGraph()
Constructor.
MemoryPool< GraphParticle > m_particles
internal list of particles
GraphParticle & addParticle()
Add new particle to the graph.
bool m_ignore
ignore particle when writing MCParticle list ?
GraphParticle()=delete
No default constructor.
int m_index
transient pointer to particle list
std::set< DecayLine > m_decays
internal set of decay lines
@ c_clearParticles
Clear the particle list before adding the graph.
void comesFrom(GraphParticle &mother)
Tells the graph that this particle is a decay product of mother.
A Class to store the Monte Carlo particle information.
void decaysInto(GraphParticle &daughter)
Tells the graph that this particle decays into daughter.
#define BELLE2_DEFINE_EXCEPTION(ClassName, Message)
Macro that defines an exception with the given message template.
void clear()
Reset particles and decay information to make the class reusable.
bool getIgnore() const
Get the ignore flag.
GraphParticle & operator[](size_t i)
Return reference to added particle with range check.
Class to represent Particle data in graph.
unsigned int m_vertexId
vertex id in the graph
void addDecay(GraphParticle &mother, GraphParticle &daughter)
Add decay information between two particles.
void setFirstDaughter(int daughter)
Set the 1-based index of the first daughter, 0 means no daughters.