Belle II Software development
TrackFitResult Class Reference

Values of the result of a track fit with a given particle hypothesis. More...

#include <TrackFitResult.h>

Inheritance diagram for TrackFitResult:
RelationsInterface< BASE >

Public Member Functions

 TrackFitResult ()
 Constructor initializing everything to zero.
 
 TrackFitResult (const ROOT::Math::XYZVector &position, const ROOT::Math::XYZVector &momentum, const TMatrixDSym &covariance, const short int charge, const Const::ParticleType &particleType, const float pValue, const float bField, const uint64_t hitPatternCDCInitializer, const uint32_t hitPatternVXDInitializer, const float NDF)
 Constructor initializing class with fit result.
 
 TrackFitResult (const std::vector< float > &tau, const std::vector< float > &cov5, const Const::ParticleType &particleType, const float pValue, const uint64_t hitPatternCDCInitializer, const uint32_t hitPatternVXDInitializer, const float NDF)
 Constructor initializing class with perigee parameters.
 
void updateTrackFitResult (const TrackFitResult &input)
 update the TrackFitResults
 
void mask ()
 mask this TrackFitResults by setting the pValue to nan
 
ROOT::Math::XYZVector getPosition () const
 Getter for vector of position at closest approach of track in r/phi projection.
 
ROOT::Math::XYZVector getMomentum () const
 Getter for vector of momentum at closest approach of track in r/phi projection.
 
ROOT::Math::PxPyPzEVector get4Momentum () const
 Getter for the 4Momentum at the closest approach of the track in the r/phi projection.
 
double getEnergy () const
 Getter for the Energy at the closest approach of the track in the r/phi projection.
 
double getTransverseMomentum () const
 Getter for the absolute value of the transverse momentum at the perigee.
 
TMatrixDSym getCovariance6 () const
 Position and Momentum Covariance Matrix.
 
Const::ParticleType getParticleType () const
 Getter for ParticleType of the mass hypothesis of the track fit.
 
short getChargeSign () const
 Return track charge (1 or -1).
 
double getPValue () const
 Getter for Chi2 Probability of the track fit.
 
float getNDF () const
 Getter for number of degrees of freedom of the track fit.
 
double getChi2 () const
 Get chi2 given NDF and p-value.
 
double getD0 () const
 Getter for d0.
 
double getPhi0 () const
 Getter for phi0.
 
double getPhi () const
 Getter for phi0 with CDF naming convention.
 
double getOmega () const
 Getter for omega.
 
double getZ0 () const
 Getter for z0.
 
double getTanLambda () const
 Getter for tanLambda.
 
double getCotTheta () const
 Getter for tanLambda with CDF naming convention.
 
std::vector< float > getTau () const
 Getter for all perigee parameters.
 
std::vector< float > getCov () const
 Getter for all covariance matrix elements of perigee parameters.
 
TMatrixDSym getCovariance5 () const
 Getter for covariance matrix of perigee parameters in matrix form.
 
Helix getHelix () const
 Conversion to framework Helix (without covariance).
 
Helix getHelix (float momentumScale) const
 Conversion to framework Helix with momentum scaling (without covariance).
 
UncertainHelix getUncertainHelix () const
 Conversion to framework Uncertain Helix (i.e., with covariance).
 
HitPatternCDC getHitPatternCDC () const
 Getter for the hit pattern in the CDC;.
 
HitPatternVXD getHitPatternVXD () const
 Getter for the hit pattern in the VXD;.
 
virtual std::string getInfoHTML () const override
 Return a short summary of this object's contents in HTML format.
 
void addRelationTo (const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
 Add a relation from this object to another object (with caching).
 
void addRelationTo (const TObject *object, float weight=1.0, const std::string &namedRelation="") const
 Add a relation from this object to another object (no caching, can be quite slow).
 
void copyRelations (const RelationsInterface< BASE > *sourceObj)
 Copies all relations of sourceObj (pointing from or to sourceObj) to this object (including weights).
 
template<class TO >
RelationVector< TO > getRelationsTo (const std::string &name="", const std::string &namedRelation="") const
 Get the relations that point from this object to another store array.
 
template<class FROM >
RelationVector< FROM > getRelationsFrom (const std::string &name="", const std::string &namedRelation="") const
 Get the relations that point from another store array to this object.
 
template<class T >
RelationVector< T > getRelationsWith (const std::string &name="", const std::string &namedRelation="") const
 Get the relations between this object and another store array.
 
template<class TO >
TO * getRelatedTo (const std::string &name="", const std::string &namedRelation="") const
 Get the object to which this object has a relation.
 
template<class FROM >
FROM * getRelatedFrom (const std::string &name="", const std::string &namedRelation="") const
 Get the object from which this object has a relation.
 
template<class T >
T * getRelated (const std::string &name="", const std::string &namedRelation="") const
 Get the object to or from which this object has a relation.
 
template<class TO >
std::pair< TO *, float > getRelatedToWithWeight (const std::string &name="", const std::string &namedRelation="") const
 Get first related object & weight of relation pointing to an array.
 
template<class FROM >
std::pair< FROM *, float > getRelatedFromWithWeight (const std::string &name="", const std::string &namedRelation="") const
 Get first related object & weight of relation pointing from an array.
 
template<class T >
std::pair< T *, float > getRelatedWithWeight (const std::string &name="", const std::string &namedRelation="") const
 Get first related object & weight of relation pointing from/to an array.
 
virtual std::string getName () const
 Return a short name that describes this object, e.g.
 
std::string getInfo () const
 Return a short summary of this object's contents in raw text format.
 
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.
 

Protected Member Functions

TClonesArray * getArrayPointer () const
 Returns the pointer to the raw DataStore array holding this object (protected since these arrays are easy to misuse).
 

Private Member Functions

 ClassDefOverride (TrackFitResult, 10)
 Values of the result of a track fit with a given particle hypothesis.
 
 ClassDef (RelationsInterface, 0)
 defines interface for accessing relations of objects in StoreArray.
 

Private Attributes

unsigned int m_pdg
 PDG Code for hypothesis with which the corresponding fit was performed.
 
Double32_t m_pValue
 Chi2 Probability of the fit.
 
Double32_t m_tau [c_NPars]
 perigee helix parameters; tau = d0, phi0, omega, z0, tanLambda.
 
Double32_t m_cov5 [c_NCovEntries]
 The 15 = 5*(5+1)/2 covariance matrix elements.
 
uint64_t m_hitPatternCDCInitializer
 Member for initializing the information about hits in the CDC.
 
uint32_t m_hitPatternVXDInitializer
 Member for initializing the information about hits in the VXD.
 
uint16_t m_NDF100
 Member for number of degrees of freedom multiplied by 100 in order to store inside an int a float with two significant digits.
 
DataStore::StoreEntrym_cacheDataStoreEntry
 Cache of the data store entry to which this object belongs.
 
int m_cacheArrayIndex
 Cache of the index in the TClonesArray to which this object belongs.
 

Static Private Attributes

static const uint16_t c_NDFFlag = 0xFFFF
 backward compatibility initialisation for NDF
 
TFRStorageSizes

Constants for Storage sizes

static const unsigned int c_NPars = 5
 Number of helix parameters.
 
static const unsigned int c_NCovEntries = 5 * 6 / 2
 Number of covariance entries.
 
TFRParName

Names for the parameter indices into m_tau.


static const unsigned int iD0 = 0
 Index for d0.
 
static const unsigned int iPhi0 = 1
 Index for phi0.
 
static const unsigned int iOmega = 2
 Index for omega.
 
static const unsigned int iZ0 = 3
 Index for z0.
 
static const unsigned int iTanLambda = 4
 Index tan lambda.
 

Friends

class PostMergeUpdaterModule
 

Detailed Description

Values of the result of a track fit with a given particle hypothesis.

The values are stored as perigee parameters with a corresponding covariance matrix. The used perigee parameters are: 1) d0 which is the signed distance to the perigee. Its sign is positive (negative) if the angle between the transverse momentum and d0 is +pi/2 (-pi/2) 2) phi0 which is the angle between the transverse momentum and the x axis and in [-pi, pi] 3) the signed curvature of the track where the sign is given by the charge of the particle 4) z0 which is the distance of the perigee from the origin in the r-z plane 5) tanLambda which is the inverse slope of the track in the r-z plane

These are the parameters used by BaBar, see D.N. Brown et al., The BaBar Track Fitting Algorithm, appendix A, eq. (15). Available at http://rhicii-science.bnl.gov/public/comp/reco/babar.ps

The class is able to return the track fit result as either perigee parameters or cartesian parameters (x,y,z,px,py,pz)

Definition at line 49 of file TrackFitResult.h.

Constructor & Destructor Documentation

◆ TrackFitResult() [1/3]

Constructor initializing everything to zero.

Definition at line 22 of file TrackFitResult.cc.

22 :
23 m_pdg(0), m_pValue(0),
27{
28 memset(m_tau, 0, sizeof(m_tau));
29 memset(m_cov5, 0, sizeof(m_cov5));
30}
uint32_t m_hitPatternVXDInitializer
Member for initializing the information about hits in the VXD.
unsigned int m_pdg
PDG Code for hypothesis with which the corresponding fit was performed.
Double32_t m_tau[c_NPars]
perigee helix parameters; tau = d0, phi0, omega, z0, tanLambda.
Double32_t m_pValue
Chi2 Probability of the fit.
uint16_t m_NDF100
Member for number of degrees of freedom multiplied by 100 in order to store inside an int a float wit...
uint64_t m_hitPatternCDCInitializer
Member for initializing the information about hits in the CDC.
static const uint16_t c_NDFFlag
backward compatibility initialisation for NDF
Double32_t m_cov5[c_NCovEntries]
The 15 = 5*(5+1)/2 covariance matrix elements.

◆ TrackFitResult() [2/3]

TrackFitResult ( const ROOT::Math::XYZVector &  position,
const ROOT::Math::XYZVector &  momentum,
const TMatrixDSym &  covariance,
const short int  charge,
const Const::ParticleType particleType,
const float  pValue,
const float  bField,
const uint64_t  hitPatternCDCInitializer,
const uint32_t  hitPatternVXDInitializer,
const float  NDF 
)

Constructor initializing class with fit result.

This is the only way to set the values of the TrackFitResult. We don't have any setters, as we assume, that once we create the MDST object, we don't want to change the values of the tracks any more. Scaling can be applied during readout, by setting the value for the magnetic field.

Parameters
positionPosition of the track near the perigee.
momentumMomentum of the track near the perigee.
covarianceCovariance matrix for position and momentum given.
chargeCharge of the particle.
particleTypeParticle Type used for mass hypothesis of the fit.
pValuep-value of the corresponding track fit.
bFieldMagnetic field to be used for the calculation of the curvature; It is assumed, that the B-field is parallel to the z-Axis.
hitPatternCDCInitializerbits for initializing CDC hit pattern.
hitPatternVXDInitializerbits for initializing VXD hit pattern.
NDFnumber of degrees of freedom for the fit (float since DAF provides decimal weights which can be less than 1)

Definition at line 32 of file TrackFitResult.cc.

38 :
39 m_pdg(std::abs(particleType.getPDGCode())), m_pValue(pValue),
40 m_hitPatternCDCInitializer(hitPatternCDCInitializer),
41 m_hitPatternVXDInitializer(hitPatternVXDInitializer),
42 m_NDF100(int(NDF * 100.))
43{
44 UncertainHelix h(position, momentum, charge, bField, covariance, pValue);
45
46 m_tau[iD0] = h.getD0();
47 m_tau[iPhi0] = h.getPhi0();
48 m_tau[iOmega] = h.getOmega();
49 m_tau[iZ0] = h.getZ0();
50 m_tau[iTanLambda] = h.getTanLambda();
51
52 // Upper half of the covariance matrix goes into m_cov5.
53 const TMatrixDSym& cov = h.getCovariance();
54 unsigned int counter = 0;
55 for (unsigned int i = 0; i < c_NPars; ++i) {
56 for (unsigned int j = i; j < c_NPars; ++j) {
57 m_cov5[counter++] = cov(i, j);
58 }
59 }
60 assert(counter == c_NCovEntries);
61}
int getPDGCode() const
PDG code.
Definition: Const.h:473
static const unsigned int c_NPars
Number of helix parameters.
static const unsigned int iZ0
Index for z0.
static const unsigned int c_NCovEntries
Number of covariance entries.
static const unsigned int iTanLambda
Index tan lambda.
static const unsigned int iD0
Index for d0.
static const unsigned int iOmega
Index for omega.
static const unsigned int iPhi0
Index for phi0.
This class represents an ideal helix in perigee parameterization including the covariance matrix of t...

◆ TrackFitResult() [3/3]

TrackFitResult ( const std::vector< float > &  tau,
const std::vector< float > &  cov5,
const Const::ParticleType particleType,
const float  pValue,
const uint64_t  hitPatternCDCInitializer,
const uint32_t  hitPatternVXDInitializer,
const float  NDF 
)

Constructor initializing class with perigee parameters.

This constructor is needed for testing the class.

Parameters
tauHelix parameters of the track;
See also
m_tau .
Parameters
cov5Covariance matrix of the helix paramters of the track;
See also
m_cov5
Parameters
particleTypeParticle Type used for the mass hypothesis of the fit.
pValuep-value of the corresponding track fit.
hitPatternCDCInitializerbits for initializing CDC hit pattern.
hitPatternVXDInitializerbits for initializing VXD hit pattern.
NDFnumber of degrees of freedom for the fit (float since DAF provides decimal weights which can be less than 1)

Definition at line 63 of file TrackFitResult.cc.

67 :
68 m_pdg(std::abs(particleType.getPDGCode())), m_pValue(pValue),
69 m_hitPatternCDCInitializer(hitPatternCDCInitializer),
70 m_hitPatternVXDInitializer(hitPatternVXDInitializer),
71 m_NDF100(int(NDF * 100.))
72{
73 if (tau.size() != c_NPars
74 || cov5.size() != c_NCovEntries)
75 B2FATAL("Invalid initializer for TrackFitResult.");
76
77 for (unsigned int i = 0; i < c_NPars; ++i)
78 m_tau[i] = tau[i];
79 for (unsigned int i = 0; i < c_NCovEntries; ++i)
80 m_cov5[i] = cov5[i];
81}

Member Function Documentation

◆ addRelationTo() [1/2]

void addRelationTo ( const RelationsInterface< BASE > *  object,
float  weight = 1.0,
const std::string &  namedRelation = "" 
) const
inlineinherited

Add a relation from this object to another object (with caching).

Parameters
objectThe object to which the relation should point.
weightThe weight of the relation.
namedRelationAdditional name for the relation, or "" for the default naming

Definition at line 142 of file RelationsObject.h.

143 {
144 if (object)
146 object, object->m_cacheDataStoreEntry, object->m_cacheArrayIndex, weight, namedRelation);
147 }
void addRelation(const TObject *fromObject, StoreEntry *&fromEntry, int &fromIndex, const TObject *toObject, StoreEntry *&toEntry, int &toIndex, float weight, const std::string &namedRelation)
Add a relation from an object in a store array to another object in a store array.
Definition: DataStore.cc:492
static DataStore & Instance()
Instance of singleton Store.
Definition: DataStore.cc:54
DataStore::StoreEntry * m_cacheDataStoreEntry
Cache of the data store entry to which this object belongs.
int m_cacheArrayIndex
Cache of the index in the TClonesArray to which this object belongs.

◆ addRelationTo() [2/2]

void addRelationTo ( const TObject *  object,
float  weight = 1.0,
const std::string &  namedRelation = "" 
) const
inlineinherited

Add a relation from this object to another object (no caching, can be quite slow).

Parameters
objectThe object to which the relation should point.
weightThe weight of the relation.
namedRelationAdditional name for the relation, or "" for the default naming

Definition at line 155 of file RelationsObject.h.

156 {
157 StoreEntry* toEntry = nullptr;
158 int toIndex = -1;
159 DataStore::Instance().addRelation(this, m_cacheDataStoreEntry, m_cacheArrayIndex, object, toEntry, toIndex, weight, namedRelation);
160 }

◆ copyRelations()

void copyRelations ( const RelationsInterface< BASE > *  sourceObj)
inlineinherited

Copies all relations of sourceObj (pointing from or to sourceObj) to this object (including weights).

Useful if you want to make a complete copy of a StoreArray object to make modifications to it, but retain all information on linked objects.

Note: this only works if sourceObj inherits from the same base (e.g. RelationsObject), and only for related objects that also inherit from the same base.

Definition at line 170 of file RelationsObject.h.

171 {
172 if (!sourceObj)
173 return;
174 auto fromRels = sourceObj->getRelationsFrom<RelationsInterface<BASE>>("ALL");
175 for (unsigned int iRel = 0; iRel < fromRels.size(); iRel++) {
176 fromRels.object(iRel)->addRelationTo(this, fromRels.weight(iRel));
177 }
178
179 auto toRels = sourceObj->getRelationsTo<RelationsInterface<BASE>>("ALL");
180 for (unsigned int iRel = 0; iRel < toRels.size(); iRel++) {
181 this->addRelationTo(toRels.object(iRel), toRels.weight(iRel));
182 }
183 }
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).

◆ get4Momentum()

ROOT::Math::PxPyPzEVector get4Momentum ( ) const
inline

Getter for the 4Momentum at the closest approach of the track in the r/phi projection.

P = (px, py, pz, E) where E is calculated via the momentum and the particle hypothesis of the TrackFitResult.

Definition at line 125 of file TrackFitResult.h.

126 {
127 const ROOT::Math::XYZVector momentum = getMomentum();
128 return ROOT::Math::PxPyPzEVector(momentum.X(), momentum.Y(), momentum.Z(), getEnergy());
129 }
double getEnergy() const
Getter for the Energy at the closest approach of the track in the r/phi projection.
ROOT::Math::XYZVector getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.

◆ getArrayIndex()

int getArrayIndex ( ) const
inlineinherited

Returns this object's array index (in StoreArray), or -1 if not found.

Definition at line 385 of file RelationsObject.h.

386 {
388 return m_cacheArrayIndex;
389 }
bool findStoreEntry(const TObject *object, StoreEntry *&entry, int &index)
Find an object in an array in the data store.
Definition: DataStore.cc:398

◆ getArrayName()

std::string getArrayName ( ) const
inlineinherited

Get name of array this object is stored in, or "" if not found.

Definition at line 377 of file RelationsObject.h.

◆ getArrayPointer()

TClonesArray * getArrayPointer ( ) const
inlineprotectedinherited

Returns the pointer to the raw DataStore array holding this object (protected since these arrays are easy to misuse).

Definition at line 418 of file RelationsObject.h.

419 {
422 return nullptr;
424 }
TClonesArray * getPtrAsArray() const
Return ptr cast to TClonesArray.
Definition: StoreEntry.cc:83

◆ getChargeSign()

short getChargeSign ( ) const
inline

Return track charge (1 or -1).

Definition at line 161 of file TrackFitResult.h.

161{ return (getOmega() > 0) - (getOmega() < 0); }
double getOmega() const
Getter for omega.

◆ getChi2()

double getChi2 ( ) const

Get chi2 given NDF and p-value.

Definition at line 107 of file TrackFitResult.cc.

108{
109 double pValue = getPValue();
110 float nDF = getNDF();
111 if (pValue == 0) {
112 return std::numeric_limits<double>::infinity();
113 }
114 if (nDF <= 0) {
115 return std::numeric_limits<double>::quiet_NaN();
116 }
117 return 2 * boost::math::gamma_q_inv(nDF / 2., pValue);
118}
float getNDF() const
Getter for number of degrees of freedom of the track fit.
double getPValue() const
Getter for Chi2 Probability of the track fit.

◆ getCotTheta()

double getCotTheta ( ) const
inline

Getter for tanLambda with CDF naming convention.


Definition at line 210 of file TrackFitResult.h.

210{ return getTanLambda(); }
double getTanLambda() const
Getter for tanLambda.

◆ getCov()

std::vector< float > getCov ( ) const
inline

Getter for all covariance matrix elements of perigee parameters.

Returns
vector with 15 elements

Definition at line 222 of file TrackFitResult.h.

222{ return std::vector<float>(m_cov5, m_cov5 + c_NCovEntries); }

◆ getCovariance5()

TMatrixDSym getCovariance5 ( ) const

Getter for covariance matrix of perigee parameters in matrix form.

The order is given by TFRParName: d0, phi0, omega, z0, lambda.

Definition at line 120 of file TrackFitResult.cc.

121{
122 TMatrixDSym cov5(c_NPars);
123 unsigned int counter = 0;
124 for (unsigned int i = 0; i < c_NPars; ++i) {
125 for (unsigned int j = i; j < c_NPars; ++j) {
126 cov5(i, j) = cov5(j, i) = m_cov5[counter];
127 ++counter;
128 }
129 }
130 assert(counter == c_NCovEntries);
131 return cov5;
132}

◆ getCovariance6()

TMatrixDSym getCovariance6 ( ) const
inline

Position and Momentum Covariance Matrix.


Definition at line 148 of file TrackFitResult.h.

149 {
150 const double bField = BFieldManager::getField(getPosition()).Z() / Unit::T;
152 }
ROOT::Math::XYZVector getPosition() const
Getter for vector of position at closest approach of track in r/phi projection.
UncertainHelix getUncertainHelix() const
Conversion to framework Uncertain Helix (i.e., with covariance).
TMatrixDSym getCartesianCovariance(const double bZ_tesla=1.5) const
Getter for the position and momentum covariance matrix.
static const double T
[tesla]
Definition: Unit.h:120
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
Definition: BFieldManager.h:91

◆ getD0()

double getD0 ( ) const
inline

Getter for d0.

This is the signed distance to the IP in the r-phi plane.

Returns

Definition at line 179 of file TrackFitResult.h.

179{ return m_tau[iD0]; }

◆ getEnergy()

double getEnergy ( ) const
inline

Getter for the Energy at the closest approach of the track in the r/phi projection.

E is calculated via the momentum and the particle hypothesis of the TrackFitResult.

Definition at line 134 of file TrackFitResult.h.

135 {
136 return std::sqrt(getMomentum().Mag2() + getParticleType().getMass() * getParticleType().getMass());
137 }
Const::ParticleType getParticleType() const
Getter for ParticleType of the mass hypothesis of the track fit.

◆ getHelix() [1/2]

Helix getHelix ( ) const
inline

Conversion to framework Helix (without covariance).


Definition at line 231 of file TrackFitResult.h.

232 { return Helix(getD0(), getPhi0(), getOmega(), getZ0(), getTanLambda()); }
double getD0() const
Getter for d0.
double getZ0() const
Getter for z0.
double getPhi0() const
Getter for phi0.

◆ getHelix() [2/2]

Helix getHelix ( float  momentumScale) const
inline

Conversion to framework Helix with momentum scaling (without covariance).


Definition at line 235 of file TrackFitResult.h.

236 { return Helix(getD0(), getPhi0(), getOmega() / momentumScale, getZ0(), getTanLambda()); }

◆ getHitPatternCDC()

HitPatternCDC getHitPatternCDC ( ) const

Getter for the hit pattern in the CDC;.

See also
HitPatternCDC

Definition at line 134 of file TrackFitResult.cc.

135{
137}
Hit pattern of CDC hits within a track.
Definition: HitPatternCDC.h:35

◆ getHitPatternVXD()

HitPatternVXD getHitPatternVXD ( ) const

Getter for the hit pattern in the VXD;.

See also
HitPatternVXD

Definition at line 139 of file TrackFitResult.cc.

140{
142}
Hit pattern of the VXD within a track.
Definition: HitPatternVXD.h:37

◆ getInfo()

std::string getInfo ( ) const
inlineinherited

Return a short summary of this object's contents in raw text format.

Returns the contents of getInfoHTML() while translating line-breaks etc.

Note
: You don't need to implement this function (it's not virtual), getInfoHTML() is enough.

Definition at line 370 of file RelationsObject.h.

371 {
373 }
virtual std::string getInfoHTML() const
Return a short summary of this object's contents in HTML format.
std::string htmlToPlainText(const std::string &html)
See RelationsObject::getInfo()

◆ getInfoHTML()

std::string getInfoHTML ( ) const
overridevirtual

Return a short summary of this object's contents in HTML format.

Reimplemented from RelationsInterface< BASE >.

Definition at line 143 of file TrackFitResult.cc.

144{
145 std::stringstream out;
146 out << "<b>Fit Hypothesis (PDG)</b>: " << m_pdg << "<br>";
147 out << "<b>nPXDHits</b>: " << getHitPatternVXD().getNPXDHits() << "<br>";
148 out << "<b>nSVDHits</b>: " << getHitPatternVXD().getNSVDHits() << "<br>";
149 out << "<b>nCDCHits</b>: " << getHitPatternCDC().getNHits() << "<br>";
150 out << "<b>NDF</b>: " << getNDF() << "<br>";
151 out << " <br>";
152 out << "<b>d0</b>: " << m_tau[iD0] << " cm <br>";
153 out << "<b>phi0</b>: " << m_tau[iPhi0] << " rad <br>";
154 out << "<b>omega</b>: " << m_tau[iOmega] << " 1/GeV<br>";
155 out << "<b>z0</b>: " << m_tau[iZ0] << " cm <br>";
156 out << "<b>tanLambda</b>: " << m_tau[iTanLambda] << "<br>";
157 out << " <br>";
158 out << "<b>Covariance Matrix (d0, phi0, omega, z0, tanLambda)</b>: " << HTML::getString(getCovariance5()) << "<br>";
159 out << "<b>pValue</b>: " << m_pValue << "<br>";
160 return out.str();
161}
unsigned short getNHits() const
Get the total Number of CDC hits in the fit.
unsigned short getNPXDHits() const
Get total number of hits in the PXD.
unsigned short getNSVDHits() const
Get total number of hits in the SVD.
TMatrixDSym getCovariance5() const
Getter for covariance matrix of perigee parameters in matrix form.
HitPatternCDC getHitPatternCDC() const
Getter for the hit pattern in the CDC;.
HitPatternVXD getHitPatternVXD() const
Getter for the hit pattern in the VXD;.
std::string getString(const TMatrixFBase &matrix, int precision=2, bool color=true)
get HTML table representing a matrix.
Definition: HTML.cc:24

◆ getMomentum()

ROOT::Math::XYZVector getMomentum ( ) const
inline

Getter for vector of momentum at closest approach of track in r/phi projection.

As we calculate recalculate the momentum from a geometric helix, we need an estimate of the magnetic field along the z-axis to give back the momentum.

Definition at line 116 of file TrackFitResult.h.

117 {
118 const double bField = BFieldManager::getField(getPosition()).Z() / Unit::T;
119 return getHelix().getMomentum(bField);
120 }
Helix getHelix() const
Conversion to framework Helix (without covariance).

◆ getName()

virtual std::string getName ( ) const
inlinevirtualinherited

Return a short name that describes this object, e.g.

pi+ for an MCParticle.

Reimplemented in Particle, MCParticle, and SpacePoint.

Definition at line 344 of file RelationsObject.h.

344{ return ""; }

◆ getNDF()

float getNDF ( ) const

Getter for number of degrees of freedom of the track fit.

Definition at line 99 of file TrackFitResult.cc.

100{
101 if (m_NDF100 == c_NDFFlag) {
102 return -1;
103 }
104 return (float)m_NDF100 / 100;
105}

◆ getOmega()

double getOmega ( ) const
inline

Getter for omega.

This is the curvature of the track. It's sign is defined by the charge of the particle.

Returns

Definition at line 195 of file TrackFitResult.h.

195{ return m_tau[iOmega]; }

◆ getParticleType()

Const::ParticleType getParticleType ( ) const
inline

Getter for ParticleType of the mass hypothesis of the track fit.

Definition at line 155 of file TrackFitResult.h.

155{ return Const::ParticleType(m_pdg); }

◆ getPhi()

double getPhi ( ) const
inline

Getter for phi0 with CDF naming convention.


Definition at line 188 of file TrackFitResult.h.

188{ return getPhi0(); }

◆ getPhi0()

double getPhi0 ( ) const
inline

Getter for phi0.

This is the angle of the transverse momentum in the r-phi plane.

Returns

Definition at line 185 of file TrackFitResult.h.

185{ return m_tau[iPhi0]; }

◆ getPosition()

ROOT::Math::XYZVector getPosition ( ) const
inline

Getter for vector of position at closest approach of track in r/phi projection.

Definition at line 109 of file TrackFitResult.h.

109{ return getHelix().getPerigee(); }

◆ getPValue()

double getPValue ( ) const
inline

Getter for Chi2 Probability of the track fit.

Definition at line 164 of file TrackFitResult.h.

164{ return m_pValue; }

◆ getRelated()

T * getRelated ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the object to or from which this object has a relation.

Template Parameters
TThe class of objects to or from which the relation points.
Parameters
nameThe name of the store array to or from which the relation points. If empty the default store array name for class T will be used. If the special name "ALL" is given all store arrays containing objects of type T are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
The first related object or a null pointer.

Definition at line 278 of file RelationsObject.h.

279 {
281 T::Class(), name, namedRelation).object);
282 }
@ c_BothSides
Combination of c_FromSide and c_ToSide.
Definition: DataStore.h:79
Belle2::RelationEntry getRelationWith(ESearchSide searchSide, const TObject *object, StoreEntry *&entry, int &index, const TClass *withClass, const std::string &withName, const std::string &namedRelation)
Get the first relation between an object and another object in a store array.
Definition: DataStore.cc:597
TObject * object
Pointer to the object.
Definition: RelationEntry.h:32

◆ getRelatedFrom()

FROM * getRelatedFrom ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the object from which this object has a relation.

Template Parameters
FROMThe class of objects from which the relation points.
Parameters
nameThe name of the store array from which the relation points. If empty the default store array name for class FROM will be used. If the special name "ALL" is given all store arrays containing objects of type FROM are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
The first related object or a null pointer.

Definition at line 263 of file RelationsObject.h.

264 {
266 m_cacheArrayIndex, FROM::Class(), name, namedRelation).object);
267 }
@ c_FromSide
Return relations/objects pointed from (to a given object).
Definition: DataStore.h:77

◆ getRelatedFromWithWeight()

std::pair< FROM *, float > getRelatedFromWithWeight ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get first related object & weight of relation pointing from an array.

Template Parameters
FROMThe class of objects from which the relation points.
Parameters
nameThe name of the store array from which the relation points. If empty the default store array name for class FROM will be used. If the special name "ALL" is given all store arrays containing objects of type FROM are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
Pair of first related object and the relation weight, or (NULL, 1.0) if none found.

Definition at line 314 of file RelationsObject.h.

316 {
318 FROM::Class(), name, namedRelation);
319 return std::make_pair(static_cast<FROM*>(entry.object), entry.weight);
320 }

◆ getRelatedTo()

TO * getRelatedTo ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the object to which this object has a relation.

Template Parameters
TOThe class of objects to which the relation points.
Parameters
nameThe name of the store array to which the relation points. If empty the default store array name for class TO will be used. If the special name "ALL" is given all store arrays containing objects of type TO are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
The first related object or a null pointer.

Definition at line 248 of file RelationsObject.h.

249 {
251 TO::Class(), name, namedRelation).object);
252 }
@ c_ToSide
Return relations/objects pointed to (from a given object).
Definition: DataStore.h:78

◆ getRelatedToWithWeight()

std::pair< TO *, float > getRelatedToWithWeight ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get first related object & weight of relation pointing to an array.

Template Parameters
TOThe class of objects to which the relation points.
Parameters
nameThe name of the store array to which the relation points. If empty the default store array name for class TO will be used. If the special name "ALL" is given all store arrays containing objects of type TO are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
Pair of first related object and the relation weight, or (NULL, 1.0) if none found.

Definition at line 297 of file RelationsObject.h.

299 {
301 TO::Class(), name, namedRelation);
302 return std::make_pair(static_cast<TO*>(entry.object), entry.weight);
303 }

◆ getRelatedWithWeight()

std::pair< T *, float > getRelatedWithWeight ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get first related object & weight of relation pointing from/to an array.

Template Parameters
TThe class of objects to or from which the relation points.
Parameters
nameThe name of the store array to or from which the relation points. If empty the default store array name for class T will be used. If the special name "ALL" is given all store arrays containing objects of type T are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
Pair of first related object and the relation weight, or (NULL, 1.0) if none found.

Definition at line 331 of file RelationsObject.h.

333 {
335 T::Class(), name, namedRelation);
336 return std::make_pair(static_cast<T*>(entry.object), entry.weight);
337 }

◆ getRelationsFrom()

RelationVector< FROM > getRelationsFrom ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the relations that point from another store array to this object.

Template Parameters
FROMThe class of objects from which the relations point.
Parameters
nameThe name of the store array from which the relations point. If empty the default store array name for class FROM will be used. If the special name "ALL" is given all store arrays containing objects of type FROM are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
A vector of relations.

Definition at line 212 of file RelationsObject.h.

214 {
216 m_cacheArrayIndex, FROM::Class(), name, namedRelation));
217 }
RelationVector< T > getRelationsWith(const std::string &name="", const std::string &namedRelation="") const
Get the relations between this object and another store array.

◆ getRelationsTo()

RelationVector< TO > getRelationsTo ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the relations that point from this object to another store array.

Template Parameters
TOThe class of objects to which the relations point.
Parameters
nameThe name of the store array to which the relations point. If empty the default store array name for class TO will be used. If the special name "ALL" is given all store arrays containing objects of type TO are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
A vector of relations.

Definition at line 197 of file RelationsObject.h.

198 {
200 m_cacheArrayIndex, TO::Class(), name, namedRelation));
201 }

◆ getRelationsWith()

RelationVector< T > getRelationsWith ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the relations between this object and another store array.

Relations in both directions are returned.

Template Parameters
TThe class of objects to or from which the relations point.
Parameters
nameThe name of the store array to or from which the relations point. If empty the default store array name for class T will be used. If the special name "ALL" is given all store arrays containing objects of type T are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
A vector of relations.

Definition at line 230 of file RelationsObject.h.

231 {
233 m_cacheArrayIndex, T::Class(), name, namedRelation));
234 }

◆ getTanLambda()

double getTanLambda ( ) const
inline

Getter for tanLambda.

This is the slope of the track in the r-z plane.

Returns

Definition at line 207 of file TrackFitResult.h.

207{ return m_tau[iTanLambda]; }

◆ getTau()

std::vector< float > getTau ( ) const
inline

Getter for all perigee parameters.

Returns
vector with 5 elements

Definition at line 216 of file TrackFitResult.h.

216{ return std::vector<float>(m_tau, m_tau + c_NPars); }

◆ getTransverseMomentum()

double getTransverseMomentum ( ) const
inline

Getter for the absolute value of the transverse momentum at the perigee.

Definition at line 141 of file TrackFitResult.h.

142 {
143 const double bField = BFieldManager::getField(getPosition()).Z() / Unit::T;
144 return getHelix().getTransverseMomentum(bField);
145 }

◆ getUncertainHelix()

UncertainHelix getUncertainHelix ( ) const
inline

Conversion to framework Uncertain Helix (i.e., with covariance).


Definition at line 239 of file TrackFitResult.h.

240 {
241 return UncertainHelix(getD0(), getPhi0(), getOmega(), getZ0(),
243 }

◆ getZ0()

double getZ0 ( ) const
inline

Getter for z0.

This is the z coordinate of the perigee.

Returns

Definition at line 201 of file TrackFitResult.h.

201{ return m_tau[iZ0]; }

◆ mask()

void mask ( )
inline

mask this TrackFitResults by setting the pValue to nan

Definition at line 106 of file TrackFitResult.h.

106{m_pValue = NAN;}

◆ updateTrackFitResult()

void updateTrackFitResult ( const TrackFitResult input)

update the TrackFitResults

Parameters
inputthe TrackFitResult that will be copied into this TrackFitResult

Definition at line 83 of file TrackFitResult.cc.

84{
85 // skip self-assigns
86 if (this == &input) return;
87 m_pdg = input.m_pdg;
88 m_pValue = input.m_pValue;
89 m_NDF100 = input.m_NDF100;
90 m_hitPatternCDCInitializer = input.m_hitPatternCDCInitializer;
91 m_hitPatternVXDInitializer = input.m_hitPatternVXDInitializer;
92
93 std::copy(std::begin(input.m_tau), std::end(input.m_tau), std::begin(this->m_tau));
94
95 std::copy(std::begin(input.m_cov5), std::end(input.m_cov5), std::begin(this->m_cov5));
96
97}

Friends And Related Function Documentation

◆ PostMergeUpdaterModule

friend class PostMergeUpdaterModule
friend

Definition at line 328 of file TrackFitResult.h.

Member Data Documentation

◆ c_NCovEntries

const unsigned int c_NCovEntries = 5 * 6 / 2
staticprivate

Number of covariance entries.

Definition at line 270 of file TrackFitResult.h.

◆ c_NDFFlag

const uint16_t c_NDFFlag = 0xFFFF
staticprivate

backward compatibility initialisation for NDF

Definition at line 304 of file TrackFitResult.h.

◆ c_NPars

const unsigned int c_NPars = 5
staticprivate

Number of helix parameters.

A helix has five parameters and the covariance matrix is a symmetric five-by-five matrix.

Definition at line 269 of file TrackFitResult.h.

◆ iD0

const unsigned int iD0 = 0
staticprivate

Index for d0.

Definition at line 276 of file TrackFitResult.h.

◆ iOmega

const unsigned int iOmega = 2
staticprivate

Index for omega.

Definition at line 278 of file TrackFitResult.h.

◆ iPhi0

const unsigned int iPhi0 = 1
staticprivate

Index for phi0.

Definition at line 277 of file TrackFitResult.h.

◆ iTanLambda

const unsigned int iTanLambda = 4
staticprivate

Index tan lambda.

Definition at line 280 of file TrackFitResult.h.

◆ iZ0

const unsigned int iZ0 = 3
staticprivate

Index for z0.

Definition at line 279 of file TrackFitResult.h.

◆ m_cacheArrayIndex

int m_cacheArrayIndex
mutableprivateinherited

Cache of the index in the TClonesArray to which this object belongs.

Definition at line 432 of file RelationsObject.h.

◆ m_cacheDataStoreEntry

DataStore::StoreEntry* m_cacheDataStoreEntry
mutableprivateinherited

Cache of the data store entry to which this object belongs.

Definition at line 429 of file RelationsObject.h.

◆ m_cov5

Double32_t m_cov5[c_NCovEntries]
private

The 15 = 5*(5+1)/2 covariance matrix elements.

(0,0), (0,1) ... (1,1), (1,2) ... (2,2) ...

Definition at line 290 of file TrackFitResult.h.

◆ m_hitPatternCDCInitializer

uint64_t m_hitPatternCDCInitializer
private

Member for initializing the information about hits in the CDC.

See also
HitPatternCDC

Definition at line 296 of file TrackFitResult.h.

◆ m_hitPatternVXDInitializer

uint32_t m_hitPatternVXDInitializer
private

Member for initializing the information about hits in the VXD.

See also
HitPatternVXD

Definition at line 301 of file TrackFitResult.h.

◆ m_NDF100

uint16_t m_NDF100
private

Member for number of degrees of freedom multiplied by 100 in order to store inside an int a float with two significant digits.

Definition at line 309 of file TrackFitResult.h.

◆ m_pdg

unsigned int m_pdg
private

PDG Code for hypothesis with which the corresponding fit was performed.


Definition at line 259 of file TrackFitResult.h.

◆ m_pValue

Double32_t m_pValue
private

Chi2 Probability of the fit.

Definition at line 262 of file TrackFitResult.h.

◆ m_tau

Double32_t m_tau[c_NPars]
private

perigee helix parameters; tau = d0, phi0, omega, z0, tanLambda.

Definition at line 284 of file TrackFitResult.h.


The documentation for this class was generated from the following files: