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>
20namespace TestUtilities {
42 const ROOT::Math::XYZVector& vertex)
45 bool isString = decaydescriptor->
init(decayString);
47 B2INFO(
"Decay string is not defined: " << decayString);
48 delete decaydescriptor;
52 for (
auto& name : strNames) {
53 B2INFO(
"Creation of particle: " << name);
57 delete decaydescriptor;
66 int pdg = abs(particleDescription->
getPDGCode());
70 return Belle2::Particle::EParticleSourceObject::c_Track;
73 return Belle2::Particle::EParticleSourceObject::c_ECLCluster;
75 return Belle2::Particle::EParticleSourceObject::c_Composite;
82 const ROOT::Math::XYZVector& vertex)
85 if (type == Belle2::Particle::EParticleSourceObject::c_Track) {
88 if (type == Belle2::Particle::EParticleSourceObject::c_ECLCluster) {
93 auto* motherDescriptor = particleDescriptor->
getMother();
94 B2INFO(
"Mother PDG: " << motherDescriptor->getPDGCode() <<
" selected: " << motherDescriptor->isSelected() <<
" name: " <<
95 motherDescriptor->getNameSimple());
96 unsigned int nDaughters = particleDescriptor->
getNDaughters();
98 for (
unsigned int i = 0; i < nDaughters; i++) {
100 B2INFO(
"\tDaughter PDG: " << daughter->getPDGCode() <<
" selected: " << daughter->isSelected() <<
" name: " <<
101 daughter->getNameSimple());
105 auto* result = myParticles.
appendNew(mother);
128 B2INFO(
"\tParticle PDG: " << part->
getPDGCode() <<
" charge: " << part->
getCharge() <<
" momentum: " <<
139 const ROOT::Math::XYZVector& vertex)
141 auto* particleDescription = particleDescriptor->
getMother();
142 ROOT::Math::XYZVector tmomentum(momentum.X(), momentum.Y(), momentum.Z());
143 const float pValue = 0.5;
144 const float bField = 1.5;
148 const int charge = (particleDescription->getPDGCode()) / abs(particleDescription->getPDGCode()) * chargefactor;
149 unsigned long long int CDCValue =
static_cast<unsigned long long int>(0x300000000000000);
154 CDCValue, 16777215, 0);
160 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 DecayDescriptor * getDaughter(int i) const
return i-th daughter (0 based index).
int getNDaughters() const
return number of direct daughters.
std::vector< std::string > getSelectionNames()
Return list of human readable names of selected particles.
const DecayDescriptorParticle * getMother() const
return mother.
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.
void appendDaughter(const Particle *daughter, const bool updateType=true, const int daughterProperty=c_Ordinary)
Appends index of daughter to daughters index array.
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.
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
Accessor to arrays stored in the data store.
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 (index = -1) for a specific mass hypothesis...
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 * createPhoton(const ROOT::Math::PxPyPzEVector &momentum)
Creates different photons for tests.
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 ROOT::Math::XYZVector &vertex)
This method is used for recursion.
const Belle2::Particle * produceParticle(const std::string &decayString, const ROOT::Math::PxPyPzEVector &momentum, const ROOT::Math::XYZVector &vertex)
Main method to produce particles.
const Belle2::Particle * createCharged(const Belle2::DecayDescriptor *particleDescriptor, const ROOT::Math::PxPyPzEVector &momentum, const ROOT::Math::XYZVector &vertex)
Creates different charged particles for tests.