12 #include <framework/gearbox/Const.h>
13 #include <framework/datastore/StoreArray.h>
14 #include <mdst/dataobjects/Track.h>
15 #include <mdst/dataobjects/ECLCluster.h>
16 #include <analysis/dataobjects/Particle.h>
17 #include <analysis/DecayDescriptor/DecayDescriptor.h>
18 #include <analysis/DecayDescriptor/DecayDescriptorParticle.h>
19 #include <TMatrixFSym.h>
20 #include <TLorentzVector.h>
24 namespace TestUtilities {
31 class TestParticleFactory {
34 ~TestParticleFactory() {};
49 bool isString = decaydescriptor->
init(decayString);
51 B2INFO(
"Decay string is not defined: " << decayString);
52 delete decaydescriptor;
56 for (
auto& name : strNames) {
57 B2INFO(
"Creation of particle: " << name);
61 delete decaydescriptor;
70 int pdg = abs(particleDescription->
getPDGCode());
74 return Belle2::Particle::EParticleSourceObject::c_Track;
77 return Belle2::Particle::EParticleSourceObject::c_ECLCluster;
79 return Belle2::Particle::EParticleSourceObject::c_Composite;
86 const TVector3& vertex)
89 if (type == Belle2::Particle::EParticleSourceObject::c_Track) {
92 if (type == Belle2::Particle::EParticleSourceObject::c_ECLCluster) {
97 auto* motherDescriptor = particleDescriptor->
getMother();
98 B2INFO(
"Mother PDG: " << motherDescriptor->getPDGCode() <<
" selected: " << motherDescriptor->isSelected() <<
" name: " <<
99 motherDescriptor->getNameSimple());
100 unsigned int nDaughters = particleDescriptor->
getNDaughters();
102 for (
unsigned int i = 0; i < nDaughters; i++) {
104 B2INFO(
"\tDaughter PDG: " << daughter->getPDGCode() <<
" selected: " << daughter->isSelected() <<
" name: " <<
105 daughter->getNameSimple());
107 mother.appendDaughter(daughterParticle);
109 auto* result = myParticles.
appendNew(mother);
123 float eclREC = momentum[3];
133 B2INFO(
"\tParticle PDG: " << part->getPDGCode() <<
" charge: " << part->getCharge() <<
" momentum: " <<
134 part->getMomentumMagnitude() <<
" index: " << part->getArrayIndex() <<
" eclindex: " << part->getECLCluster()->getArrayIndex()
135 <<
" theta: " << part->getECLCluster()->getTheta());
144 const TVector3& vertex)
146 auto* particleDescription = particleDescriptor->
getMother();
147 TVector3 tmomentum(momentum[0], momentum[1], momentum[2]);
148 const float pValue = 0.5;
149 const float bField = 1.5;
153 const int charge = (particleDescription->
getPDGCode()) / abs(particleDescription->
getPDGCode()) * chargefactor;
154 unsigned long long int CDCValue =
static_cast<unsigned long long int>(0x300000000000000);
159 CDCValue, 16777215, 0);
165 B2INFO(
"\tParticle PDG: " << part->getPDGCode() <<
" charge: " << part->getCharge() <<
" charge: " << charge <<
" momentum: " <<
166 part->getMomentumMagnitude() <<
" index: " << part->getArrayIndex());