Belle II Software  release-05-02-19
TestParticleFactory Class Reference

This is a class, which generates DataStore particles, according to the provided decay string e.g. More...

#include <TestParticleFactory.h>

Public Member Functions

const Belle2::ParticleproduceParticle (const std::string &decayString, const TLorentzVector &momentum, const TVector3 &vertex)
 Main method to produce particles. More...
 
Belle2::Particle::EParticleSourceObject getType (const Belle2::DecayDescriptorParticle *particleDescription)
 Helper method to get EParticleSourceObject from PDG code.
 
const Belle2::ParticlecreateParticle (const Belle2::DecayDescriptor *particleDescriptor, const TLorentzVector &momentum, const TVector3 &vertex)
 This method is used for recursion.
 
const Belle2::ParticlecreatePhoton (const TLorentzVector &momentum)
 Creates different photons for tests.
 
const Belle2::ParticlecreateCharged (const Belle2::DecayDescriptor *particleDescriptor, const TLorentzVector &momentum, const TVector3 &vertex)
 Creates different charged particles for tests.
 

Private Attributes

int m_photonIndex
 Used to differentiate photons from one another.
 

Detailed Description

This is a class, which generates DataStore particles, according to the provided decay string e.g.

"^K_S0 -> ^pi+ ^pi-". All particles are added to Belle2::StoreArray<Belle2::Particle> It is primarily used in the ROE tests.

Definition at line 39 of file TestParticleFactory.h.

Member Function Documentation

◆ produceParticle()

const Belle2::Particle* produceParticle ( const std::string &  decayString,
const TLorentzVector &  momentum,
const TVector3 &  vertex 
)
inline

Main method to produce particles.

For simplification, all particles are created with the same momentum and decay vertex. If for example "^K_S0 -> ^pi+ ^pi-" decay string is provided as an argument, the factory will produce two daughter pions with opposite charges first, and then these pions will be used to form mother K_S0 particle which will be returned. The decay string can have any complexity and all PDG codes of allowed and charges will be respected.

Definition at line 61 of file TestParticleFactory.h.

69  {
70  int pdg = abs(particleDescription->getPDGCode());
71  if (pdg == Belle2::Const::pion.getPDGCode() || pdg == Belle2::Const::electron.getPDGCode()
72  || pdg == Belle2::Const::kaon.getPDGCode() || pdg == Belle2::Const::muon.getPDGCode()
73  || pdg == Belle2::Const::proton.getPDGCode()) {
74  return Belle2::Particle::EParticleSourceObject::c_Track;
75  }
76  if (pdg == Belle2::Const::photon.getPDGCode()) {
77  return Belle2::Particle::EParticleSourceObject::c_ECLCluster;
78  }
79  return Belle2::Particle::EParticleSourceObject::c_Composite;

The documentation for this class was generated from the following file:
Belle2::Const::photon
static const ParticleType photon
photon particle
Definition: Const.h:547
Belle2::Const::electron
static const ChargedStable electron
electron particle
Definition: Const.h:533
Belle2::Const::kaon
static const ChargedStable kaon
charged kaon particle
Definition: Const.h:536
Belle2::Const::pion
static const ChargedStable pion
charged pion particle
Definition: Const.h:535
Belle2::Const::proton
static const ChargedStable proton
proton particle
Definition: Const.h:537
Belle2::Const::muon
static const ChargedStable muon
muon particle
Definition: Const.h:534