Belle II Software  release-06-01-15
EKLMHit2d Class Reference

Class for 2d hits handling. More...

#include <EKLMHit2d.h>

Inheritance diagram for EKLMHit2d:
Collaboration diagram for EKLMHit2d:

Public Member Functions

 EKLMHit2d ()
 Constructor.
 
 EKLMHit2d (KLMDigit *s1)
 Constructor with two strips. More...
 
 ~EKLMHit2d ()
 Destructor.
 
float getChiSq () const
 Get Chi^2 of the crossing point. More...
 
void setChiSq (float chisq)
 Set Chi^2 of the crossing point. 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.
 
int getSection () const
 Get section number. More...
 
void setSection (int Section)
 Set section number. More...
 
int getLayer () const
 Get layer number. More...
 
void setLayer (int layer)
 Set layer number. More...
 
int getSector () const
 Get sector number. More...
 
void setSector (int sector)
 Set sector number. More...
 
float getEnergyDeposit () const
 Get energy deposit. More...
 
void setEnergyDeposit (float eDep)
 Set EnergyDeposit. More...
 
float getTime () const
 Get hit time. More...
 
void setTime (float time)
 Set hit time. More...
 
int getPDG () const
 Get the lund code of the (leading) particle. More...
 
void setPDG (int pdg)
 Set the lund code of the (leading) particle. More...
 
void setPosition (float x, float y, float z)
 Set hit global position. More...
 
void setPosition (const TVector3 &pos)
 Set hit global position. More...
 
float getPositionX () const
 Get hit global position x coordinate. More...
 
float getPositionY () const
 Get hit global position y coordinate. More...
 
float getPositionZ () const
 Get hit global position z coordinate. More...
 
TVector3 getPosition () const
 Get hit global position. More...
 
void setMCTime (float t)
 Set MC time. More...
 
float getMCTime () const
 Get MC time. More...
 

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

Protected Attributes

int m_PDG = -1
 PDG code of the (leading) particle.
 
float m_Time = -1
 Time of the hit.
 
float m_EDep = -1
 Energy deposition.
 
int m_Section
 Number of section.
 
int m_Layer
 Number of layer.
 
int m_Sector
 Number of sector.
 
float m_globalX
 Global position X coordinate.
 
float m_globalY
 Global position Y coordinate.
 
float m_globalZ
 Global position Z coordinate.
 
float m_MCTime = -1
 Time.
 

Private Member Functions

 ClassDef (Belle2::EKLMHit2d, 5)
 Class version.
 

Private Attributes

float m_ChiSq
 Chi^2 of the hit.
 
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

Class for 2d hits handling.

Definition at line 29 of file EKLMHit2d.h.

Constructor & Destructor Documentation

◆ EKLMHit2d()

EKLMHit2d ( KLMDigit s1)
explicit

Constructor with two strips.

Parameters
[in]s1One of KLMDigits.

Definition at line 23 of file EKLMHit2d.cc.

23  :
24  m_ChiSq(-1)
25 {
27  B2FATAL("Trying to construct a EKLMHit2d using KLMDigits from BKLM.");
28  setSection(s1->getSection());
29  setLayer(s1->getLayer());
30  setSector(s1->getSector());
31 }
float m_ChiSq
Chi^2 of the hit.
Definition: EKLMHit2d.h:71
void setSection(int Section)
Set section number.
Definition: EKLMHitBase.h:55
void setSector(int sector)
Set sector number.
Definition: EKLMHitBase.h:91
void setLayer(int layer)
Set layer number.
Definition: EKLMHitBase.h:73
int getSubdetector() const
Get subdetector number.
Definition: KLMDigit.h:79
int getLayer() const
Get layer number.
Definition: KLMDigit.h:133
int getSection() const
Get section number.
Definition: KLMDigit.h:97
int getSector() const
Get sector number.
Definition: KLMDigit.h:115

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.

◆ getChiSq()

float getChiSq ( ) const
inline

Get Chi^2 of the crossing point.

Returns
Chi^2.

Definition at line 54 of file EKLMHit2d.h.

55  {
56  return m_ChiSq;
57  }

◆ getEnergyDeposit()

float getEnergyDeposit ( ) const
inlineinherited

Get energy deposit.

Returns
Energy deposit.

Definition at line 100 of file EKLMHitBase.h.

101  {
102  return m_EDep;
103  }
float m_EDep
Energy deposition.
Definition: EKLMHitBase.h:159

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

◆ getLayer()

int getLayer ( ) const
inlineinherited

Get layer number.

Returns
Layer number.

Definition at line 64 of file EKLMHitBase.h.

◆ getMCTime()

float getMCTime ( ) const
inlineinherited

Get MC time.

Returns
Time.

Definition at line 54 of file EKLMHitMCTime.h.

55  {
56  return m_MCTime;
57  }

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

◆ getPDG()

int getPDG ( ) const
inlineinherited

Get the lund code of the (leading) particle.

Returns
Particle code.

Definition at line 136 of file EKLMHitBase.h.

◆ getPosition()

TVector3 getPosition ( ) const
inlineinherited

Get hit global position.

Returns
Hit coordinates.

Definition at line 82 of file EKLMHitGlobalCoord.h.

83  {
84  return TVector3(m_globalX, m_globalY, m_globalZ);
85  }
float m_globalX
Global position X coordinate.
float m_globalZ
Global position Z coordinate.
float m_globalY
Global position Y coordinate.

◆ getPositionX()

float getPositionX ( ) const
inlineinherited

Get hit global position x coordinate.

Returns
Hit x coordinate.

Definition at line 55 of file EKLMHitGlobalCoord.h.

◆ getPositionY()

float getPositionY ( ) const
inlineinherited

Get hit global position y coordinate.

Returns
Hit y coordinate.

Definition at line 64 of file EKLMHitGlobalCoord.h.

◆ getPositionZ()

float getPositionZ ( ) const
inlineinherited

Get hit global position z coordinate.

Returns
Hit z coordinate.

Definition at line 73 of file EKLMHitGlobalCoord.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.

◆ getSection()

int getSection ( ) const
inlineinherited

Get section number.

Returns
Section number.

Definition at line 46 of file EKLMHitBase.h.

◆ getSector()

int getSector ( ) const
inlineinherited

Get sector number.

Returns
Sector number.

Definition at line 82 of file EKLMHitBase.h.

◆ getTime()

float getTime ( ) const
inlineinherited

Get hit time.

Returns
Hit time.

Definition at line 118 of file EKLMHitBase.h.

◆ setChiSq()

void setChiSq ( float  chisq)
inline

Set Chi^2 of the crossing point.

Parameters
[in]chisqChi^2.

Definition at line 63 of file EKLMHit2d.h.

◆ setEnergyDeposit()

void setEnergyDeposit ( float  eDep)
inlineinherited

Set EnergyDeposit.

Parameters
[in]eDepEnergy deposit.

Definition at line 109 of file EKLMHitBase.h.

◆ setLayer()

void setLayer ( int  layer)
inlineinherited

Set layer number.

Parameters
[in]layerLayer number.

Definition at line 73 of file EKLMHitBase.h.

◆ setMCTime()

void setMCTime ( float  t)
inlineinherited

Set MC time.

Parameters
[in]tTIme.

Definition at line 45 of file EKLMHitMCTime.h.

◆ setPDG()

void setPDG ( int  pdg)
inlineinherited

Set the lund code of the (leading) particle.

Parameters
[in]pdgParticle code.

Definition at line 145 of file EKLMHitBase.h.

◆ setPosition() [1/2]

void setPosition ( const TVector3 &  pos)
inherited

Set hit global position.

Parameters
[in]posPosition.

Definition at line 32 of file EKLMHitGlobalCoord.cc.

33 {
34  m_globalX = pos.X();
35  m_globalY = pos.Y();
36  m_globalZ = pos.Z();
37 }

◆ setPosition() [2/2]

void setPosition ( float  x,
float  y,
float  z 
)
inherited

Set hit global position.

Parameters
[in]xHit x coordinate.
[in]yHit y coordinate.
[in]zHit z coordinate.

Definition at line 25 of file EKLMHitGlobalCoord.cc.

◆ setSection()

void setSection ( int  Section)
inlineinherited

Set section number.

Parameters
[in]SectionSection number.

Definition at line 55 of file EKLMHitBase.h.

◆ setSector()

void setSector ( int  sector)
inlineinherited

Set sector number.

Parameters
[in]sectorSector number.

Definition at line 91 of file EKLMHitBase.h.

◆ setTime()

void setTime ( float  time)
inlineinherited

Set hit time.

Parameters
[in]timehit time.

Definition at line 127 of file EKLMHitBase.h.


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