10 #include <framework/gearbox/Const.h>
11 #include <framework/datastore/StoreArray.h>
12 #include <mdst/dataobjects/Track.h>
13 #include <mdst/dataobjects/ECLCluster.h>
14 #include <analysis/dataobjects/Particle.h>
15 #include <analysis/DecayDescriptor/DecayDescriptor.h>
16 #include <analysis/DecayDescriptor/DecayDescriptorParticle.h>
17 #include <TMatrixFSym.h>
18 #include <TLorentzVector.h>
22 namespace TestUtilities {
46 bool isString = decaydescriptor->
init(decayString);
48 B2INFO(
"Decay string is not defined: " << decayString);
49 delete decaydescriptor;
53 for (
auto& name : strNames) {
54 B2INFO(
"Creation of particle: " << name);
58 delete decaydescriptor;
67 int pdg = abs(particleDescription->
getPDGCode());
71 return Belle2::Particle::EParticleSourceObject::c_Track;
74 return Belle2::Particle::EParticleSourceObject::c_ECLCluster;
76 return Belle2::Particle::EParticleSourceObject::c_Composite;
83 const TVector3& vertex)
86 if (type == Belle2::Particle::EParticleSourceObject::c_Track) {
89 if (type == Belle2::Particle::EParticleSourceObject::c_ECLCluster) {
94 auto* motherDescriptor = particleDescriptor->
getMother();
95 B2INFO(
"Mother PDG: " << motherDescriptor->getPDGCode() <<
" selected: " << motherDescriptor->isSelected() <<
" name: " <<
96 motherDescriptor->getNameSimple());
97 unsigned int nDaughters = particleDescriptor->
getNDaughters();
99 for (
unsigned int i = 0; i < nDaughters; i++) {
101 B2INFO(
"\tDaughter PDG: " << daughter->getPDGCode() <<
" selected: " << daughter->isSelected() <<
" name: " <<
102 daughter->getNameSimple());
104 mother.appendDaughter(daughterParticle);
106 auto* result = myParticles.
appendNew(mother);
120 float eclREC = momentum[3];
130 B2INFO(
"\tParticle PDG: " << part->getPDGCode() <<
" charge: " << part->getCharge() <<
" momentum: " <<
131 part->getMomentumMagnitude() <<
" index: " << part->getArrayIndex() <<
" eclindex: " << part->getECLCluster()->getArrayIndex()
132 <<
" theta: " << part->getECLCluster()->getTheta());
141 const TVector3& vertex)
143 auto* particleDescription = particleDescriptor->
getMother();
144 TVector3 tmomentum(momentum[0], momentum[1], momentum[2]);
145 const float pValue = 0.5;
146 const float bField = 1.5;
150 const int charge = (particleDescription->getPDGCode()) / abs(particleDescription->getPDGCode()) * chargefactor;
151 unsigned long long int CDCValue =
static_cast<unsigned long long int>(0x300000000000000);
156 CDCValue, 16777215, 0);
162 B2INFO(
"\tParticle PDG: " << part->getPDGCode() <<
" charge: " << part->getCharge() <<
" charge: " << charge <<
" momentum: " <<
163 part->getMomentumMagnitude() <<
" index: " << part->getArrayIndex());
Provides a type-safe way to pass members of the chargedStableSet set.
int getPDGCode() const
PDG code.
static const ChargedStable muon
muon particle
static const ChargedStable pion
charged pion particle
static const ChargedStable proton
proton particle
static const ChargedStable kaon
charged kaon particle
static const ParticleType photon
photon particle
static const ChargedStable electron
electron particle
Represents a particle in the DecayDescriptor.
int getPDGCode() const
Return PDG code.
The DecayDescriptor stores information about a decay tree or parts of a decay tree.
bool init(const std::string &str)
Initialise the DecayDescriptor from given string.
const DecayDescriptorParticle * getMother() const
return mother.
int getNDaughters() const
return number of direct daughters.
const DecayDescriptor * getDaughter(int i) const
return i-th daughter (0 based index).
std::vector< std::string > getSelectionNames()
Return list of human readable names of selected particles.
void setConnectedRegionId(int crid)
Set connected region id.
void setClusterId(int clusterid)
Set cluster id.
void setHypothesis(EHypothesisBit hypothesis)
Set hypotheses.
void setEnergy(double energy)
Set Corrected Energy (GeV).
void setIsTrack(bool istrack)
Set m_isTrack true if the cluster matches with a track.
@ c_nPhotons
CR is split into n photons (N1)
Class to store reconstructed particles.
EParticleSourceObject
particle source enumerators
T * appendNew()
Construct a new T object at the end of the array.
int getEntries() const
Get the number of objects in the array.
Class that bundles various TrackFitResults.
void setTrackFitResultIndex(const Const::ChargedStable &chargedStable, short index)
Set an index (for positive values) or unavailability-code (with negative values) for a specific mass ...
This is a class, which generates DataStore particles, according to the provided decay string e....
int m_photonIndex
Used to differentiate photons from one another.
const Belle2::Particle * createCharged(const Belle2::DecayDescriptor *particleDescriptor, const TLorentzVector &momentum, const TVector3 &vertex)
Creates different charged particles for tests.
const Belle2::Particle * produceParticle(const std::string &decayString, const TLorentzVector &momentum, const TVector3 &vertex)
Main method to produce particles.
Belle2::Particle::EParticleSourceObject getType(const Belle2::DecayDescriptorParticle *particleDescription)
Helper method to get EParticleSourceObject from PDG code.
const Belle2::Particle * createPhoton(const TLorentzVector &momentum)
Creates different photons for tests.
const Belle2::Particle * createParticle(const Belle2::DecayDescriptor *particleDescriptor, const TLorentzVector &momentum, const TVector3 &vertex)
This method is used for recursion.