10#include <analysis/variables/BasicParticleInformation.h>
13#include <analysis/VariableManager/Manager.h>
15#include <analysis/dataobjects/Particle.h>
24 bool particleIsFromECL(
const Particle* part)
26 return (part->getParticleSource() == Particle::EParticleSourceObject::c_ECLCluster);
29 bool particleIsFromKLM(
const Particle* part)
31 return (part->getParticleSource() == Particle::EParticleSourceObject::c_KLMCluster);
34 bool particleIsFromTrack(
const Particle* part)
36 return (part->getParticleSource() == Particle::EParticleSourceObject::c_Track);
39 bool particleIsFromV0(
const Particle* part)
41 return (part->getParticleSource() == Particle::EParticleSourceObject::c_V0);
44 int particleSource(
const Particle* part)
46 return part->getParticleSource();
49 int particleMdstArrayIndex(
const Particle* part)
51 return part->getMdstArrayIndex();
54 int uniqueParticleIdentifier(
const Particle* part)
56 return part->getMdstSource();
59 bool particleIsUnspecified(
const Particle* part)
61 int properties = part->getProperty();
65 double particlePvalue(
const Particle* part)
67 return part->getPValue();
70 int particleNDaughters(
const Particle* part)
72 return part->getNDaughters();
75 int particleFlavorType(
const Particle* part)
77 return part->getFlavorType();
80 double particleCharge(
const Particle* part)
82 return part->getCharge();
85 VARIABLE_GROUP(
"Basic particle information");
86 REGISTER_VARIABLE(
"isFromECL", particleIsFromECL,
"Returns true if this particle was created from an ECLCluster, false otherwise.");
87 REGISTER_VARIABLE(
"isFromKLM", particleIsFromKLM,
"Returns true if this particle was created from a KLMCluster, false otherwise.");
88 REGISTER_VARIABLE(
"isFromTrack", particleIsFromTrack,
"Returns true if this particle was created from a track, false otherwise.");
89 REGISTER_VARIABLE(
"isFromV0", particleIsFromV0,
"Returns true if this particle was created from a V0, false otherwise.");
90 REGISTER_VARIABLE(
"particleSource", particleSource, R
"DOC(
91 Returns mdst source used to create the particle. The meaning of the values are
94 * 1: created from track
95 * 2: created from ECL cluster
96 * 3: created from KLM cluster
99 * 6: composite particle
102 REGISTER_VARIABLE("mdstIndex", particleMdstArrayIndex, R
"DOC(
103Store array index (0 - based) of the MDST object from which the Particle was created.
104It's 0 for composite particles.
107 It is not a unique identifier of particle. For example, a pion and a gamma can have the same `mdstIndex`:
108 pions are created from tracks whereas gammas are created from ECL clusters; tracks and
109 ECL clusters are stored in different arrays. A photon may be created from ECL cluster with index 0 and a
110 pion may be created from track with index 0 will both have :b2:var:`mdstIndex` equal to 0, but they will be different particles.
113 Two particles of the same type can also have the same :b2:var:`mdstIndex`. This would mean that they are created from the same object.
114 For example, if pion and kaon have the same :b2:var:`mdstIndex` it means that they are created from the same track.
117 If you are looking for unique identifier of the particle, please use :b2:var:`uniqueParticleIdentifier`.
119 REGISTER_VARIABLE("uniqueParticleIdentifier", uniqueParticleIdentifier, R
"DOC(
120Returns unique identifier of final state particle.
121Particles created from the same object (e.g. from the same track) have different :b2:var:`uniqueParticleIdentifier` value.)DOC");
123 REGISTER_VARIABLE("isUnspecified", particleIsUnspecified,
124 "Returns true if the particle is marked as an unspecified object (like B0 -> @Xsd e+ e-), false otherwise");
125 REGISTER_VARIABLE(
"chiProb", particlePvalue, R
"DOC(
126A context-dependent :math:`\chi^2` probability for 'the fit' related to this particle.
128* If this particle is track-based, then this is the pvalue of the track fit (identical to :b2:var:`pValue`).
129* If this particle is cluster-based then this variable is currently unused.
130* If this particle is composite and a vertex fit has been performed, then this is the :math:`\chi^2` probability of the vertex fit result.
133 If multiple vertex fits are performed then the last one sets the ``chiProb`` overwriting all previous.
135.. seealso:: :b2:var:`pValue` for tracks
137 REGISTER_VARIABLE("nDaughters", particleNDaughters,
138 "Returns number of daughter particles");
139 REGISTER_VARIABLE(
"flavor", particleFlavorType,
140 "Returns 1 if particle is flavored type, 0 if it is unflavored.");
141 REGISTER_VARIABLE(
"charge", particleCharge,
"Returns electric charge of particle in units of :math:`e`.");
@ c_IsUnspecified
Ordinary particles.
Abstract base class for different kinds of events.