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

Store KLM TRG hit information as a ROOT object. More...

#include <KLMTriggerHit.h>

Inheritance diagram for KLMTriggerHit:
Collaboration diagram for KLMTriggerHit:

Public Member Functions

 KLMTriggerHit ()
 Empty constructor for ROOT IO (needed to make the class storable)
 
 KLMTriggerHit (int section, int sector, int layer, int phiStrip, int zStrip)
 Constructor with initial values for a hit. More...
 
virtual ~KLMTriggerHit ()
 Destructor.
 
int getSection () const
 Get detector end. More...
 
int getSector () const
 Get sector number. More...
 
int getLayer () const
 Get layer number. More...
 
int getPhiStrip () const
 Get phi strip number. More...
 
int getZStrip () const
 Get z strip number. More...
 
double getX () const
 Get x coordinate. More...
 
double getY () const
 Get y coordinate. More...
 
double getZ () const
 Get z coordinate. More...
 
int getXInt () const
 Get x integer coordinate. More...
 
int getYInt () const
 Get y integer coordinate. More...
 
int getZInt () const
 Get z integer coordinate. More...
 
void setX (double x)
 Set x coordinate. More...
 
void setY (double y)
 Set y coordinate. More...
 
void setZ (double z)
 Set z coordinate. More...
 
void setXInt (int xInt)
 Set x integer coordinate. More...
 
void setYInt (int yInt)
 Set y integer coordinate. More...
 
void setZInt (int zInt)
 Set z integer coordinate. 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 (KLMTriggerHit, 3)
 Needed to make the ROOT object storable.
 

Private Attributes

int m_section
 section number
 
int m_sector
 sector number
 
int m_layer
 layer
 
int m_phiStrip
 phi channel number
 
int m_zStrip
 z channel number
 
double m_x
 x coordinate
 
double m_y
 y coordinate
 
double m_z
 z coordinate
 
int m_xInt
 x integer coordinate in 1/8 cm
 
int m_yInt
 y integer coordinate in 1/8 cm
 
int m_zInt
 z integer coordinate in 1/8 cm
 
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

Store KLM TRG hit information as a ROOT object.

Definition at line 20 of file KLMTriggerHit.h.

Constructor & Destructor Documentation

◆ KLMTriggerHit()

KLMTriggerHit ( int  section,
int  sector,
int  layer,
int  phiStrip,
int  zStrip 
)
inline

Constructor with initial values for a hit.

Parameters
sectiondetector end (forward=true and backward=false)
sectorsector number
layerlayer number
phiStripphi strip number
zStripz strip number

Definition at line 44 of file KLMTriggerHit.h.

44  :
45  m_section(section),
46  m_sector(sector),
47  m_layer(layer),
48  m_phiStrip(phiStrip),
49  m_zStrip(zStrip),
50  m_x(0.0),
51  m_y(0.0),
52  m_z(0.0),
53  m_xInt(0),
54  m_yInt(0),
55  m_zInt(0)
56  { }
int m_section
section number
int m_zStrip
z channel number
int m_xInt
x integer coordinate in 1/8 cm
double m_x
x coordinate
int m_zInt
z integer coordinate in 1/8 cm
int m_sector
sector number
int m_phiStrip
phi channel number
int m_yInt
y integer coordinate in 1/8 cm
double m_z
z coordinate
double m_y
y coordinate

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.

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

◆ getLayer()

int getLayer ( ) const
inline

Get layer number.

Returns
layer number of this strip (0..14)

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

◆ getPhiStrip()

int getPhiStrip ( ) const
inline

Get phi strip number.

Returns
phi strip number (0..63)

Definition at line 77 of file KLMTriggerHit.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
inline

Get detector end.

Returns
detector end (forward=true and backward=false)

Definition at line 65 of file KLMTriggerHit.h.

◆ getSector()

int getSector ( ) const
inline

Get sector number.

Returns
sector number of the hit (0..7)

Definition at line 69 of file KLMTriggerHit.h.

◆ getX()

double getX ( ) const
inline

Get x coordinate.

Returns
x coordinate of the hit

Definition at line 85 of file KLMTriggerHit.h.

◆ getXInt()

int getXInt ( ) const
inline

Get x integer coordinate.

Returns
x integer coordinate of the hit in 1/8 cm

Definition at line 97 of file KLMTriggerHit.h.

◆ getY()

double getY ( ) const
inline

Get y coordinate.

Returns
y coordinate of the hit

Definition at line 89 of file KLMTriggerHit.h.

◆ getYInt()

int getYInt ( ) const
inline

Get y integer coordinate.

Returns
y integer coordinate of the hit in 1/8 cm

Definition at line 101 of file KLMTriggerHit.h.

◆ getZ()

double getZ ( ) const
inline

Get z coordinate.

Returns
z coordinate of the hit

Definition at line 93 of file KLMTriggerHit.h.

◆ getZInt()

int getZInt ( ) const
inline

Get z integer coordinate.

Returns
z integer coordinate of the hit in 1/8 cm

Definition at line 105 of file KLMTriggerHit.h.

◆ getZStrip()

int getZStrip ( ) const
inline

Get z strip number.

Returns
z strip number (0..63)

Definition at line 81 of file KLMTriggerHit.h.

◆ setX()

void setX ( double  x)
inline

Set x coordinate.

Parameters
xx coordinate of the hit

Definition at line 111 of file KLMTriggerHit.h.

◆ setXInt()

void setXInt ( int  xInt)
inline

Set x integer coordinate.

Parameters
xx integer coordinate of the hit in 1/8 cm

Definition at line 123 of file KLMTriggerHit.h.

◆ setY()

void setY ( double  y)
inline

Set y coordinate.

Parameters
yy coordinate of the hit

Definition at line 115 of file KLMTriggerHit.h.

◆ setYInt()

void setYInt ( int  yInt)
inline

Set y integer coordinate.

Parameters
yy integer coordinate of the hit in 1/8 cm

Definition at line 127 of file KLMTriggerHit.h.

◆ setZ()

void setZ ( double  z)
inline

Set z coordinate.

Parameters
zz coordinate of the hit

Definition at line 119 of file KLMTriggerHit.h.

◆ setZInt()

void setZInt ( int  zInt)
inline

Set z integer coordinate.

Parameters
zz integer coordinate of the hit in 1/8 cm

Definition at line 131 of file KLMTriggerHit.h.


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