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 <framework/geometry/B2Vector3.h>
21 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;
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());
106 auto* result = myParticles.
appendNew(mother);
129 B2INFO(
"\tParticle PDG: " << part->
getPDGCode() <<
" charge: " << part->
getCharge() <<
" momentum: " <<
142 auto* particleDescription = particleDescriptor->
getMother();
144 const float pValue = 0.5;
145 const float bField = 1.5;
149 const int charge = (particleDescription->getPDGCode()) / abs(particleDescription->getPDGCode()) * chargefactor;
150 unsigned long long int CDCValue =
static_cast<unsigned long long int>(0x300000000000000);
155 CDCValue, 16777215, 0);
161 B2INFO(
"\tParticle PDG: " << part->
getPDGCode() <<
" charge: " << part->
getCharge() <<
" charge: " << charge <<
" momentum: " <<
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).
double getTheta() const
Return Corrected Theta of Shower (radian).
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.
const ECLCluster * getECLCluster() const
Returns the pointer to the ECLCluster object that was used to create this Particle (if ParticleType =...
EParticleSourceObject
particle source enumerators
int getPDGCode(void) const
Returns PDG code.
double getCharge(void) const
Returns particle charge.
double getMomentumMagnitude() const
Returns momentum magnitude.
void appendDaughter(const Particle *daughter, const bool updateType=true)
Appends index of daughter to daughters index array.
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
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....
const Belle2::Particle * createCharged(const Belle2::DecayDescriptor *particleDescriptor, const ROOT::Math::PxPyPzEVector &momentum, const Belle2::B2Vector3D &vertex)
Creates different charged particles for tests.
int m_photonIndex
Used to differentiate photons from one another.
Belle2::Particle::EParticleSourceObject getType(const Belle2::DecayDescriptorParticle *particleDescription)
Helper method to get EParticleSourceObject from PDG code.
const Belle2::Particle * createParticle(const Belle2::DecayDescriptor *particleDescriptor, const ROOT::Math::PxPyPzEVector &momentum, const Belle2::B2Vector3D &vertex)
This method is used for recursion.
const Belle2::Particle * createPhoton(const ROOT::Math::PxPyPzEVector &momentum)
Creates different photons for tests.
const Belle2::Particle * produceParticle(const std::string &decayString, const ROOT::Math::PxPyPzEVector &momentum, const Belle2::B2Vector3D &vertex)
Main method to produce particles.