11#include <framework/gearbox/Const.h>
12#include <framework/core/FrameworkExceptions.h>
13#include <framework/datastore/RelationsObject.h>
15#include <TClonesArray.h>
16#include <Math/Vector3D.h>
17#include <Math/Vector4D.h>
122 unsigned int getStatus(
unsigned short int bitmask = USHRT_MAX)
const {
return m_status & bitmask; }
508 virtual std::string
getName()
const override;
585 virtuality = (fabs(E2 - (p2 + m2)) >
c_epsilon * E2);
The DetectorSet class for sets of detector IDs in the form of EDetector values.
bool contains(const DetectorSet &set) const
Check whether this set contains another set.
If the content of two DataStores are merged using the 'MergeDataStoreModule', then Relations of the o...
A Class to store the Monte Carlo particle information.
float getEnergy() const
Return particle energy in GeV.
StatusBit
Exception is thrown if the requested index for the last child is out of range.
@ c_IsFSRPhoton
bit 7: Particle is from finial state radiation
@ c_Initial
bit 5: Particle is initial such as e+ or e- and not going to Geant4
@ c_IsPHOTOSPhoton
bit 8: Particle is an radiative photon from PHOTOS
@ c_IsRadiativePhoton
combined flag to test whether the particle is radiative
@ c_PrimaryParticle
bit 0: Particle is primary particle.
@ c_LeftDetector
bit 2: Particle left the detector (the simulation volume).
@ c_IsVirtual
bit 4: Particle is virtual and not going to Geant4.
@ c_StableInGenerator
bit 1: Particle is stable, i.e., not decaying in the generator.
@ c_StoppedInDetector
bit 3: Particle was stopped in the detector (the simulation volume).
@ c_IsISRPhoton
bit 6: Particle is from initial state radiation
void setDecayTime(float time)
Set decay time.
void setMass(float mass)
Set particle mass.
void setDecayVertex(const ROOT::Math::XYZVector &vertex)
Set decay vertex.
int m_lastDaughter
1-based index of last daughter particle in collection, 0 if no daughters
void removeSeenInDetector(Const::DetectorSet set)
Unflag/Remove the bit if the MC particle is not seen in a specific subdetector.
int getIndex() const
Get 1-based index of the particle in the corresponding MCParticle list.
void setInitial()
Set particle to initial.
ROOT::Math::XYZVector getDecayVertex() const
Return decay vertex.
float m_productionVertex_x
production vertex of particle, x component
int m_firstDaughter
1-based index of first daughter particle in collection, 0 if no daughters
float m_mass
mass of the particle
void setDecayVertex(float x, float y, float z)
Set decay vertex.
float m_decayVertex_z
decay vertex of particle, z component
virtual std::string getName() const override
Return name of this particle.
float getLifetime() const
Return the lifetime in ns.
void setMomentum(float px, float py, float pz)
Set particle momentum.
void addStatus(unsigned short int bitmask)
Add bitmask to current status.
void setEnergy(float energy)
Set energy.
Const::DetectorSet getSeenInDetector() const
Return the seen-in flags of the entire Belle II subdetectors for an MC particle.
float m_decayTime
decay time
const MCParticle * getParticleFromGeneralizedIndexString(const std::string &generalizedIndex) const
Explores the decay tree of the MC particle and returns the (grand^n)daughter identified by a generali...
void setProductionVertex(float x, float y, float z)
Set production vertex position.
bool hasSeenInDetector(Const::DetectorSet set) const
Return if the seen-in flag for a specific subdetector is set or not.
void setSeenInDetector(Const::DetectorSet set)
Set the seen-in flags for the entire Belle II subdetectors for an Monte Carlo particle.
float m_productionVertex_z
production vertex of particle, z component
std::vector< Belle2::MCParticle * > getDaughters() const
Get vector of all daughter particles, empty vector if none.
float getMass() const
Return the particle mass in GeV.
float m_energy
energy of the particle
static const double c_epsilon
limit of precision for two doubles to be the same.
bool hasStatus(unsigned short int bitmask) const
Return if specific status bit is set.
ROOT::Math::XYZVector getVertex() const
Return production vertex position, shorthand for getProductionVertex().
int getArrayIndex() const
Get 0-based index of the particle in the corresponding MCParticle list.
ROOT::Math::XYZVector getProductionVertex() const
Return production vertex position.
virtual std::string getInfoHTML() const override
Return a short summary of this object's contents in HTML format.
float getDecayTime() const
Return the decay time in ns.
void setValidVertex(bool valid)
Set indication wether vertex and time information is valid or just default.
float m_productionVertex_y
production vertex of particle, y component
int m_pdg
PDG-Code of the particle.
int m_mother
1-based index of the mother particle
void setProductionVertex(const ROOT::Math::XYZVector &vertex)
Set production vertex position.
float m_momentum_x
momentum of particle, x component
void setSecondaryPhysicsProcess(int physicsProcess)
Sets the physics process type of a secondary particle.
float m_decayVertex_x
decay vertex of particle, x component
const MCParticle * getDaughter(int i) const
Return i-th daughter.
bool hasValidVertex() const
Indication whether vertex and time information is useful or just default.
int getNDaughters() const
Return number of daughter MCParticles.
void removeStatus(unsigned short int bitmask)
Remove bitmask from current status.
unsigned int getStatus(unsigned short int bitmask=USHRT_MAX) const
Return status code of particle.
unsigned short int m_status
transient 1-based index of particle
int getLastDaughter() const
Get 1-based index of last daughter, 0 if no daughters.
float getCharge() const
Return the particle charge defined in TDatabasePDG.
void setVirtual()
Set particle to virtual.
float m_momentum_z
momentum of particle, z component
MCParticle(TClonesArray *plist, const MCParticle &p)
Construct MCParticle from a another MCParticle and the TClonesArray it is stored in.
ROOT::Math::PxPyPzEVector get4Vector() const
Return 4Vector of particle.
void fixParticleList() const
Search the DataStore for the corresponding MCParticle array.
void setPDG(int pdg)
Set PDG code of the particle.
int getPDG() const
Return PDG code of particle.
float getProductionTime() const
Return production time in ns.
void set4Vector(const ROOT::Math::PxPyPzEVector &p4)
Sets the 4Vector of particle.
int m_secondaryPhysicsProcess
physics process type of a secondary particle
ROOT::Math::XYZVector getMomentum() const
Return momentum.
bool m_validVertex
indication wether vertex and time information is useful or just default
void setMomentum(const ROOT::Math::XYZVector &momentum)
Set particle momentum.
float m_productionTime
production time
int m_index
transient pointer to particle list
void setStatus(unsigned short int status)
Set Status code for the particle.
void addSeenInDetector(Const::DetectorSet set)
Flag/Add a bit if the MC particle is seen in a specific subdetector.
float m_momentum_y
momentum of particle, y component
MCParticle()
Default constructor for ROOT.
Const::DetectorSet m_seenIn
Each bit is a seen-in flag for the corresoponding subdetector of Belle II.
TClonesArray * m_plist
Internal pointer to DataStore Array containing particles belonging to this collection.
int getFirstDaughter() const
Get 1-based index of first daughter, 0 if no daughters.
void setProductionTime(float time)
Set production time.
ClassDefOverride(MCParticle, 5)
A Class to store the Monte Carlo particle information.
void setMassFromPDG()
Sets the mass for the particle from the particle's PDG code.
float m_decayVertex_y
decay vertex of particle, y component
int getSecondaryPhysicsProcess() const
Returns the physics process type of a secondary particle.
Defines interface for accessing relations of objects in StoreArray.
#define BELLE2_DEFINE_EXCEPTION(ClassName, Message)
Macro that defines an exception with the given message template.
bool isInitial() const
Check if particle is an initial particle such as ISR.
MCParticle * getMother() const
Returns a pointer to the mother particle.
bool isPrimaryParticle() const
Check if particle is a primary particle which was created by the generator (and not,...
bool isVirtual() const
Check if particle is virtual.
Abstract base class for different kinds of events.