9 #include <analysis/dataobjects/Particle.h>
10 #include <analysis/dataobjects/ParticleExtraInfoMap.h>
12 #include <analysis/ClusterUtility/ClusterUtils.h>
14 #include <mdst/dataobjects/KLMCluster.h>
15 #include <mdst/dataobjects/MCParticle.h>
16 #include <mdst/dataobjects/PIDLikelihood.h>
17 #include <mdst/dataobjects/Track.h>
18 #include <mdst/dataobjects/TrackFitResult.h>
19 #include <mdst/dataobjects/V0.h>
20 #include <mdst/dbobjects/CollisionBoostVector.h>
21 #include <mdst/dbobjects/CollisionInvariantMass.h>
23 #include <framework/datastore/StoreArray.h>
24 #include <framework/datastore/StoreObjPtr.h>
25 #include <framework/database/DBObjPtr.h>
26 #include <framework/logging/Logger.h>
27 #include <framework/utilities/HTML.h>
28 #include <framework/utilities/Conversion.h>
30 #include <TClonesArray.h>
31 #include <TDatabasePDG.h>
32 #include <TMatrixFSym.h>
39 #include <boost/algorithm/string.hpp>
44 m_pdgCode(0), m_mass(0), m_px(0), m_py(0), m_pz(0), m_x(0), m_y(0), m_z(0),
45 m_pValue(nan(
"")), m_flavorType(c_Unflavored), m_particleSource(c_Undefined), m_mdstIndex(0), m_properties(0),
46 m_arrayPointer(nullptr)
53 m_pdgCode(pdgCode), m_mass(0), m_px(0), m_py(0), m_pz(0), m_x(0), m_y(0), m_z(0),
54 m_pValue(-1), m_flavorType(c_Unflavored), m_particleSource(c_Undefined), m_mdstIndex(0), m_properties(0), m_arrayPointer(nullptr)
66 const unsigned mdstIndex) :
67 m_pdgCode(pdgCode), m_mass(0), m_px(0), m_py(0), m_pz(0), m_x(0), m_y(0), m_z(0),
68 m_pValue(-1), m_flavorType(flavorType), m_particleSource(source), m_properties(0), m_arrayPointer(nullptr)
82 const std::vector<int>& daughterIndices,
83 TClonesArray* arrayPointer) :
84 m_pdgCode(0), m_mass(0), m_px(0), m_py(0), m_pz(0), m_x(0), m_y(0), m_z(0),
86 m_daughterIndices(daughterIndices),
87 m_flavorType(c_Unflavored), m_particleSource(c_Undefined), m_mdstIndex(0),
88 m_properties(0), m_arrayPointer(arrayPointer)
97 if (!daughterIndices.empty()) {
100 B2FATAL(
"Composite Particle (with daughters) was constructed outside StoreArray without specifying daughter array!");
111 const std::vector<int>& daughterIndices,
112 const int properties,
113 TClonesArray* arrayPointer) :
114 m_pdgCode(0), m_mass(0), m_px(0), m_py(0), m_pz(0), m_x(0), m_y(0), m_z(0),
116 m_daughterIndices(daughterIndices),
117 m_flavorType(c_Unflavored), m_particleSource(c_Undefined), m_mdstIndex(0),
118 m_arrayPointer(arrayPointer)
128 if (!daughterIndices.empty()) {
131 B2FATAL(
"Composite Particle (with daughters) was constructed outside StoreArray without specifying daughter array!");
143 const std::vector<int>& daughterIndices,
144 const int properties,
145 const std::vector<int>& daughterProperties,
146 TClonesArray* arrayPointer) :
147 m_pdgCode(0), m_mass(0), m_px(0), m_py(0), m_pz(0), m_x(0), m_y(0), m_z(0),
149 m_daughterIndices(daughterIndices),
150 m_flavorType(c_Unflavored), m_particleSource(c_Undefined), m_mdstIndex(0),
151 m_daughterProperties(daughterProperties),
152 m_arrayPointer(arrayPointer)
162 if (!daughterIndices.empty()) {
165 B2FATAL(
"Composite Particle (with daughters) was constructed outside StoreArray without specifying daughter array!");
173 Particle(track ? track->getArrayIndex() : 0, track ? track->getTrackFitResultWithClosestMass(chargedStable) : nullptr,
181 m_pdgCode(0), m_mass(0), m_px(0), m_py(0), m_pz(0), m_x(0), m_y(0), m_z(0),
182 m_pValue(-1), m_flavorType(c_Unflavored), m_particleSource(c_Undefined), m_mdstIndex(0), m_properties(0), m_arrayPointer(nullptr)
184 if (!trackFit)
return;
195 if (TDatabasePDG::Instance()->GetParticle(
m_pdgCode) ==
nullptr)
196 B2FATAL(
"PDG=" <<
m_pdgCode <<
" ***code unknown to TDatabasePDG");
208 m_pdgCode(0), m_mass(0), m_px(0), m_py(0), m_pz(0), m_x(0), m_y(0), m_z(0),
209 m_pValue(-1), m_flavorType(c_Unflavored), m_particleSource(c_Undefined), m_mdstIndex(0), m_properties(0), m_arrayPointer(nullptr)
211 if (!trackFit)
return;
222 if (TDatabasePDG::Instance()->GetParticle(
m_pdgCode) ==
nullptr)
223 B2FATAL(
"PDG=" <<
m_pdgCode <<
" ***code unknown to TDatabasePDG");
232 m_pdgCode(type.getPDGCode()), m_mass(type.getMass()), m_px(0), m_py(0), m_pz(0), m_x(0), m_y(0), m_z(0),
233 m_pValue(-1), m_flavorType(c_Unflavored), m_particleSource(c_Undefined), m_mdstIndex(0), m_properties(0), m_arrayPointer(nullptr)
235 if (!eclCluster)
return;
246 m_px = clustermom.Px();
247 m_py = clustermom.Py();
248 m_pz = clustermom.Pz();
276 TMatrixD scaledJacobi(4, 6);
280 for (
int irow = 0; irow < 4; irow++) {
281 for (
int icol = 0; icol < 6; icol++) {
282 if (icol != 0 && irow != 3) {
302 m_pdgCode(0), m_mass(0), m_px(0), m_py(0), m_pz(0), m_x(0), m_y(0), m_z(0),
303 m_pValue(-1), m_flavorType(c_Unflavored), m_particleSource(c_Undefined), m_mdstIndex(0), m_properties(0), m_arrayPointer(nullptr)
305 if (!klmCluster)
return;
328 m_pdgCode(0), m_mass(0), m_px(0), m_py(0), m_pz(0), m_x(0), m_y(0), m_z(0),
329 m_pValue(-1), m_flavorType(c_Unflavored), m_particleSource(c_Undefined), m_mdstIndex(0), m_properties(0), m_arrayPointer(nullptr)
331 if (!mcParticle)
return;
364 const int crid = cluster->getConnectedRegionId();
365 const int clusterid = cluster->getClusterId();
368 B2ERROR(
"Particle is of type = ECLCluster has identifier not set and no relation to ECLCluster.\n"
369 "This has happen because old microDST is analysed with newer version of software.");
388 const int crid = cluster->getConnectedRegionId();
389 const int clusterid = cluster->getClusterId();
390 identifier = 1000 * crid + clusterid;
392 B2ERROR(
"Particle is of type = ECLCluster has identifier not set and no relation to ECLCluster.\n"
393 "This has happen because old microDST is analysed with newer version of software.");
407 if (m.GetNrows() != c_DimMatrix || m.GetNcols() != c_DimMatrix) {
409 B2WARNING(
"Error Matrix is not 7x7 ");
421 if (m.GetNrows() != 4 || m.GetNcols() != 6) {
423 B2WARNING(
"Jacobi Matrix is not 4x6 ");
432 TMatrixFSym m(c_DimMatrix);
435 for (
int irow = 0; irow < c_DimMatrix; irow++) {
436 for (
int icol = irow; icol < c_DimMatrix; icol++) {
437 m(irow, icol) = m(icol, irow) =
m_errMatrix[element];
452 full.GetSub(0, 3, mom,
"S");
464 full.GetSub(4, 6, pos,
"S");
475 TLorentzVector pMother;
477 pMother = mother->get4Vector();
481 pMother.SetE(cmsMass->getMass());
482 pMother.Boost(cmsBoost->getBoost());
484 pMother.Boost(boost);
487 TLorentzVector pDaughter;
490 pDaughter.Boost(boost);
495 pDaughter = daughter->get4Vector();
498 pDaughter.Boost(boost);
501 pDaughter0.Boost(boost);
503 pDaughter1.Boost(boost);
504 pDaughter.SetVect(pDaughter0.Vect().Cross(pDaughter1.Vect()));
508 double mag2 = pMother.Vect().Mag2() * pDaughter.Vect().Mag2();
509 if (mag2 <= 0)
return std::numeric_limits<float>::quiet_NaN();
510 return (-pMother.Vect()) * pDaughter.Vect() / sqrt(mag2);
517 B2ERROR(
"No daughter of particle 'name' with index 'iDaughter' for calculation of helicity angle"
519 return std::numeric_limits<float>::quiet_NaN();
524 TVector3 boost = -daughter->get4Vector().BoostVector();
528 pMother.Boost(boost);
531 if (daughter->getNDaughters() <= iGrandDaughter) {
532 B2ERROR(
"No grand daughter of daughter 'iDaughter' of particle 'name' with index 'iGrandDaughter' for calculation of helicity angle"
534 return std::numeric_limits<float>::quiet_NaN();
538 TLorentzVector pGrandDaughter = daughter->getDaughter(iGrandDaughter)->get4Vector();
539 pGrandDaughter.Boost(boost);
541 double mag2 = pMother.Vect().Mag2() * pGrandDaughter.Vect().Mag2();
542 if (mag2 <= 0)
return std::numeric_limits<float>::quiet_NaN();
543 return (-pMother.Vect()) * pGrandDaughter.Vect() / sqrt(mag2);
550 B2ERROR(
"Cannot calculate acoplanarity of particle 'name' because the number of daughters is not 2"
552 return std::numeric_limits<float>::quiet_NaN();
557 B2ERROR(
"Cannot calculate acoplanarity of particle 'name' because the number of grand daughters is not 2"
560 return std::numeric_limits<float>::quiet_NaN();
567 TLorentzVector pDaughter0 = daughter0->
get4Vector();
568 pDaughter0.Boost(boost);
570 pGrandDaughter0.Boost(boost);
571 TLorentzVector pDaughter1 = daughter1->
get4Vector();
572 pDaughter1.Boost(boost);
574 pGrandDaughter1.Boost(boost);
577 TVector3 normal0 = pDaughter0.Vect().Cross(pGrandDaughter0.Vect());
578 TVector3 normal1 = -pDaughter1.Vect().Cross(pGrandDaughter1.Vect());
579 double result = normal0.Angle(normal1);
580 if (normal0.Cross(normal1) * pDaughter0.Vect() < 0) result = -result;
616 if (TDatabasePDG::Instance()->GetParticle(pdgCode) ==
nullptr)
617 B2FATAL(
"PDG=" << pdgCode <<
" ***code unknown to TDatabasePDG");
618 m_mass = TDatabasePDG::Instance()->GetParticle(pdgCode)->Mass() ;
623 if (TDatabasePDG::Instance()->GetParticle(
m_pdgCode) ==
nullptr) {
624 B2ERROR(
"PDG=" <<
m_pdgCode <<
" ***code unknown to TDatabasePDG");
627 return TDatabasePDG::Instance()->GetParticle(
m_pdgCode)->Mass();
632 if (TDatabasePDG::Instance()->GetParticle(
m_pdgCode) ==
nullptr) {
633 B2ERROR(
"PDG=" <<
m_pdgCode <<
" ***code unknown to TDatabasePDG");
636 return TDatabasePDG::Instance()->GetParticle(
m_pdgCode)->Charge() / 3.0;
648 std::vector<Particle*> daughters(nDaughters);
651 for (
unsigned i = 0; i < nDaughters; i++)
659 std::vector<const Particle*> fspDaughters;
667 std::vector<int> mdstIndices;
670 if (fsp->getParticleSource() == source)
671 mdstIndices.push_back(fsp->getMdstArrayIndex());
713 for (
auto& thisFSP : thisFSPs)
714 for (
auto& otherFSP : otherFSPs)
715 if (thisFSP->getMdstSource() == otherFSP->getMdstSource())
735 std::vector<int> thisDecayChain(nDaughters * 2);
736 std::vector<int> othrDecayChain(nDaughters * 2);
738 for (
unsigned i = 0; i < nDaughters; i++) {
747 sort(thisDecayChain.begin(), thisDecayChain.end());
748 sort(othrDecayChain.begin(), othrDecayChain.end());
750 for (
unsigned i = 0; i < thisDecayChain.size(); i++)
751 if (thisDecayChain[i] != othrDecayChain[i])
759 if (!doDetailedComparison)
767 B2WARNING(
"Something went wrong: MCParticle is being compared to a non MC Particle. Please check your script!\n"
768 " If the MCParticle <-> Particle comparison happens in the RestOfEventBuilder,\n"
769 " the Rest Of Event may contain signal side particles.");
826 auto* selfrelated = this->getRelatedTo<TrackFitResult>();
833 return selftrack->getTrackFitResultWithClosestMass(
869 const ECLCluster* bestTrackMatchedCluster =
nullptr;
870 double highestEnergy = -1.0;
879 bestTrackMatchedCluster = &cluster;
882 return bestTrackMatchedCluster;
891 if (!cluster)
return 0;
917 const MCParticle* related = this->getRelated<MCParticle>();
928 std::vector<std::string> generalizedIndexes;
929 boost::split(generalizedIndexes, generalizedIndex, boost::is_any_of(
":"));
931 if (generalizedIndexes.empty()) {
932 B2WARNING(
"Generalized index of daughter particle is empty. Skipping.");
943 for (
auto& indexString : generalizedIndexes) {
947 dauIndex = Belle2::convertString<int>(indexString);
948 }
catch (std::invalid_argument&) {
949 B2WARNING(
"Found the string " << indexString <<
"instead of a daughter index.");
954 if (dauIndex >=
int(currentPart->
getNDaughters()) or dauIndex < 0) {
955 B2WARNING(
"Daughter index " << dauIndex <<
" out of range");
956 B2WARNING(
"Trying to access non-existing particle.");
960 currentPart = dauPart;
985 constexpr
unsigned order[] = {c_X, c_Y, c_Z, c_Px, c_Py, c_Pz};
987 TMatrixFSym errMatrix(c_DimMatrix);
988 for (
int i = 0; i < 6; i++) {
989 for (
int j = i; j < 6; j++) {
992 errMatrix(order[j], order[i]) = errMatrix(order[i], order[j]) = cov6(i, j);
1013 constexpr
unsigned compMom[] = {c_Px, c_Py, c_Pz};
1014 constexpr
unsigned compPos[] = {c_X, c_Y, c_Z};
1017 for (
unsigned int i : compMom) {
1019 for (
int k = 0; k < 3; k++) {
1020 Cov += errMatrix(i, compMom[k]) * dEdp[k];
1022 errMatrix(i, c_E) = Cov;
1026 for (
unsigned int comp : compPos) {
1028 for (
int k = 0; k < 3; k++) {
1029 Cov += errMatrix(comp, compMom[k]) * dEdp[k];
1031 errMatrix(c_E, comp) = Cov;
1036 for (
int i = 0; i < 3; i++) {
1037 Cov += errMatrix(compMom[i], compMom[i]) * dEdp[i] * dEdp[i];
1039 for (
int i = 0; i < 3; i++) {
1040 int k = (i + 1) % 3;
1041 Cov += 2 * errMatrix(compMom[i], compMom[k]) * dEdp[i] * dEdp[k];
1043 errMatrix(c_E, c_E) = Cov;
1063 for (
int irow = 0; irow < c_DimMatrix; irow++) {
1064 for (
int icol = irow; icol < c_DimMatrix; icol++) {
1074 for (
int irow = 0; irow < 4; irow++) {
1075 for (
int icol = 0; icol < 6; icol++) {
1087 fspDaughters.push_back(
this);
1115 int q3 = nnn % 10; nnn /= 10;
1116 int q2 = nnn % 10; nnn /= 10;
1123 return TDatabasePDG::Instance()->GetParticle(
m_pdgCode)->GetName();
1133 std::vector<std::string> out;
1137 B2FATAL(
"ParticleExtraInfoMap not available, but needed for storing extra info in Particle!");
1139 for (
auto const& ee : map) out.push_back(ee.first);
1146 std::stringstream stream;
1147 stream << std::setprecision(4);
1150 stream <<
" <b>PDGCode</b>=" <<
m_pdgCode;
1151 stream <<
" <b>Charge</b>=" <<
getCharge();
1152 stream <<
" <b>PDGMass</b>=" <<
getPDGMass();
1162 stream <<
" <b>daughterIndices</b>: ";
1164 stream << daughterIndex <<
", ";
1170 stream <<
" <b>daughter PDGCodes</b>: ";
1173 if (p) {stream << p->getPDGCode() <<
", ";}
1174 else {stream <<
"?, ";}
1179 stream <<
" <b>mass</b>=" <<
m_mass;
1183 stream <<
" <b>p</b>=" <<
getP();
1192 stream <<
" <b>p-value of fit</b> (if done): ";
1196 stream <<
" <b>error matrix</b> (px, py, pz, E, x, y ,z):<br>";
1199 stream <<
" <b>extra info</b>=( ";
1202 if (!extraInfoMap) {
1203 B2FATAL(
"ParticleExtraInfoMap not available, but needed for storing extra info in Particle!");
1207 for (
const auto& pair : map) {
1208 if (pair.second < nVars) {
1209 stream << pair.first <<
"=" <<
m_extraInfo[pair.second] <<
" ";
1214 stream <<
") " <<
"<br>";
1216 return stream.str();
1227 if (!extraInfoMap) {
1228 B2FATAL(
"ParticleExtraInfoMap not available, but needed for storing extra info in Particle!");
1230 unsigned int index = extraInfoMap->getIndex(mapID, name);
1245 throw std::runtime_error(std::string(
"getExtraInfo: Value '") + name +
"' not found in Particle!");
1250 if (!extraInfoMap) {
1251 B2FATAL(
"ParticleExtraInfoMap not available, but needed for storing extra info in Particle!");
1253 unsigned int index = extraInfoMap->getIndex(mapID, name);
1255 throw std::runtime_error(std::string(
"getExtraInfo: Value '") + name +
"' not found in Particle!");
1273 throw std::runtime_error(std::string(
"setExtraInfo: Value '") + name +
"' not found in Particle!");
1278 if (!extraInfoMap) {
1279 B2FATAL(
"ParticleExtraInfoMap not available, but needed for storing extra info in Particle!");
1281 unsigned int index = extraInfoMap->getIndex(mapID, name);
1283 throw std::runtime_error(std::string(
"setExtraInfo: Value '") + name +
"' not found in Particle!");
1292 throw std::runtime_error(std::string(
"addExtraInfo: Value '") + name +
"' already set!");
1298 unsigned int mapID = extraInfoMap->getMapForNewVar(name);
1304 unsigned int mapID = extraInfoMap->getMapForNewVar(name, oldMapID, insertIndex);
1312 bool recursive,
bool includeSelf)
const
1314 std::queue<const Particle*> qq;
1323 while (!qq.empty()) {
1325 if (
function(p))
return true;
1329 if (recursive || p ==
this)
1330 for (
size_t i = 0; i < p->getNDaughters(); ++i) qq.push(p->getDaughter(i));
1338 int PDGCode = absPDGCode * chargeSign;
Class to provide momentum-related information from ECLClusters.
const TLorentzVector Get4MomentumFromCluster(const ECLCluster *cluster, ECLCluster::EHypothesisBit hypo)
Returns four momentum vector.
const TMatrixDSym GetCovarianceMatrix7x7FromCluster(const ECLCluster *cluster, const TMatrixD &jacobiMatrix)
Returns 7x7 covariance matrix (px, py, pz, E, x, y, z)
const TMatrixD GetJacobiMatrix4x6FromCluster(const ECLCluster *cluster, ECLCluster::EHypothesisBit hypo)
Returns 4x6 Jacobi matrix (px, py, pz, E)
const TVector3 GetIPPosition()
Returns default IP position from beam parameters.
const TMatrixDSym GetIPPositionCovarianceMatrix()
Returns default IP position covariance matrix from beam parameters.
Provides a type-safe way to pass members of the chargedStableSet set.
The ParticleType class for identifying different particle types.
int getPDGCode() const
PDG code.
static const ParticleType pi0
neutral pion particle
static const ChargedStable muon
muon particle
static const ParticleType Klong
K^0_L particle.
static const ParticleType Kshort
K^0_S particle.
static const ParticleType photon
photon particle
static const ChargedStable electron
electron particle
Class for accessing objects in the database.
bool isTrack() const
Return true if the cluster matches with track.
int getConnectedRegionId() const
Return connected region id.
@ c_nPhotons
CR is split into n photons (N1)
TVector3 getPosition() const
Get global position (TVector3 version) of the origin of KLMCluster (always return (0,...
TLorentzVector getMomentum() const
Get momentum.
A Class to store the Monte Carlo particle information.
float getMass() const
Return the particle mass in GeV.
int getArrayIndex() const
Get 0-based index of the particle in the corresponding MCParticle list.
TVector3 getVertex() const
Return production vertex position, shorthand for getProductionVertex().
TVector3 getMomentum() const
Return momentum.
int getPDG() const
Return PDG code of particle.
Class to collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM aimed for output to mdst includes...
Const::ChargedStable getMostLikely(const double *fractions=0, Const::PIDDetectorSet set=Const::PIDDetectorSet::set()) const
Return most likely particle among chargedStableSet; if prior fractions not given equal prior probabil...
std::map< std::string, unsigned int > IndexMap
string -> index map.
Class to store reconstructed particles.
void removeExtraInfo()
Remove all stored extra info fields.
void updateJacobiMatrix()
Propagate the photon energy scaling to jacobian elements that were calculated using energy.
TMatrixFSym getVertexErrorMatrix() const
Returns the 3x3 position error sub-matrix.
float getEnergy() const
Returns total energy.
bool isMostLikely() const
Returns true if the (track-based) particle is created with its most likely mass hypothesis.
const KLMCluster * getKLMCluster() const
Returns the pointer to the KLMCluster object that was used to create this Particle (ParticleType == c...
const Track * getTrack() const
Returns the pointer to the Track object that was used to create this Particle (ParticleType == c_Trac...
void setMomentumPositionErrorMatrix(const TrackFitResult *trackFit)
Sets the momentum, position and error matrix for this particle (created from charged Track)
void set4Vector(const TLorentzVector &p4)
Sets Lorentz vector.
void storeErrorMatrix(const TMatrixFSym &errMatrix)
Stores 7x7 error matrix into private member m_errMatrix.
bool forEachDaughter(const std::function< bool(const Particle *)> &function, bool recursive=true, bool includeSelf=true) const
Apply a function to all daughters of this particle.
std::vector< const Belle2::Particle * > getFinalStateDaughters() const
Returns a vector of pointers to Final State daughter particles.
const MCParticle * getMCParticle() const
Returns the pointer to the MCParticle object that was used to create this Particle (ParticleType == c...
const ECLCluster * getECLCluster() const
Returns the pointer to the ECLCluster object that was used to create this Particle (if ParticleType =...
EParticleSourceObject
particle source enumerators
float m_mass
particle (invariant) mass
int m_pdgCodeUsedForFit
PDG code used for the track fit.
std::string getName() const override
Return name of this particle.
bool overlapsWith(const Particle *oParticle) const
Returns true if final state ancestors of oParticle overlap.
void writeExtraInfo(const std::string &name, const float value)
Sets the user defined extraInfo.
TClonesArray * getArrayPointer() const
Returns the pointer to the store array which holds the daughter particles.
float getAcoplanarity() const
Returns acoplanarity angle defined as the angle between the decay planes of the grand daughters in th...
std::vector< std::string > getExtraInfoNames() const
get a list of the extra info names
bool isCopyOf(const Particle *oParticle, bool doDetailedComparison=false) const
Returns true if this Particle and oParticle are copies of each other.
std::vector< int > getMdstArrayIndices(EParticleSourceObject type) const
Returns a vector of StoreArray indices of given MDST dataobjects.
void setVertex(const TVector3 &vertex)
Sets position (decay vertex)
float getExtraInfo(const std::string &name) const
Return given value if set.
void resetJacobiMatrix()
Resets 4x6 error matrix All elements are set to 0.0.
float getPDGMass(void) const
Returns uncertainty on the invariant mass (requires valid momentum error matrix)
void storeJacobiMatrix(const TMatrixF &jacobiMatrix)
Stores 4x6 Jacobi matrix into private member m_jacobiMatrix.
unsigned m_mdstIndex
0-based index of MDST store array object
void setFlavorType()
sets m_flavorType using m_pdgCode
int getMdstSource() const
Returns unique identifier of final state particle (needed in particle combiner)
float m_errMatrix[c_SizeMatrix]
error matrix (1D representation)
float m_pValue
chi^2 probability of the fit.
bool hasExtraInfo(const std::string &name) const
Return whether the extra info with the given name is set.
std::string getInfoHTML() const override
Return a short summary of this object's contents in HTML format.
float getCosHelicity(const Particle *mother=nullptr) const
Returns cosine of the helicity angle The helicity angle is defined in the rest frame of the particle ...
TVector3 getVertex() const
Returns vertex position (POCA for charged, IP for neutral FS particles)
void setMdstArrayIndex(const int arrayIndex)
set mdst array index
TVector3 getMomentum() const
Returns momentum vector.
const Particle * getParticleFromGeneralizedIndexString(const std::string &generalizedIndex) const
Explores the decay tree of the particle and returns the (grand^n)daughter identified by a generalized...
float m_jacobiMatrix[c_SizeMatrix]
error matrix (1D representation)
float m_py
momentum component y
void fillFSPDaughters(std::vector< const Belle2::Particle * > &fspDaughters) const
Fill final state particle daughters into a vector.
const PIDLikelihood * getPIDLikelihood() const
Returns the pointer to the PIDLikelihood object that is related to the Track, which was used to creat...
const V0 * getV0() const
Returns the pointer to the V0 object that was used to create this Particle (if ParticleType == c_V0).
EParticleSourceObject m_particleSource
(mdst) source of particle
void fillDecayChain(std::vector< int > &decayChain) const
Fill vector with (PDGCode, MdstSource) pairs for the entire decay chain.
int getPDGCode(void) const
Returns PDG code.
void addExtraInfo(const std::string &name, float value)
Sets the user-defined data of given name to the given value.
float getCharge(void) const
Returns particle charge.
float getP() const
Returns momentum magnitude (same as getMomentumMagnitude but with shorter name)
unsigned getNDaughters(void) const
Returns number of daughter particles.
std::vector< Belle2::Particle * > getDaughters() const
Returns a vector of pointers to daughter particles.
void resetErrorMatrix()
Resets 7x7 error matrix All elements are set to 0.0.
EFlavorType m_flavorType
flavor type.
float m_pz
momentum component z
int generatePDGCodeFromCharge(const int chargedSign, const Const::ChargedStable &chargedStable)
Generate the PDG code with correct sign, using the charge.
Particle()
Default constructor.
TMatrixFSym getMomentumErrorMatrix() const
Returns the 4x4 momentum error matrix.
std::vector< int > m_daughterProperties
daughter particle properties
float m_px
momentum component x
std::vector< int > m_daughterIndices
daughter particle indices
TLorentzVector get4Vector() const
Returns Lorentz vector.
void setJacobiMatrix(const TMatrixF &jacobiMatrix)
Sets 4x6 jacobi matrix.
void setMomentumVertexErrorMatrix(const TMatrixFSym &errMatrix)
Sets 7x7 error matrix.
EParticleSourceObject getParticleSource() const
Returns particle source as defined with enum EParticleSourceObject.
void updateMass(const int pdgCode)
Updates particle mass with the mass of the particle corresponding to the given PDG.
void print() const
Prints the contents of a Particle object to standard output.
EFlavorType
describes flavor type, see getFlavorType().
@ c_Unflavored
Is its own antiparticle or we don't know whether it is a particle/antiparticle.
@ c_Flavored
Is either particle or antiparticle.
TMatrixFSym getMomentumVertexErrorMatrix() const
Returns 7x7 error matrix.
double getECLClusterEnergy() const
Returns the energy of the ECLCluster for the particle.
const TrackFitResult * getTrackFitResult() const
Returns the pointer to the TrackFitResult that was used to create this Particle (ParticleType == c_Tr...
void removeDaughter(const Particle *daughter, const bool updateType=true)
Removes index of daughter from daughters index array.
float getCosHelicityDaughter(unsigned iDaughter, unsigned iGrandDaughter=0) const
Returns cosine of the helicity angle of the given daughter defined by given grand daughter.
int m_identifier
Identifier that can be used to identify whether the particle is unique or is a copy or representation...
float m_momentumScale
momentum scaling factor
void appendDaughter(const Particle *daughter, const bool updateType=true)
Appends index of daughter to daughters index array.
int m_properties
particle property
std::vector< float > m_extraInfo
Stores associated user defined values.
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
ECLCluster::EHypothesisBit getECLClusterEHypothesisBit() const
Returns the ECLCluster EHypothesisBit for this Particle.
void setExtraInfo(const std::string &name, float value)
Sets the user-defined data of given name to the given value.
std::string getArrayName() const
Get name of array this object is stored in, or "" if not found.
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
std::string getInfo() const
Return a short summary of this object's contents in raw text format.
bool create(bool replace=false)
Create a default object in the data store.
Accessor to arrays stored in the data store.
Type-safe access to single objects in the data store.
Values of the result of a track fit with a given particle hypothesis.
short getChargeSign() const
Return track charge (1 or -1).
double getPValue() const
Getter for Chi2 Probability of the track fit.
TMatrixDSym getCovariance6() const
Position and Momentum Covariance Matrix.
TVector3 getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
TVector3 getPosition() const
Getter for vector of position at closest approach of track in r/phi projection.
Const::ParticleType getParticleType() const
Getter for ParticleType of the mass hypothesis of the track fit.
Class that bundles various TrackFitResults.
Object holding information for V0s.
Class to store variables with their name which were sent to the logging service.
std::string getString(const TMatrixFBase &matrix, int precision=2, bool color=true)
get HTML table representing a matrix.
Abstract base class for different kinds of events.