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

Class to store track parameters of incoming MC particles relation to MCParticle filled in top/simulation/src/SensitiveBar.cc. More...

#include <TOPBarHit.h>

Inheritance diagram for TOPBarHit:
Collaboration diagram for TOPBarHit:

Public Member Functions

 TOPBarHit ()
 Default constructor.
 
 TOPBarHit (int moduleID, int PDG, TVector3 origin, TVector3 impact, TVector3 momentum, double time, double length, TVector3 impactLoc, double theta, double phi)
 Full constructor. More...
 
int getModuleID () const
 Returns module ID. More...
 
int getPDG () const
 Returns PDG code of particle. More...
 
TVector3 getProductionPoint () const
 Returns production point. More...
 
TVector3 getPosition () const
 Returns impact point. More...
 
TVector3 getLocalPosition () const
 Returns impact point. More...
 
TVector3 getMomentum () const
 Returns impact momentum. More...
 
double getLength () const
 Returns tract length from production to impact point. More...
 
double getTime () const
 Returns time of impact. More...
 
double getTheta () const
 Returns polar angle in local (bar) frame. More...
 
double getPhi () const
 Returns azimuthal angle in local (bar) frame. 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 (TOPBarHit, 3)
 ClassDef.
 

Private Attributes

int m_moduleID = 0
 TOP module ID.
 
int m_pdg = 0
 PDG code of particle.
 
float m_x0 = 0
 production point, x component
 
float m_y0 = 0
 production point, y component
 
float m_z0 = 0
 production point, z component
 
float m_x = 0
 impact point, x component
 
float m_y = 0
 impact point, y component
 
float m_z = 0
 impact point, z component
 
float m_px = 0
 impact momentum, x component
 
float m_py = 0
 impact momentum, y component
 
float m_pz = 0
 impact momentum, z component
 
float m_time = 0
 impact time
 
float m_length = 0
 length of particle trajectory to impact point
 
float m_xloc = 0
 impact point, x component in local (bar) frame
 
float m_yloc = 0
 impact point, y component in local (bar) frame
 
float m_zloc = 0
 impact point, z component in local (bar) frame
 
float m_theta = 0
 impact polar angle in local (bar) frame
 
float m_phi = 0
 impact azimuthal angle in local (bar) frame
 
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 to store track parameters of incoming MC particles relation to MCParticle filled in top/simulation/src/SensitiveBar.cc.

Definition at line 36 of file TOPBarHit.h.

Constructor & Destructor Documentation

◆ TOPBarHit()

TOPBarHit ( int  moduleID,
int  PDG,
TVector3  origin,
TVector3  impact,
TVector3  momentum,
double  time,
double  length,
TVector3  impactLoc,
double  theta,
double  phi 
)
inline

Full constructor.

Parameters
moduleIDmodule ID
PDGPDG code of particle
originproduction point
impactimpact point
momentumimpact momentum
timeimpact time
lengthlength of particle trajectory to impact point
impactLocimpact point in local (bar) frame
thetaimpact polar angle in local (bar) frame
phiimpact azimuthal angle in local (bar) frame

Definition at line 58 of file TOPBarHit.h.

62  {
63  m_moduleID = moduleID;
64  m_pdg = PDG;
65  m_x0 = (float) origin.x();
66  m_y0 = (float) origin.y();
67  m_z0 = (float) origin.z();
68  m_x = (float) impact.x();
69  m_y = (float) impact.y();
70  m_z = (float) impact.z();
71  m_px = (float) momentum.x();
72  m_py = (float) momentum.y();
73  m_pz = (float) momentum.z();
74  m_time = (float) time;
75  m_length = (float) length;
76  m_xloc = (float) impactLoc.x();
77  m_yloc = (float) impactLoc.y();
78  m_zloc = (float) impactLoc.z();
79  m_theta = (float) theta;
80  m_phi = (float) phi;
81  }
82 
87  int getModuleID() const { return m_moduleID;}
88 

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.

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

◆ getLength()

double getLength ( ) const
inline

Returns tract length from production to impact point.

Returns
track length

Definition at line 131 of file TOPBarHit.h.

◆ getLocalPosition()

TVector3 getLocalPosition ( ) const
inline

Returns impact point.

Returns
impact position

Definition at line 119 of file TOPBarHit.h.

◆ getModuleID()

int getModuleID ( ) const
inline

Returns module ID.

Returns
module ID

Definition at line 95 of file TOPBarHit.h.

◆ getMomentum()

TVector3 getMomentum ( ) const
inline

Returns impact momentum.

Returns
impact momentum vector

Definition at line 125 of file TOPBarHit.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, Particle, and MCParticle.

Definition at line 346 of file RelationsObject.h.

◆ getPDG()

int getPDG ( ) const
inline

Returns PDG code of particle.

Returns
PDG code

Definition at line 101 of file TOPBarHit.h.

◆ getPhi()

double getPhi ( ) const
inline

Returns azimuthal angle in local (bar) frame.

Returns
azimuthal angle

Definition at line 149 of file TOPBarHit.h.

◆ getPosition()

TVector3 getPosition ( ) const
inline

Returns impact point.

Returns
impact position

Definition at line 113 of file TOPBarHit.h.

◆ getProductionPoint()

TVector3 getProductionPoint ( ) const
inline

Returns production point.

Returns
production position

Definition at line 107 of file TOPBarHit.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.

◆ getTheta()

double getTheta ( ) const
inline

Returns polar angle in local (bar) frame.

Returns
polar angle

Definition at line 143 of file TOPBarHit.h.

◆ getTime()

double getTime ( ) const
inline

Returns time of impact.

Returns
time

Definition at line 137 of file TOPBarHit.h.


The documentation for this class was generated from the following file:
Belle2::TOPBarHit::m_py
float m_py
impact momentum, y component
Definition: TOPBarHit.h:162
Belle2::TOPBarHit::m_moduleID
int m_moduleID
TOP module ID.
Definition: TOPBarHit.h:153
Belle2::TOPBarHit::m_length
float m_length
length of particle trajectory to impact point
Definition: TOPBarHit.h:165
Belle2::TOPBarHit::m_pz
float m_pz
impact momentum, z component
Definition: TOPBarHit.h:163
Belle2::TOPBarHit::m_theta
float m_theta
impact polar angle in local (bar) frame
Definition: TOPBarHit.h:169
Belle2::TOPBarHit::m_time
float m_time
impact time
Definition: TOPBarHit.h:164
Belle2::TOPBarHit::m_y0
float m_y0
production point, y component
Definition: TOPBarHit.h:156
Belle2::TOPBarHit::m_px
float m_px
impact momentum, x component
Definition: TOPBarHit.h:161
Belle2::TOPBarHit::m_x
float m_x
impact point, x component
Definition: TOPBarHit.h:158
Belle2::TOPBarHit::m_zloc
float m_zloc
impact point, z component in local (bar) frame
Definition: TOPBarHit.h:168
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::TOPBarHit::m_xloc
float m_xloc
impact point, x component in local (bar) frame
Definition: TOPBarHit.h:166
Belle2::TOPBarHit::m_x0
float m_x0
production point, x component
Definition: TOPBarHit.h:155
Belle2::TOPBarHit::getModuleID
int getModuleID() const
Returns module ID.
Definition: TOPBarHit.h:95
Belle2::TOPBarHit::m_z
float m_z
impact point, z component
Definition: TOPBarHit.h:160
Belle2::TOPBarHit::m_phi
float m_phi
impact azimuthal angle in local (bar) frame
Definition: TOPBarHit.h:170
Belle2::TOPBarHit::m_z0
float m_z0
production point, z component
Definition: TOPBarHit.h:157
Belle2::TOPBarHit::m_yloc
float m_yloc
impact point, y component in local (bar) frame
Definition: TOPBarHit.h:167
Belle2::TOPBarHit::m_y
float m_y
impact point, y component
Definition: TOPBarHit.h:159
Belle2::TOPBarHit::m_pdg
int m_pdg
PDG code of particle.
Definition: TOPBarHit.h:154