Belle II Software  release-08-01-10
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...
 
ROOT::Math::XYZVector getClusterPosition () const
 Get global position (ROOT::Math::XYZVector version). More...
 
ROOT::Math::XYZVector getPosition () const
 Get global position (ROOT::Math::XYZVector 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...
 
ROOT::Math::PxPyPzEVector 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 28 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 28 of file KLMCluster.cc.

29  :
30  m_time(time), m_layers(nLayers), m_innermostLayer(nInnermostLayer),
31  m_globalX(x), m_globalY(y), m_globalZ(z), m_p(p),
32  m_errorX(0), m_errorY(0), m_errorZ(0), m_errorP(0)
33 {
34 }
float m_time
Decay time.
Definition: KLMCluster.h:206
int m_innermostLayer
Number of the innermost layer with hits.
Definition: KLMCluster.h:212
float m_globalX
Global position X coordinate.
Definition: KLMCluster.h:215
float m_errorX
Error of vertex X coordinate.
Definition: KLMCluster.h:227
float m_globalZ
Global position Z coordinate.
Definition: KLMCluster.h:221
float m_p
Absolute value of momentum, 0 means unknown.
Definition: KLMCluster.h:224
float m_errorP
Error of momentum absolute value.
Definition: KLMCluster.h:236
float m_errorY
Error of vertex Y coordinate.
Definition: KLMCluster.h:230
float m_errorZ
Error of vertex Z coordinate.
Definition: KLMCluster.h:233
int m_layers
Number of layers with hits.
Definition: KLMCluster.h:209
float m_globalY
Global position Y coordinate.
Definition: KLMCluster.h:218

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.

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

◆ getAssociatedEclClusterFlag()

bool getAssociatedEclClusterFlag ( ) const

Check for associated ECL clusters.

Returns
True if associated ECL clusters exist.

Definition at line 58 of file KLMCluster.cc.

◆ getAssociatedTrackFlag()

bool getAssociatedTrackFlag ( ) const

Check for associated tracks.

Returns
True if associated tracks exist.

Definition at line 64 of file KLMCluster.cc.

◆ getClusterPosition()

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

Get global position (ROOT::Math::XYZVector version).

Returns
Hit coordinates.

Definition at line 80 of file KLMCluster.h.

81  {return ROOT::Math::XYZVector(m_globalX, m_globalY, m_globalZ);}

◆ getEnergy()

float getEnergy ( ) const

Get energy.

Returns
Full energy.

Definition at line 45 of file KLMCluster.cc.

◆ getError4x4()

TMatrixDSym getError4x4 ( ) const

Get KLM cluster momentum error matrix.

Returns
4x4 KLM cluster momentum error matrix.

Definition at line 70 of file KLMCluster.cc.

◆ getError7x7()

TMatrixDSym getError7x7 ( ) const

Get KLM cluster momentum error matrix.

Returns
7x7 KLM cluster momentum error matrix.

Definition at line 101 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 370 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();
std::string getString(const TMatrixFBase &matrix, int precision=2, bool color=true)
get HTML table representing a matrix.
Definition: HTML.cc:24
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 RecoTrack, TRGSummary, TrackFitResult, Track, SoftwareTriggerResult, PIDLikelihood, MCParticle, Cluster, and Particle.

Definition at line 362 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 73 of file KLMCluster.h.

◆ getLayers()

int getLayers ( ) const
inline

Get number of layers with hits.

Returns
Number of layers.

Definition at line 66 of file KLMCluster.h.

◆ getMomentum()

ROOT::Math::PxPyPzEVector getMomentum ( ) const

Get momentum.

Returns
4-Momentum.

Definition at line 51 of file KLMCluster.cc.

◆ getMomentumMag()

float getMomentumMag ( ) const

Get momentum magnitude.

Returns
Absolute value of 3-momentum.

Definition at line 40 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, MCParticle, and Particle.

Definition at line 344 of file RelationsObject.h.

◆ getPosition()

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

Get global position (ROOT::Math::XYZVector 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 89 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 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.

◆ getTime()

float getTime ( ) const
inline

Get time.

Returns
Time of decay.

Definition at line 59 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 161 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 200 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 179 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 186 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 193 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 152 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 145 of file KLMCluster.h.

◆ setMomentumMag()

void setMomentumMag ( float  momentumMag)
inline

Set momentum magnitude.

Parameters
[in]momentumMagMomentum magnitude.

Definition at line 172 of file KLMCluster.h.

◆ setTime()

void setTime ( float  time)
inline

Set time.

Parameters
[in]timeTime.

Definition at line 138 of file KLMCluster.h.


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