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

This class stores additional information to every CDC/SVD/PXD hit stored in a RecoTrack. More...

#include <RecoHitInformation.h>

Inheritance diagram for RecoHitInformation:
Collaboration diagram for RecoHitInformation:

Public Types

enum  RightLeftInformation {
  c_undefinedRightLeftInformation ,
  c_invalidRightLeftInformation ,
  c_right ,
  c_left
}
 The RightLeft information of the hit which is only valid for CDC hits.
 
enum  OriginTrackFinder {
  c_undefinedTrackFinder ,
  c_MCTrackFinderPriorityHit ,
  c_MCTrackFinderAuxiliaryHit ,
  c_invalidTrackFinder ,
  c_CDCTrackFinder ,
  c_LocalTrackFinder ,
  c_SegmentTrackCombiner ,
  c_VXDTrackFinder ,
  c_SVDtoCDCCKF ,
  c_ECLtoCDCCKF ,
  c_CDCtoSVDCKF ,
  c_SVDtoPXDCKF ,
  c_SVDHough ,
  c_ReattachCDCWireHitsToRecoTracks ,
  c_Trasan ,
  c_other
}
 The TrackFinder which has added the hit to the track.
 
enum  RecoHitFlag {
  c_undefinedRecoHitFlag ,
  c_dismissedByFit ,
  c_pruned
}
 Another flag to be used (currently unused)
 
enum  RecoHitDetector {
  c_undefinedTrackingDetector ,
  c_invalidTrackingDetector ,
  c_SVD ,
  c_PXD ,
  c_CDC ,
  c_EKLM ,
  c_BKLM
}
 The detector this hit comes from (which is of course also visible in the hit type)
 
typedef SVDCluster UsedSVDHit
 Define, use of clusters or true hits for SVD. More...
 
typedef PXDCluster UsedPXDHit
 Define, use of clusters or true hits for PXD.
 
typedef CDCHit UsedCDCHit
 Define, use of CDC hits as CDC hits (for symmetry).
 
typedef KLMHit2d UsedBKLMHit
 Define, use of KLMHit2d as BKLM hits.
 
typedef EKLMAlignmentHit UsedEKLMHit
 Define, use of EKLMHit2d as EKLM hits.
 

Public Member Functions

 RecoHitInformation ()
 Empty constructor for root.
 
 RecoHitInformation (const UsedCDCHit *cdcHit, RightLeftInformation rightLeftInformation, OriginTrackFinder foundByTrackFinder, unsigned int sortingParameter)
 Create hit information for a CDC hit with the given information. More...
 
 RecoHitInformation (const UsedPXDHit *pxdHit, OriginTrackFinder foundByTrackFinder, unsigned int sortingParameter)
 Create hit information for a PXD hit with the given information. More...
 
 RecoHitInformation (const UsedSVDHit *svdHit, OriginTrackFinder foundByTrackFinder, unsigned int sortingParameter)
 Create hit information for a SVD hit with the given information. More...
 
 RecoHitInformation (const UsedEKLMHit *eklmHit, OriginTrackFinder foundByTrackFinder, unsigned int sortingParameter)
 Create hit information for a EKLM hit with the given information. More...
 
 RecoHitInformation (const UsedBKLMHit *bklmHit, OriginTrackFinder foundByTrackFinder, unsigned int sortingParameter)
 Create hit information for a BKLM hit with the given information. More...
 
RecoHitFlag getFlag () const
 Get the additional flag.
 
void setFlag (RecoHitFlag flag)
 Set the additional flag.
 
OriginTrackFinder getFoundByTrackFinder () const
 Get which track finder has found the track.
 
void setFoundByTrackFinder (OriginTrackFinder foundByTrackFinder)
 Set which track finder has found the track.
 
unsigned int getSortingParameter () const
 Get the sorting parameter.
 
void setSortingParameter (unsigned int sortingParameter)
 Set the sorting parameter.
 
RightLeftInformation getRightLeftInformation () const
 Get the right-left-information.
 
void setRightLeftInformation (RightLeftInformation rightLeftInformation)
 Set the right-left-information.
 
RecoHitDetector getTrackingDetector () const
 Get the detector this hit comes from. More...
 
bool useInFit () const
 Get the flag, whether this his should be used in a fit or not.
 
void setUseInFit (const bool useInFit=true)
 Set the hit to be used (default) or not in the next fit.
 
void setCreatedTrackPointID (int trackPointID)
 Set the id of the created track point to the one from the genfit::Track. More...
 
int getCreatedTrackPointID () const
 Get the id of the TrackPoint related to this reco hit information in the genfit::Track. 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

template<class HitType >
 RecoHitInformation (const HitType *hit, RecoHitDetector trackingDetector, RightLeftInformation rightLeftInformation, OriginTrackFinder foundByTrackFinder, unsigned int sortingParameter)
 Create hit information for a generic hit with the given information. More...
 
 ClassDef (RecoHitInformation, 6)
 This class implements additional information for hits.
 

Private Attributes

RecoHitDetector m_trackingDetector = RecoHitDetector::c_undefinedTrackingDetector
 The tracking detector this hit comes from (can not be changed once created)
 
RightLeftInformation m_rightLeftInformation = RightLeftInformation::c_undefinedRightLeftInformation
 The right-left-information of the hit. Can be invalid (for VXD hits) or unknown.
 
unsigned int m_sortingParameter = 0
 The sorting parameter as an index.
 
OriginTrackFinder m_foundByTrackFinder = OriginTrackFinder::c_undefinedTrackFinder
 Which track finder has found this hit and added it to the reco track. More...
 
RecoHitFlag m_flag = RecoHitFlag::c_undefinedRecoHitFlag
 An additional flag to be used.
 
bool m_useInFit = true
 Set this flag to falso to not create a measurement out of this hit.
 
int m_createdTrackPointID = -1
 The index for the created TrackPoint in the genfit::Track of the related RecoTrack. More...
 
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

This class stores additional information to every CDC/SVD/PXD hit stored in a RecoTrack.

Every hit information belongs to a single hit and a single RecoTrack (stored with relation). If one hit should belong to more than one track, you have to create more than one RecoHitInformation.

The RecoHitInformation stores information on:

  • the TrackFinder that added the hit to the track
  • RL information (valid for for CDC hits only)
  • the sorting parameter of the hit. This is the index of this hit in the reco track.
  • additional flags

The stored information can be used when transforming a RecoTrack into a genfit::Track or genfit::TrackCand

Definition at line 38 of file RecoHitInformation.h.

Member Typedef Documentation

◆ UsedSVDHit

Define, use of clusters or true hits for SVD.

You have to decide, if you want to use Clusters or true hits at compile-time. In the real experiment, we want to use clusters without overhead from checking every time, if we should use true hits instead.

Definition at line 47 of file RecoHitInformation.h.

Constructor & Destructor Documentation

◆ RecoHitInformation() [1/6]

RecoHitInformation ( const UsedCDCHit cdcHit,
RightLeftInformation  rightLeftInformation,
OriginTrackFinder  foundByTrackFinder,
unsigned int  sortingParameter 
)
inline

Create hit information for a CDC hit with the given information.

Adds the relation to the hit automatically.

Parameters
cdcHitThe hit to create this information for.
rightLeftInformationThe RL-information.
foundByTrackFinderWhich track finder has found this hit?
sortingParameterThe sorting parameter of this hit.

Definition at line 133 of file RecoHitInformation.h.

134  :
135  RecoHitInformation(cdcHit, RecoHitDetector::c_CDC, rightLeftInformation, foundByTrackFinder, sortingParameter)
136  {
137  }
RecoHitInformation()
Empty constructor for root.

◆ RecoHitInformation() [2/6]

RecoHitInformation ( const UsedPXDHit pxdHit,
OriginTrackFinder  foundByTrackFinder,
unsigned int  sortingParameter 
)
inline

Create hit information for a PXD hit with the given information.

Adds the relation to the hit automatically.

Parameters
pxdHitThe hit to create this information for.
foundByTrackFinderWhich track finder has found this hit?
sortingParameterThe sorting parameter of this hit.

Definition at line 145 of file RecoHitInformation.h.

◆ RecoHitInformation() [3/6]

RecoHitInformation ( const UsedSVDHit svdHit,
OriginTrackFinder  foundByTrackFinder,
unsigned int  sortingParameter 
)
inline

Create hit information for a SVD hit with the given information.

Adds the relation to the hit automatically.

Parameters
svdHitThe hit to create this information for.
foundByTrackFinderWhich track finder has found this hit?
sortingParameterThe sorting parameter of this hit.

Definition at line 158 of file RecoHitInformation.h.

◆ RecoHitInformation() [4/6]

RecoHitInformation ( const UsedEKLMHit eklmHit,
OriginTrackFinder  foundByTrackFinder,
unsigned int  sortingParameter 
)
inline

Create hit information for a EKLM hit with the given information.

Adds the relation to the hit automatically.

Parameters
eklmHitThe hit to create this information for.
foundByTrackFinderWhich track finder has found this hit?
sortingParameterThe sorting parameter of this hit.

Definition at line 171 of file RecoHitInformation.h.

◆ RecoHitInformation() [5/6]

RecoHitInformation ( const UsedBKLMHit bklmHit,
OriginTrackFinder  foundByTrackFinder,
unsigned int  sortingParameter 
)
inline

Create hit information for a BKLM hit with the given information.

Adds the relation to the hit automatically.

Parameters
bklmHitThe hit to create this information for.
foundByTrackFinderWhich track finder has found this hit?
sortingParameterThe sorting parameter of this hit.

Definition at line 184 of file RecoHitInformation.h.

◆ RecoHitInformation() [6/6]

RecoHitInformation ( const HitType *  hit,
RecoHitDetector  trackingDetector,
RightLeftInformation  rightLeftInformation,
OriginTrackFinder  foundByTrackFinder,
unsigned int  sortingParameter 
)
inlineprivate

Create hit information for a generic hit with the given information.

Adds the relation to the hit automatically.

Parameters
hitthe hit to create a reco hit information for.
trackingDetectorThe detector the hit comes from.
rightLeftInformationThe right left information (can be invalid)
foundByTrackFinderWhich track finder has found the hit.
sortingParameterThe sorting parameter of the hit.

Definition at line 309 of file RecoHitInformation.h.

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.

◆ getCreatedTrackPointID()

int getCreatedTrackPointID ( ) const
inline

Get the id of the TrackPoint related to this reco hit information in the genfit::Track.

Do not use this method unless you really know what you are doing. Better, use the methods of the RecoTrack itself to retrieve the TrackPoint directly.

Definition at line 273 of file RecoHitInformation.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.

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

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

◆ getTrackingDetector()

RecoHitDetector getTrackingDetector ( ) const
inline

Get the detector this hit comes from.

(can not be changed once created)

Definition at line 240 of file RecoHitInformation.h.

◆ setCreatedTrackPointID()

void setCreatedTrackPointID ( int  trackPointID)
inline

Set the id of the created track point to the one from the genfit::Track.

This should only be used, if you really know what you are doing.

Definition at line 261 of file RecoHitInformation.h.

Member Data Documentation

◆ m_createdTrackPointID

int m_createdTrackPointID = -1
private

The index for the created TrackPoint in the genfit::Track of the related RecoTrack.

Do not use this id, if you do not really know the consequences, but let the RecoTrack handle the internals.

Definition at line 298 of file RecoHitInformation.h.

◆ m_foundByTrackFinder

OriginTrackFinder m_foundByTrackFinder = OriginTrackFinder::c_undefinedTrackFinder
private

Which track finder has found this hit and added it to the reco track.

Can only be used if creating the RecoTrack in the track finder.

Definition at line 288 of file RecoHitInformation.h.


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