Belle II Software  release-05-02-19
KLMCluster Class Reference

KLM cluster data. More...

#include <KLMCluster.h>

Inheritance diagram for KLMCluster:
Collaboration diagram for KLMCluster:

Public Member Functions

 KLMCluster ()
 Constructor.
 
 KLMCluster (float x, float y, float z, float time, int nLayers, int nInnermostLayer, float p)
 Constructor. More...
 
 ~KLMCluster ()
 Destructor.
 
float getTime () const
 Get time. More...
 
int getLayers () const
 Get number of layers with hits. More...
 
int getInnermostLayer () const
 Get number of the innermost layer with hits. More...
 
TVector3 getClusterPosition () const
 Get global position (TVector3 version). More...
 
TVector3 getPosition () const
 Get global position (TVector3 version) of the origin of KLMCluster (always return (0,0,0) since we believe all KLMClusters to originate at or near primary vertex). More...
 
float getMomentumMag () const
 Get momentum magnitude. More...
 
float getEnergy () const
 Get energy. More...
 
TLorentzVector getMomentum () const
 Get momentum. More...
 
TMatrixDSym getError4x4 () const
 Get KLM cluster momentum error matrix. More...
 
TMatrixDSym getError7x7 () const
 Get KLM cluster momentum error matrix. More...
 
bool getAssociatedEclClusterFlag () const
 Check for associated ECL clusters. More...
 
bool getAssociatedTrackFlag () const
 Check for associated tracks. More...
 
void setTime (float time)
 Set time. More...
 
void setLayers (int layers)
 Set number of layers with hits. More...
 
void setInnermostLayer (int innermostLayer)
 Set number of the innermost layer with hits. More...
 
void setClusterPosition (float globalX, float globalY, float globalZ)
 Set global position. More...
 
void setMomentumMag (float momentumMag)
 Set momentum magnitude. More...
 
void setErrorX (float errorX)
 Set error of vertex X coordinate. More...
 
void setErrorY (float errorY)
 Set error of vertex Y coordinate. More...
 
void setErrorZ (float errorZ)
 Set error of vertex Z coordinate. More...
 
void setErrorP (float errorP)
 Set error of momentum absolute value. More...
 
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...
 
virtual std::string getInfoHTML () const
 Return a short summary of this object's contents in HTML format. 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

 ClassDef (Belle2::KLMCluster, 2)
 Needed to make objects storable.
 

Private Attributes

float m_time
 Decay time.
 
int m_layers
 Number of layers with hits.
 
int m_innermostLayer
 Number of the innermost layer with hits.
 
float m_globalX
 Global position X coordinate.
 
float m_globalY
 Global position Y coordinate.
 
float m_globalZ
 Global position Z coordinate.
 
float m_p
 Absolute value of momentum, 0 means unknown.
 
float m_errorX
 Error of vertex X coordinate.
 
float m_errorY
 Error of vertex Y coordinate.
 
float m_errorZ
 Error of vertex Z coordinate.
 
float m_errorP
 Error of momentum absolute value.
 
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.
 

Detailed Description

KLM cluster data.

Definition at line 38 of file KLMCluster.h.

Constructor & Destructor Documentation

◆ KLMCluster()

KLMCluster ( float  x,
float  y,
float  z,
float  time,
int  nLayers,
int  nInnermostLayer,
float  p 
)

Constructor.

Parameters
[in]xVertex X coordinate.
[in]yVertex Y coordinate.
[in]zVertex Z coordinate.
[in]timeDecay (interaction) time.
[in]nLayersNumber of layers with signal.
[in]nInnermostLayerFirst layer.
[in]pAbsolute value of 3-momentum.

Definition at line 27 of file KLMCluster.cc.

28  :
29  m_time(time), m_layers(nLayers), m_innermostLayer(nInnermostLayer),
30  m_globalX(x), m_globalY(y), m_globalZ(z), m_p(p),
31  m_errorX(0), m_errorY(0), m_errorZ(0), m_errorP(0)
32 {
33 }

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 144 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 157 of file RelationsObject.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 172 of file RelationsObject.h.

◆ getAssociatedEclClusterFlag()

bool getAssociatedEclClusterFlag ( ) const

Check for associated ECL clusters.

Returns
True if associated ECL clusters exist.

Definition at line 57 of file KLMCluster.cc.

◆ getAssociatedTrackFlag()

bool getAssociatedTrackFlag ( ) const

Check for associated tracks.

Returns
True if associated tracks exist.

Definition at line 63 of file KLMCluster.cc.

◆ getClusterPosition()

TVector3 getClusterPosition ( ) const
inline

Get global position (TVector3 version).

Returns
Hit coordinates.

Definition at line 90 of file KLMCluster.h.

92  {return TVector3(0, 0, 0);}

◆ getEnergy()

float getEnergy ( ) const

Get energy.

Returns
Full energy.

Definition at line 44 of file KLMCluster.cc.

◆ getError4x4()

TMatrixDSym getError4x4 ( ) const

Get KLM cluster momentum error matrix.

Returns
4x4 KLM cluster momentum error matrix.

Definition at line 69 of file KLMCluster.cc.

◆ getError7x7()

TMatrixDSym getError7x7 ( ) const

Get KLM cluster momentum error matrix.

Returns
7x7 KLM cluster momentum error matrix.

Definition at line 100 of file KLMCluster.cc.

◆ 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 372 of file RelationsObject.h.

◆ getInfoHTML()

virtual std::string getInfoHTML ( ) const
inlinevirtualinherited

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

Reimplement this in your own class to provide useful output for display or debugging purposes. For example, you might do something like:

std::stringstream out;
out << "<b>PDG</b>: " << m_pdg << "<br>";
out << "<b>Covariance Matrix</b>: " << HTML::getString(getCovariance5()) << "<br>";
return out.str();
See also
Particle::getInfoHTML() for a more complex example.
HTML for some utility functions.
Use getInfo() to get a raw text version of this output.

Reimplemented in TrackFitResult, TRGSummary, Track, SoftwareTriggerResult, Particle, RecoTrack, MCParticle, Cluster, and PIDLikelihood.

Definition at line 364 of file RelationsObject.h.

◆ getInnermostLayer()

int getInnermostLayer ( ) const
inline

Get number of the innermost layer with hits.

Returns
Number of the innermost layer with hits.

Definition at line 83 of file KLMCluster.h.

◆ getLayers()

int getLayers ( ) const
inline

Get number of layers with hits.

Returns
Number of layers.

Definition at line 76 of file KLMCluster.h.

◆ getMomentum()

TLorentzVector getMomentum ( ) const

Get momentum.

Returns
4-Momentum.

Definition at line 50 of file KLMCluster.cc.

◆ getMomentumMag()

float getMomentumMag ( ) const

Get momentum magnitude.

Returns
Absolute value of 3-momentum.

Definition at line 39 of file KLMCluster.cc.

◆ getName()

virtual std::string getName ( ) const
inlinevirtualinherited

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

pi+ for an MCParticle.

Reimplemented in SpacePoint, Particle, and MCParticle.

Definition at line 346 of file RelationsObject.h.

◆ getPosition()

TVector3 getPosition ( ) const
inline

Get global position (TVector3 version) of the origin of KLMCluster (always return (0,0,0) since we believe all KLMClusters to originate at or near primary vertex).

Returns
KLMCluster origin coordinates.

Definition at line 99 of file KLMCluster.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 280 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 265 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 316 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 250 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 299 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 333 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 214 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 199 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 232 of file RelationsObject.h.

◆ getTime()

float getTime ( ) const
inline

Get time.

Returns
Time of decay.

Definition at line 69 of file KLMCluster.h.

◆ setClusterPosition()

void setClusterPosition ( float  globalX,
float  globalY,
float  globalZ 
)
inline

Set global position.

Parameters
[in]globalXX coordinate.
[in]globalYY coordinate.
[in]globalZZ coordinate.

Definition at line 171 of file KLMCluster.h.

◆ setErrorP()

void setErrorP ( float  errorP)
inline

Set error of momentum absolute value.

Parameters
[in]errorPError of momentum absolute value.

Definition at line 210 of file KLMCluster.h.

◆ setErrorX()

void setErrorX ( float  errorX)
inline

Set error of vertex X coordinate.

Parameters
[in]errorXError of vertex X coordinate.

Definition at line 189 of file KLMCluster.h.

◆ setErrorY()

void setErrorY ( float  errorY)
inline

Set error of vertex Y coordinate.

Parameters
[in]errorYError of vertex Y coordinate.

Definition at line 196 of file KLMCluster.h.

◆ setErrorZ()

void setErrorZ ( float  errorZ)
inline

Set error of vertex Z coordinate.

Parameters
[in]errorZError of vertex Z coordinate.

Definition at line 203 of file KLMCluster.h.

◆ setInnermostLayer()

void setInnermostLayer ( int  innermostLayer)
inline

Set number of the innermost layer with hits.

Parameters
[in]innermostLayerNumber of the innermost layer with hits.

Definition at line 162 of file KLMCluster.h.

◆ setLayers()

void setLayers ( int  layers)
inline

Set number of layers with hits.

Parameters
[in]layersNumber of layers with hits.

Definition at line 155 of file KLMCluster.h.

◆ setMomentumMag()

void setMomentumMag ( float  momentumMag)
inline

Set momentum magnitude.

Parameters
[in]momentumMagMomentum magnitude.

Definition at line 182 of file KLMCluster.h.

◆ setTime()

void setTime ( float  time)
inline

Set time.

Parameters
[in]timeTime.

Definition at line 148 of file KLMCluster.h.


The documentation for this class was generated from the following files:
Belle2::KLMCluster::m_errorP
float m_errorP
Error of momentum absolute value.
Definition: KLMCluster.h:246
Belle2::KLMCluster::m_globalX
float m_globalX
Global position X coordinate.
Definition: KLMCluster.h:225
Belle2::KLMCluster::m_layers
int m_layers
Number of layers with hits.
Definition: KLMCluster.h:219
Belle2::KLMCluster::m_p
float m_p
Absolute value of momentum, 0 means unknown.
Definition: KLMCluster.h:234
Belle2::KLMCluster::m_globalY
float m_globalY
Global position Y coordinate.
Definition: KLMCluster.h:228
Belle2::HTML::getString
std::string getString(const TMatrixFBase &matrix, int precision=2, bool color=true)
get HTML table representing a matrix.
Definition: HTML.cc:18
Belle2::KLMCluster::m_errorX
float m_errorX
Error of vertex X coordinate.
Definition: KLMCluster.h:237
Belle2::KLMCluster::m_errorZ
float m_errorZ
Error of vertex Z coordinate.
Definition: KLMCluster.h:243
Belle2::KLMCluster::m_innermostLayer
int m_innermostLayer
Number of the innermost layer with hits.
Definition: KLMCluster.h:222
Belle2::KLMCluster::m_globalZ
float m_globalZ
Global position Z coordinate.
Definition: KLMCluster.h:231
Belle2::KLMCluster::m_errorY
float m_errorY
Error of vertex Y coordinate.
Definition: KLMCluster.h:240
Belle2::KLMCluster::m_time
float m_time
Decay time.
Definition: KLMCluster.h:216