Belle II Software  release-08-01-10
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, ROOT::Math::XYZPoint origin, ROOT::Math::XYZPoint impact, ROOT::Math::XYZVector momentum, double time, double length, ROOT::Math::XYZPoint impactLoc, double theta, double phi)
 Full constructor. More...
 
int getModuleID () const
 Returns module ID. More...
 
int getPDG () const
 Returns PDG code of particle. More...
 
ROOT::Math::XYZPoint getProductionPoint () const
 Returns production point. More...
 
ROOT::Math::XYZPoint getPosition () const
 Returns impact point. More...
 
TVector3 getPositionTVector3 () const
 Returns impact point TODO: to be removed when the constructor from GenVector classes is provided in ExtHit. More...
 
ROOT::Math::XYZPoint getLocalPosition () const
 Returns impact point. More...
 
ROOT::Math::XYZVector getMomentum () const
 Returns impact momentum. More...
 
TVector3 getMomentumTVector3 () const
 Returns impact momentum TODO: to be removed when the constructor from GenVector classes is provided in ExtHit. 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 28 of file TOPBarHit.h.

Constructor & Destructor Documentation

◆ TOPBarHit()

TOPBarHit ( int  moduleID,
int  PDG,
ROOT::Math::XYZPoint  origin,
ROOT::Math::XYZPoint  impact,
ROOT::Math::XYZVector  momentum,
double  time,
double  length,
ROOT::Math::XYZPoint  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 50 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  }
float m_z0
production point, z component
Definition: TOPBarHit.h:163
float m_time
impact time
Definition: TOPBarHit.h:170
float m_xloc
impact point, x component in local (bar) frame
Definition: TOPBarHit.h:172
float m_zloc
impact point, z component in local (bar) frame
Definition: TOPBarHit.h:174
float m_phi
impact azimuthal angle in local (bar) frame
Definition: TOPBarHit.h:176
int m_moduleID
TOP module ID.
Definition: TOPBarHit.h:159
int m_pdg
PDG code of particle.
Definition: TOPBarHit.h:160
float m_py
impact momentum, y component
Definition: TOPBarHit.h:168
float m_y0
production point, y component
Definition: TOPBarHit.h:162
float m_pz
impact momentum, z component
Definition: TOPBarHit.h:169
float m_x0
production point, x component
Definition: TOPBarHit.h:161
float m_px
impact momentum, x component
Definition: TOPBarHit.h:167
float m_y
impact point, y component
Definition: TOPBarHit.h:165
float m_length
length of particle trajectory to impact point
Definition: TOPBarHit.h:171
float m_yloc
impact point, y component in local (bar) frame
Definition: TOPBarHit.h:173
float m_z
impact point, z component
Definition: TOPBarHit.h:166
float m_x
impact point, x component
Definition: TOPBarHit.h:164
float m_theta
impact polar angle in local (bar) frame
Definition: TOPBarHit.h:175

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.

◆ getLength()

double getLength ( ) const
inline

Returns tract length from production to impact point.

Returns
track length

Definition at line 137 of file TOPBarHit.h.

◆ getLocalPosition()

ROOT::Math::XYZPoint getLocalPosition ( ) const
inline

Returns impact point.

Returns
impact position

Definition at line 118 of file TOPBarHit.h.

◆ getModuleID()

int getModuleID ( ) const
inline

Returns module ID.

Returns
module ID

Definition at line 87 of file TOPBarHit.h.

◆ getMomentum()

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

Returns impact momentum.

Returns
impact momentum vector

Definition at line 124 of file TOPBarHit.h.

◆ getMomentumTVector3()

TVector3 getMomentumTVector3 ( ) const
inline

Returns impact momentum TODO: to be removed when the constructor from GenVector classes is provided in ExtHit.

Returns
impact momentum vector

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

Definition at line 344 of file RelationsObject.h.

◆ getPDG()

int getPDG ( ) const
inline

Returns PDG code of particle.

Returns
PDG code

Definition at line 93 of file TOPBarHit.h.

◆ getPhi()

double getPhi ( void  ) const
inline

Returns azimuthal angle in local (bar) frame.

Returns
azimuthal angle

Definition at line 155 of file TOPBarHit.h.

◆ getPosition()

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

Returns impact point.

Returns
impact position

Definition at line 105 of file TOPBarHit.h.

◆ getPositionTVector3()

TVector3 getPositionTVector3 ( ) const
inline

Returns impact point TODO: to be removed when the constructor from GenVector classes is provided in ExtHit.

Returns
impact position

Definition at line 112 of file TOPBarHit.h.

◆ getProductionPoint()

ROOT::Math::XYZPoint getProductionPoint ( ) const
inline

Returns production point.

Returns
production position

Definition at line 99 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 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.

◆ getTheta()

double getTheta ( ) const
inline

Returns polar angle in local (bar) frame.

Returns
polar angle

Definition at line 149 of file TOPBarHit.h.

◆ getTime()

double getTime ( ) const
inline

Returns time of impact.

Returns
time

Definition at line 143 of file TOPBarHit.h.


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