Belle II Software  release-08-01-10
Track Class Reference

Class that bundles various TrackFitResults. More...

#include <Track.h>

Inheritance diagram for Track:
Collaboration diagram for Track:

Public Types

enum  StatusBit { c_isFlippedAndRefitted = 1 << 0 }
 status enumerator
 
typedef std::pair< Const::ChargedStable, TrackFitResult * > ChargedStableTrackFitResultPair
 Pair to hold the particle hypothesis used for the fit as first entry and the result of the track fit as second.
 

Public Member Functions

 Track (float qualityIndicator=0.)
 Constructor of Track without any attached TrackFitResults. More...
 
const TrackFitResultgetTrackFitResultByName (const Const::ChargedStable &chargedStable, const std::string trackFitResultsName) const
 Access to TrackFitResults with a specified Name. More...
 
const TrackFitResultgetTrackFitResult (const Const::ChargedStable &chargedStable) const
 Default Access to TrackFitResults. More...
 
const TrackFitResultgetTrackFitResultWithClosestMassByName (const Const::ChargedStable &requestedType, const std::string trackFitResultsName) const
 Return the track fit (from TrackFitResult with specified name) for a fit hypothesis with the closest mass. More...
 
const TrackFitResultgetTrackFitResultWithClosestMass (const Const::ChargedStable &requestedType) const
 Return the track fit for a fit hypothesis with the closest mass. More...
 
std::vector< ChargedStableTrackFitResultPairgetTrackFitResultsByName (const std::string trackFitResultsName) const
 Access to all track fit results at the same time (from TrackFitResult with specified name) More...
 
std::vector< ChargedStableTrackFitResultPairgetTrackFitResults () const
 Deafult Access to all track fit results at the same time. More...
 
void addStatusBits (unsigned short int bitmask)
 Add Track Refining Status Bit. More...
 
void setFlippedAndRefitted ()
 Set the Track status bit when the track has been flipped and refitted in the refining step.
 
bool getStatusBit (unsigned short int bitmask) const
 Get Track Status after Refining. More...
 
bool isFlippedAndRefitted () const
 Check the Track status after the Refining step. More...
 
bool wasRefined ()
 Check whether Track was modified in the Refining step. More...
 
void setTrackFitResultIndex (const Const::ChargedStable &chargedStable, short index)
 Set an index (for positive values) or unavailability-code (index = -1) for a specific mass hypothesis. More...
 
unsigned int getNumberOfFittedHypotheses () const
 Returns the number of fitted hypothesis which are stored in this track.
 
float getQualityIndicator () const
 Getter for quality indicator for classification of fake vs. More...
 
void setTrackTime (float track_time)
 Set track time computed as the difference between the outgoing/ingoing arm time (computed with SVD hits) and the SVD EventT0. More...
 
float getTrackTime () const
 Returns track time computed as the difference between the average of SVD clusters time and the SVD EventT0.
 
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). More...
 
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). More...
 
void copyRelations (const RelationsInterface< BASE > *sourceObj)
 Copies all relations of sourceObj (pointing from or to sourceObj) to this object (including weights). More...
 
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. More...
 
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. More...
 
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. More...
 
template<class TO >
TO * getRelatedTo (const std::string &name="", const std::string &namedRelation="") const
 Get the object to which this object has a relation. More...
 
template<class FROM >
FROM * getRelatedFrom (const std::string &name="", const std::string &namedRelation="") const
 Get the object from which this object has a relation. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual std::string getName () const
 Return a short name that describes this object, e.g. More...
 
std::string getInfo () const
 Return a short summary of this object's contents in raw text format. More...
 
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

std::vector< short int > getValidIndices () const
 Returns a vector of all fit hypothesis indices in m_trackFitIndices which have been set (meaning are not -1)
 
 ClassDefOverride (Track, 6)
 Class that bundles various TrackFitResults.
 
 ClassDef (RelationsInterface, 0)
 defines interface for accessing relations of objects in StoreArray.
 

Private Attributes

unsigned short int m_statusBitmap = 0
 Bitmap of the track status, contains informations on the refining stage.
 
short int m_trackFitIndices [Const::ChargedStable::c_SetSize]
 Index list of the TrackFitResults associated with this Track.
 
float const m_qualityIndicator
 Quality indicator for classification of fake vs. More...
 
float m_trackTime = std::numeric_limits<float>::quiet_NaN()
 Track time, computed as the difference between outgoing/ingoing arm time and the SVDEvent T0.
 
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.
 

Friends

class FixMergedObjectsModule
 
class PostMergeUpdaterModule
 

Detailed Description

Class that bundles various TrackFitResults.

As the RecoTrack has a lot of information that is only necessary during the fit, this is a much stripped down version containing only indices of TrackFitResults (which is what remains of the various TrackReps, that Genfit might use during the fit).

Definition at line 25 of file Track.h.

Constructor & Destructor Documentation

◆ Track()

Track ( float  qualityIndicator = 0.)
inlineexplicit

Constructor of Track without any attached TrackFitResults.

Corresponding TrackFitResults should be added using the corresponding setter function. The array with the indices for the TrackFitResults is initialized with -1, which is an invalid index.

Parameters
qualityIndicatorInitialises m_qualityIndicator with 0, a value associated typically with fake tracks.

Definition at line 48 of file Track.h.

48  : m_qualityIndicator(qualityIndicator)
49  {
51  }
static const ParticleSet chargedStableSet
set of charged stable particles
Definition: Const.h:609
short int m_trackFitIndices[Const::ChargedStable::c_SetSize]
Index list of the TrackFitResults associated with this Track.
Definition: Track.h:230
float const m_qualityIndicator
Quality indicator for classification of fake vs.
Definition: Track.h:243

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.

◆ 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.

◆ addStatusBits()

void addStatusBits ( unsigned short int  bitmask)
inline

Add Track Refining Status Bit.

Parameters
bitmaskto be added to the m_statusBitmap

Definition at line 144 of file Track.h.

◆ 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.

◆ 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.

◆ getName()

virtual std::string getName ( ) const
inlinevirtualinherited

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

pi+ for an MCParticle.

Reimplemented in SpacePoint, MCParticle, and Particle.

Definition at line 344 of file RelationsObject.h.

◆ getQualityIndicator()

float getQualityIndicator ( ) const
inline

Getter for quality indicator for classification of fake vs.

MC-matched Tracks.

During reconstruction, the probability (given a certain sample composition) of a track to originate from a charged particle rather than e.g. a random combination of hits from different charged particles and background contributions is estimated. This estimate includes information, that isn't used for the calculation of the p-value of the fit, e.g. energy-deposition, timing, and cluster-shape information. We consider it unlikely, that we will make such an estimate for each hypothesis. Therfore, the Track rather than the TrackFitResult is the place to store this information. We don't want to provide a default cut, because charged-particle-vetos and recombination of different kind of resonances potentially can profit from different working points on the efficiency-purity curve, and we expect some MC-data discrepancy due to imperfect calibration of the local reconstruction inputs. The meaning of the value may strongly depend on the presence of VXD or CDC measurements, but this information is available at mdst level as well.

Definition at line 198 of file Track.h.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ getStatusBit()

bool getStatusBit ( unsigned short int  bitmask) const
inline

Get Track Status after Refining.

Parameters
bitmask
Returns
status (1 or 0) corresponding to the bitmask

Definition at line 155 of file Track.h.

◆ getTrackFitResult()

const TrackFitResult * getTrackFitResult ( const Const::ChargedStable chargedStable) const

Default Access to TrackFitResults.

This tries to return the TrackFitResult for the requested track hypothesis. If the requested track hypothesis is not available, we return a nullptr.

TODO: Do something special if we did not even try to fit!

Parameters
chargedStableDetermines the particle for which you want to get the best available fit hypothesis.
Returns
TrackFitResult for fit with particle hypothesis given by ParticleCode or a nullptr, if no result is available.
See also
TrackFitResult

Definition at line 30 of file Track.cc.

31 {
32  return getTrackFitResultByName(chargedStable, "");
33 }
const TrackFitResult * getTrackFitResultByName(const Const::ChargedStable &chargedStable, const std::string trackFitResultsName) const
Access to TrackFitResults with a specified Name.
Definition: Track.cc:17

◆ getTrackFitResultByName()

const TrackFitResult * getTrackFitResultByName ( const Const::ChargedStable chargedStable,
const std::string  trackFitResultsName 
) const

Access to TrackFitResults with a specified Name.

This tries to return the TrackFitResult for the requested track hypothesis. If the requested track hypothesis is not available, we return a nullptr.

TODO: Do something special if we did not even try to fit!

Parameters
chargedStableDetermines the particle for which you want to get the best available fit hypothesis.
trackFitResultsNameThe name of the storeArray to get the TrackFitResults from
Returns
TrackFitResult for fit with particle hypothesis given by ParticleCode or a nullptr, if no result is available.
See also
TrackFitResult

Definition at line 17 of file Track.cc.

◆ getTrackFitResults()

std::vector< Track::ChargedStableTrackFitResultPair > getTrackFitResults ( ) const

Deafult Access to all track fit results at the same time.

Returns a vector of pair of all track fit results which have been set and the respective particle hypothesis they have been fitted with.

Definition at line 60 of file Track.cc.

◆ getTrackFitResultsByName()

std::vector< Track::ChargedStableTrackFitResultPair > getTrackFitResultsByName ( const std::string  trackFitResultsName) const

Access to all track fit results at the same time (from TrackFitResult with specified name)

Parameters
trackFitResultsNameThe name of the storeArray to get the TrackFitResults from Returns a vector of pair of all track fit results which have been set and the respective particle hypothesis they have been fitted with.

Definition at line 42 of file Track.cc.

◆ getTrackFitResultWithClosestMass()

const TrackFitResult * getTrackFitResultWithClosestMass ( const Const::ChargedStable requestedType) const

Return the track fit for a fit hypothesis with the closest mass.

Multiple particle hypothesis are used for fitting during the reconstruction and stored with this Track class. Not all hypothesis are available for all tracks because either a specific hypothesis was not fitted or because the fit failed. This method returns the track fit result of a successful fit with the hypothesis of a mass closest to the requested particle type. If the requested type's hypothesis is available it will be returned otherwise the next closest hypothesis in terms of the absolute mass difference will be returned.

For example, if a pion is requested (mass 140 MeV) and only a muon fit (mass 106 MeV) and an electron fit (mass 511 kEV) is available, the muon fit result will be returned. So this method is guaranteed to always return a TrackFitResult (opposite to getTrackFitResult() which can return nullptr if the requested Particle type was not fitted).

Parameters
requestedTypeThe particle type for which the fit result should be returned.
Returns
a pointer to the TrackFitResult object. Use TrackFitResult::getParticleType() to check which fitting hypothesis was actually used for this result.

Definition at line 104 of file Track.cc.

◆ getTrackFitResultWithClosestMassByName()

const TrackFitResult * getTrackFitResultWithClosestMassByName ( const Const::ChargedStable requestedType,
const std::string  trackFitResultsName 
) const

Return the track fit (from TrackFitResult with specified name) for a fit hypothesis with the closest mass.

Multiple particle hypothesis are used for fitting during the reconstruction and stored with this Track class. Not all hypothesis are available for all tracks because either a specific hypothesis was not fitted or because the fit failed. This method returns the track fit result of a successful fit with the hypothesis of a mass closest to the requested particle type. If the requested type's hypothesis is available it will be returned otherwise the next closest hypothesis in terms of the absolute mass difference will be returned.

For example, if a pion is requested (mass 140 MeV) and only a muon fit (mass 106 MeV) and an electron fit (mass 511 kEV) is available, the muon fit result will be returned. So this method is guaranteed to always return a TrackFitResult (opposite to getTrackFitResult() which can return nullptr if the requested Particle type was not fitted).

Parameters
requestedTypeThe particle type for which the fit result should be returned.
trackFitResultsNameThe name of the storeArray to get the TrackFitResults from
Returns
a pointer to the TrackFitResult object. Use TrackFitResult::getParticleType() to check which fitting hypothesis was actually used for this result.

Definition at line 80 of file Track.cc.

◆ isFlippedAndRefitted()

bool isFlippedAndRefitted ( ) const
inline

Check the Track status after the Refining step.

Returns
true if the track was flipped and refitted in the refining step

Definition at line 160 of file Track.h.

◆ setTrackFitResultIndex()

void setTrackFitResultIndex ( const Const::ChargedStable chargedStable,
short  index 
)
inline

Set an index (for positive values) or unavailability-code (index = -1) for a specific mass hypothesis.

The TrackFitResult itself should be saved separately in the DataStore.

Parameters
chargedStableDetermines the hypothesis for which you want to store the index or unavailability-code.
indexindex of track fit result (for positive values) or unavailability-code (index = -1)

Definition at line 174 of file Track.h.

◆ setTrackTime()

void setTrackTime ( float  track_time)
inline

Set track time computed as the difference between the outgoing/ingoing arm time (computed with SVD hits) and the SVD EventT0.

If both outgoing and ingoing arms exist: 1) if the outgoing arm time is smaller than the ingoing arm time, the track time is computed as the difference of the outgoing arm time and the SVD EventT0; 2) otherwise the track time is computed as the difference of the ingoing arm time and the SVD EventT0. If only the outgoing arm exists, the track time is computed as the difference of the outgoing arm time and the SVD EventT0. If only the ingoing arm exists, the track time is computed as the difference of the ingoing arm time and the SVD EventT0.

Definition at line 209 of file Track.h.

◆ wasRefined()

bool wasRefined ( )
inline

Check whether Track was modified in the Refining step.

Returns
true if the track was modified in the refining step

Definition at line 165 of file Track.h.

Member Data Documentation

◆ m_qualityIndicator

float const m_qualityIndicator
private

Quality indicator for classification of fake vs.

MC-matched Tracks.

Given likely data-MC discrepancies etc orders of magnitude larger than float precision, single precision is enough.

Definition at line 243 of file Track.h.


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