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

KLM 2d hit. More...

#include <KLMHit2d.h>

Inheritance diagram for KLMHit2d:
Collaboration diagram for KLMHit2d:

Public Member Functions

 KLMHit2d ()
 Constructor.
 
 KLMHit2d (KLMDigit *digit1, KLMDigit *digit2)
 Constructor from two orthogonal KLMDigits (EKLM). More...
 
 KLMHit2d (const BKLMHit1d *hitPhi, const BKLMHit1d *hitZ, const CLHEP::Hep3Vector &globalPos, double time)
 Constructor with initial values (BKLM). More...
 
 ~KLMHit2d ()
 Destructor.
 
int getSubdetector () const
 Get subdetector number. More...
 
void setSubdetector (int subdetector)
 Set subdetector number. More...
 
int getSection () const
 Get section number. More...
 
void setSection (int section)
 Set section number. More...
 
int getSector () const
 Get sector number. More...
 
void setSector (int sector)
 Set sector number. More...
 
int getLayer () const
 Get layer number. More...
 
void setLayer (int layer)
 Set layer number. More...
 
void setXStripMin (int strip)
 Set first strip number for EKLM hit in the x-measuring plane. More...
 
void setXStripMax (int strip)
 Set last strip number for EKLM hit in the x-measuring plane. More...
 
void setYStripMin (int strip)
 Set first strip number for EKLM hit in the y-measuring plane. More...
 
void setYStripMax (int strip)
 Set last strip number for EKLM hit in y-measuring plane. More...
 
bool inRPC () const
 Determine whether this 2D hit is in RPC or scintillator.
 
int getZStripMin () const
 Get strip number for z plane.
 
int getZStripMax () const
 Get last strip number for z plane.
 
double getZStripAve () const
 Get average strip number for z plane.
 
int getPhiStripMin () const
 Get strip number for phi plane.
 
int getPhiStripMax () const
 Get last strip number for phi plane.
 
double getPhiStripAve () const
 Get average strip number for phi plane.
 
int getXStripMin () const
 Get first strip number for EKLM hit in the x-measuring plane.
 
int getXStripMax () const
 Get last strip number for EKLM hit in the x-measuring plane.
 
int getYStripMin () const
 Get first strip number for EKLM hit in the y-measuring plane.
 
int getYStripMax () const
 Get last strip number for EKLM hit in the y-measuring plane.
 
void setPosition (float x, float y, float z)
 Set hit global position. More...
 
float getPositionX () const
 Set hit global position. More...
 
float getPositionY () const
 Get hit global position y coordinate. More...
 
float getPositionZ () const
 Get hit global position z coordinate. More...
 
ROOT::Math::XYZVector getPosition () const
 Get hit global position. More...
 
float getTime () const
 Get hit time. More...
 
void setTime (float time)
 Set hit time. More...
 
void setMCTime (float t)
 Set MC time. More...
 
float getMCTime () const
 Get MC time. More...
 
float getEnergyDeposit () const
 Get energy deposit. More...
 
void setEnergyDeposit (float energyDeposit)
 Set energy deposit. More...
 
float getChiSq () const
 Get Chi^2 of the crossing point. More...
 
void setChiSq (float chisq)
 Set Chi^2 of the crossing point. More...
 
bool isOutOfTime () const
 Determine whether this 2D hit is outside the trigger-coincidence window.
 
void isOutOfTime (bool outOfTime)
 Set whether this 2D hit is outside the trigger-coincidence window.
 
bool isOnTrack () const
 Determine whether this 2D hit is associated with a muid-extrapolated track.
 
void isOnTrack (bool onTrack)
 Set whether this 2D hit is associated with a muid-extrapolated track.
 
bool isOnStaTrack () const
 Determine whether this 2D hit is associated with a BKLM stand-alone track.
 
void isOnStaTrack (bool onStaTrack)
 Set whether this 2D hit is associated with a BKLM stand-alone track.
 
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::KLMHit2d, 1)
 Class version.
 

Private Attributes

int m_Subdetector = 0
 Number of subdetector.
 
int m_Section = 0
 Number of section.
 
int m_Sector = 0
 Number of sector.
 
int m_Layer = 0
 Number of layer.
 
int m_Strip [KLMElementNumbers::getMaximalPlaneNumber()] = {0}
 Number of strip in each plane.
 
int m_LastStrip [KLMElementNumbers::getMaximalPlaneNumber()] = {0}
 Number of last strip in each plane.
 
float m_GlobalX = 0.0
 Global position X coordinate.
 
float m_GlobalY = 0.0
 Global position Y coordinate.
 
float m_GlobalZ = 0.0
 Global position Z coordinate.
 
float m_Time = 0.0
 Time of the hit.
 
float m_MCTime = 0.0
 MC time.
 
float m_EnergyDeposit = 0.0
 Energy deposition.
 
float m_ChiSq = 0.0
 Chi^2 of the hit.
 
bool m_IsOutOfTime = false
 Whether this 2D hit is outside the trigger-coincidence window.
 
bool m_IsOnTrack = false
 Whether this 2D hit is associated with a muid-extrapolated track.
 
bool m_IsOnStaTrack = false
 Wether this 2D hit is associated with a BKLM stand-alone track.
 
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 2d hit.

Definition at line 33 of file KLMHit2d.h.

Constructor & Destructor Documentation

◆ KLMHit2d() [1/2]

KLMHit2d ( KLMDigit digit1,
KLMDigit digit2 
)
explicit

Constructor from two orthogonal KLMDigits (EKLM).

Parameters
[in]digit1KLMDigit in plane 1.
[in]digit2KLMDigit in plane 2.

Definition at line 22 of file KLMHit2d.cc.

22  :
23  m_ChiSq(-1)
24 {
26  B2FATAL("Trying to construct a KLMHit2d using KLMDigit from BKLM.");
28  setSection(digit1->getSection());
29  setLayer(digit1->getLayer());
30  setSector(digit1->getSector());
31  // multi-strip hit will have a range of struck scintillators => worse position resolution in ext/muid
32  // see docs.belle2.org/record/255 Figure 2 for strip orientations of planes 1 and 2 in each sector
33  if (getSector() <= 2) { // sectors 1 and 2
34  // digit1 (digit2) from EKLM plane 1 (2) measures global y (x) coordinate
35  setYStripMin(digit1->getStrip());
36  setYStripMax(std::max(digit1->getStrip(), digit1->getLastStrip()));
37  setXStripMin(digit2->getStrip());
38  setXStripMax(std::max(digit2->getStrip(), digit2->getLastStrip()));
39  } else { // sectors 3 and 4
40  // digit1 (digit2) from EKLM plane 1 (2) measures global x (y) coordinate
41  setXStripMin(digit1->getStrip());
42  setXStripMax(std::max(digit1->getStrip(), digit1->getLastStrip()));
43  setYStripMin(digit2->getStrip());
44  setYStripMax(std::max(digit2->getStrip(), digit2->getLastStrip()));
45  }
46 }
int getSubdetector() const
Get subdetector number.
Definition: KLMDigit.h:72
int getLayer() const
Get layer number.
Definition: KLMDigit.h:126
int getSection() const
Get section number.
Definition: KLMDigit.h:90
int getStrip() const
Get strip number.
Definition: KLMDigit.h:162
int getSector() const
Get sector number.
Definition: KLMDigit.h:108
int getLastStrip() const
Get last strip number (for multi-strip digits).
Definition: KLMDigit.h:180
float m_ChiSq
Chi^2 of the hit.
Definition: KLMHit2d.h:489
void setSection(int section)
Set section number.
Definition: KLMHit2d.h:105
void setXStripMin(int strip)
Set first strip number for EKLM hit in the x-measuring plane.
Definition: KLMHit2d.h:150
int getSector() const
Get sector number.
Definition: KLMHit2d.h:114
void setYStripMin(int strip)
Set first strip number for EKLM hit in the y-measuring plane.
Definition: KLMHit2d.h:168
void setSector(int sector)
Set sector number.
Definition: KLMHit2d.h:123
int m_Subdetector
Number of subdetector.
Definition: KLMHit2d.h:451
void setXStripMax(int strip)
Set last strip number for EKLM hit in the x-measuring plane.
Definition: KLMHit2d.h:159
void setYStripMax(int strip)
Set last strip number for EKLM hit in y-measuring plane.
Definition: KLMHit2d.h:177
void setLayer(int layer)
Set layer number.
Definition: KLMHit2d.h:141

◆ KLMHit2d() [2/2]

KLMHit2d ( const BKLMHit1d hitPhi,
const BKLMHit1d hitZ,
const CLHEP::Hep3Vector &  globalPos,
double  time 
)

Constructor with initial values (BKLM).

Parameters
[in]hitPhiReconstructed BKLMHit1d along the phi-measuring direction.
[in]hitZReconstructed BKLMHit1d along the z-measuring direction.
[in]globalPosReconstructed position in global coordinates.
[in]timeReconstructed time of the hit.

Definition at line 49 of file KLMHit2d.cc.

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 384 of file KLMHit2d.h.

385  {
386  return m_ChiSq;
387  }

◆ getEnergyDeposit()

float getEnergyDeposit ( ) const
inline

Get energy deposit.

Returns
Energy deposit.

Definition at line 366 of file KLMHit2d.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.

Definition at line 132 of file KLMHit2d.h.

◆ getMCTime()

float getMCTime ( ) const
inline

Get MC time.

Returns
Time.

Definition at line 357 of file KLMHit2d.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.

◆ getPosition()

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

Get hit global position.

Returns
Hit coordinates.

Definition at line 321 of file KLMHit2d.h.

◆ getPositionX()

float getPositionX ( ) const
inline

Set hit global position.

Parameters
[in]posPosition. Get hit global position x coordinate.
Returns
Hit x coordinate.

Definition at line 294 of file KLMHit2d.h.

◆ getPositionY()

float getPositionY ( ) const
inline

Get hit global position y coordinate.

Returns
Hit y coordinate.

Definition at line 303 of file KLMHit2d.h.

◆ getPositionZ()

float getPositionZ ( ) const
inline

Get hit global position z coordinate.

Returns
Hit z coordinate.

Definition at line 312 of file KLMHit2d.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 section number.

Returns
Section number.

Definition at line 96 of file KLMHit2d.h.

◆ getSector()

int getSector ( ) const
inline

Get sector number.

Returns
Sector number.

Definition at line 114 of file KLMHit2d.h.

◆ getSubdetector()

int getSubdetector ( ) const
inline

Get subdetector number.

Returns
Subdetector number.

Definition at line 78 of file KLMHit2d.h.

◆ getTime()

float getTime ( ) const
inline

Get hit time.

Returns
Hit time.

Definition at line 330 of file KLMHit2d.h.

◆ setChiSq()

void setChiSq ( float  chisq)
inline

Set Chi^2 of the crossing point.

Parameters
[in]chisqChi^2.

Definition at line 393 of file KLMHit2d.h.

◆ setEnergyDeposit()

void setEnergyDeposit ( float  energyDeposit)
inline

Set energy deposit.

Parameters
[in]energyDepositEnergy deposit.

Definition at line 375 of file KLMHit2d.h.

◆ setLayer()

void setLayer ( int  layer)
inline

Set layer number.

Parameters
[in]layerLayer number.

Definition at line 141 of file KLMHit2d.h.

◆ setMCTime()

void setMCTime ( float  t)
inline

Set MC time.

Parameters
[in]tTIme.

Definition at line 348 of file KLMHit2d.h.

◆ setPosition()

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

Set hit global position.

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

Definition at line 277 of file KLMHit2d.h.

◆ setSection()

void setSection ( int  section)
inline

Set section number.

Parameters
[in]sectionSection number.

Definition at line 105 of file KLMHit2d.h.

◆ setSector()

void setSector ( int  sector)
inline

Set sector number.

Parameters
[in]sectorSector number.

Definition at line 123 of file KLMHit2d.h.

◆ setSubdetector()

void setSubdetector ( int  subdetector)
inline

Set subdetector number.

Parameters
[in]subdetectorSubdetector number.

Definition at line 87 of file KLMHit2d.h.

◆ setTime()

void setTime ( float  time)
inline

Set hit time.

Parameters
[in]timehit time.

Definition at line 339 of file KLMHit2d.h.

◆ setXStripMax()

void setXStripMax ( int  strip)
inline

Set last strip number for EKLM hit in the x-measuring plane.

Parameters
[in]stripStrip number.

Definition at line 159 of file KLMHit2d.h.

◆ setXStripMin()

void setXStripMin ( int  strip)
inline

Set first strip number for EKLM hit in the x-measuring plane.

Parameters
[in]stripStrip number.

Definition at line 150 of file KLMHit2d.h.

◆ setYStripMax()

void setYStripMax ( int  strip)
inline

Set last strip number for EKLM hit in y-measuring plane.

Parameters
[in]stripStrip number.

Definition at line 177 of file KLMHit2d.h.

◆ setYStripMin()

void setYStripMin ( int  strip)
inline

Set first strip number for EKLM hit in the y-measuring plane.

Parameters
[in]stripStrip number.

Definition at line 168 of file KLMHit2d.h.


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