Belle II Software development
CDCMCHitLookUp Class Reference

Interface class to the Monte Carlo information for individual hits. More...

#include <CDCMCHitLookUp.h>

Public Member Functions

 CDCMCHitLookUp ()=default
 Default constructor, needs to be public for initialization in CDCMCManager.
 
 CDCMCHitLookUp (CDCMCHitLookUp &)=delete
 Singleton: Delete copy constructor and assignment operator.
 
CDCMCHitLookUpoperator= (const CDCMCHitLookUp &)=delete
 Operator =.
 
void fill () const
 Method for forwarding a request to fill the Monte Carlo lookup tables from Python.
 
const Belle2::CDCSimHitgetSimHit (const CDCHit *ptrHit) const
 Getter for the CDCSimHit which is related to the CDCHit contained in the given wire hit.
 
const Belle2::MCParticlegetMCParticle (const CDCHit *ptrHit) const
 Getter for the MCParticle which is related to the CDCHit contained in the given wire hit.
 
const Vector2D getRefPos2D (const CDCHit *ptrHit) const
 Getter for the two dimensional reference position of the wire the given hit is located on - mainly for the python event display.
 
float getRefDriftLength (const CDCHit *ptrHit) const
 Getter for the reference drift length in the two dimensional projection.
 
const Vector3D getRecoPos3D (const CDCHit *ptrHit) const
 Getter for the three dimensional position of the primary ionisation for the hit.
 
const Vector3D getClosestPrimaryRecoPos3D (const CDCHit *ptrHit) const
 Getter for the three dimensional position of the ionisation of the primary simulated hit for the hit.
 
bool isReassignedSecondary (const CDCHit *ptrHit) const
 Indicates if the hit was reassigned to a different mc particle because it was caused by a secondary.
 
const CDCSimHitgetClosestPrimarySimHit (const CDCHit *ptrHit) const
 Getter for the closest simulated hit of a primary particle to the given hit - may return nullptr of no closest is found.
 
ITrackType getMCTrackId (const CDCHit *ptrHit) const
 Returns the track id for the hit.
 
bool isBackground (const CDCHit *ptrHit) const
 Returns if this hit is considered background.
 
Index getInTrackId (const CDCHit *ptrHit) const
 Returns the position of the wire hit in the track along the travel direction.
 
Index getInTrackSegmentId (const CDCHit *ptrHit) const
 Returns the id of the segment in the track.
 
Index getNPassedSuperLayers (const CDCHit *ptrHit) const
 Returns the number of superlayers the track traversed until this hit.
 
Index getNLoops (const CDCHit *ptrHit) const
 Returns the number of loops the track traversed until this hit.
 
ERightLeft getRLInfo (const CDCHit *ptrHit) const
 Returns the true right left passage information.
 

Static Public Member Functions

static const CDCMCHitLookUpgetInstance ()
 Getter for the singletone instance.
 

Detailed Description

Interface class to the Monte Carlo information for individual hits.

This class provides a stable interface for the underlying implementation for look ups into the Monte Carlo informations for the first stage of the algorithm.

Definition at line 31 of file CDCMCHitLookUp.h.

Member Function Documentation

◆ fill()

void fill ( ) const

Method for forwarding a request to fill the Monte Carlo lookup tables from Python.

Definition at line 36 of file CDCMCHitLookUp.cc.

37{
39}
void fill()
Fill Monte Carlo look up maps from the DataStore.
static CDCMCManager & getInstance()
Getter for the singletone instance.
Definition: CDCMCManager.cc:74

◆ getClosestPrimaryRecoPos3D()

const Vector3D getClosestPrimaryRecoPos3D ( const CDCHit ptrHit) const

Getter for the three dimensional position of the ionisation of the primary simulated hit for the hit.

Definition at line 88 of file CDCMCHitLookUp.cc.

89{
91}
static const CDCSimHitLookUp & getSimHitLookUp()
Getter for the singletone instance of the CDCSimHitLookUp.
Definition: CDCMCManager.cc:90
Vector3D getClosestPrimaryRecoPos3D(const CDCHit *ptrHit) const
Look up the position of the primary ionisation from the closest primary simulated hit.

◆ getClosestPrimarySimHit()

const CDCSimHit * getClosestPrimarySimHit ( const CDCHit ptrHit) const

Getter for the closest simulated hit of a primary particle to the given hit - may return nullptr of no closest is found.

Definition at line 101 of file CDCMCHitLookUp.cc.

102{
104}
MayBePtr< const CDCSimHit > getClosestPrimarySimHit(const CDCSimHit *ptrSimHit) const
Helper function to find the closest primary hit for the given CDCSimHit from the same MCParticle - nu...

◆ getInstance()

const CDCMCHitLookUp & getInstance ( )
static

Getter for the singletone instance.

Definition at line 30 of file CDCMCHitLookUp.cc.

31{
33}
static const CDCMCHitLookUp & getMCHitLookUp()
Getter for the singletone instance of the CDCMCHitLookUp.
Definition: CDCMCManager.cc:95

◆ getInTrackId()

Index getInTrackId ( const CDCHit ptrHit) const

Returns the position of the wire hit in the track along the travel direction.

Definition at line 127 of file CDCMCHitLookUp.cc.

128{
130}
static const CDCMCTrackStore & getMCTrackStore()
Getter for the singletone instance of the CDCMCTrackStore.
Definition: CDCMCManager.cc:85
Index getInTrackId(const CDCHit *ptrHit) const
Getter for the index of the hit within its track.

◆ getInTrackSegmentId()

Index getInTrackSegmentId ( const CDCHit ptrHit) const

Returns the id of the segment in the track.

Definition at line 133 of file CDCMCHitLookUp.cc.

134{
136}
Index getInTrackSegmentId(const CDCHit *ptrHit) const
Getter for the index of the segment of the hit within its track.

◆ getMCParticle()

const Belle2::MCParticle * getMCParticle ( const CDCHit ptrHit) const

Getter for the MCParticle which is related to the CDCHit contained in the given wire hit.

Definition at line 48 of file CDCMCHitLookUp.cc.

49{
51}
static const CDCMCMap & getMCMap()
Getter for the singletone instance of the CDCMCMap.
Definition: CDCMCManager.cc:80
MayBePtr< const MCParticle > getMCParticle(const CDCHit *hit) const
Seeks the MCParticle related to the CDCHit.
Definition: CDCMCMap.cc:269

◆ getMCTrackId()

ITrackType getMCTrackId ( const CDCHit ptrHit) const

Returns the track id for the hit.

Definition at line 120 of file CDCMCHitLookUp.cc.

121{
122 const MCParticle* ptrMCParticle = getMCParticle(ptrHit);
123 return ptrMCParticle ? ptrMCParticle->getArrayIndex() : INVALID_ITRACK;
124}
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
int getArrayIndex() const
Get 0-based index of the particle in the corresponding MCParticle list.
Definition: MCParticle.h:244
const Belle2::MCParticle * getMCParticle(const CDCHit *ptrHit) const
Getter for the MCParticle which is related to the CDCHit contained in the given wire hit.

◆ getNLoops()

Index getNLoops ( const CDCHit ptrHit) const

Returns the number of loops the track traversed until this hit.

Definition at line 145 of file CDCMCHitLookUp.cc.

146{
148}
Index getNLoops(const CDCHit *ptrHit) const
Getter for the number of traversed loops until this hit.

◆ getNPassedSuperLayers()

Index getNPassedSuperLayers ( const CDCHit ptrHit) const

Returns the number of superlayers the track traversed until this hit.

Definition at line 139 of file CDCMCHitLookUp.cc.

140{
142}
Index getNPassedSuperLayers(const CDCHit *ptrHit) const
Getter for the number of super layers traversed until this hit.

◆ getRecoPos3D()

const Vector3D getRecoPos3D ( const CDCHit ptrHit) const

Getter for the three dimensional position of the primary ionisation for the hit.

Definition at line 82 of file CDCMCHitLookUp.cc.

83{
85}
Vector3D getRecoPos3D(const CDCHit *ptrHit) const
Look up the position of the primary ionisation from related simulated hit.

◆ getRefDriftLength()

float getRefDriftLength ( const CDCHit ptrHit) const

Getter for the reference drift length in the two dimensional projection.

Definition at line 72 of file CDCMCHitLookUp.cc.

73{
74
75 if (not ptrHit) return NAN;
76 CDCWireHit wireHit(ptrHit);
77 return wireHit.getRefDriftLength();
78
79}
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55

◆ getRefPos2D()

const Vector2D getRefPos2D ( const CDCHit ptrHit) const

Getter for the two dimensional reference position of the wire the given hit is located on - mainly for the python event display.

Definition at line 54 of file CDCMCHitLookUp.cc.

55{
56 if (not ptrHit) return Vector2D();
57 const CDCHit& hit = *ptrHit;
58
59 const CDCWire* ptrWire = CDCWire::getInstance(hit);
60
61 if (not ptrWire) {
62 B2WARNING("Encountered CDCHit with wire ids that do not correspond to a valid wire in the CDC)");
63 return Vector2D();
64 }
65
66 const CDCWire& wire = *ptrWire;
67 Vector2D refPos2D = wire.getRefPos2D();
68 return refPos2D;
69}
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:40
Class representing a sense wire in the central drift chamber.
Definition: CDCWire.h:58
static const CDCWire * getInstance(const WireID &wireID)
Getter from the wireID convinience object. Does not construct a new object.
Definition: CDCWire.cc:24
const Vector2D & getRefPos2D() const
Getter for the wire reference position for 2D tracking Gives the wire's reference position projected ...
Definition: CDCWire.h:229
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:32

◆ getRLInfo()

ERightLeft getRLInfo ( const CDCHit ptrHit) const

Returns the true right left passage information.

Definition at line 107 of file CDCMCHitLookUp.cc.

108{
110}
ERightLeft getRLInfo(const CDCHit *ptrHit) const
Look up the Monte Carlo right left passage information for the given hit.

◆ getSimHit()

const Belle2::CDCSimHit * getSimHit ( const CDCHit ptrHit) const

Getter for the CDCSimHit which is related to the CDCHit contained in the given wire hit.

Definition at line 42 of file CDCMCHitLookUp.cc.

43{
44 return CDCMCManager::getMCMap().getSimHit(ptrHit);
45}
MayBePtr< const CDCSimHit > getSimHit(const CDCHit *hit) const
Seeks the CDCSimHit related to the CDCHit.
Definition: CDCMCMap.cc:249

◆ isBackground()

bool isBackground ( const CDCHit ptrHit) const

Returns if this hit is considered background.

Definition at line 113 of file CDCMCHitLookUp.cc.

114{
115 const CDCSimHit* ptrSimHit = getSimHit(ptrHit);
116 return ptrSimHit ? ptrSimHit->getBackgroundTag() != BackgroundMetaData::bg_none : false;
117}
Example Detector.
Definition: CDCSimHit.h:21
virtual unsigned short getBackgroundTag() const
Get background tag.
Definition: SimHitBase.h:46
const Belle2::CDCSimHit * getSimHit(const CDCHit *ptrHit) const
Getter for the CDCSimHit which is related to the CDCHit contained in the given wire hit.

◆ isReassignedSecondary()

bool isReassignedSecondary ( const CDCHit ptrHit) const

Indicates if the hit was reassigned to a different mc particle because it was caused by a secondary.

Definition at line 94 of file CDCMCHitLookUp.cc.

95{
97}
bool isReassignedSecondary(const CDCSimHit *ptrSimHit) const
Indicates if the CDCSimHit has been reassigned to a primary MCParticle.
Definition: CDCMCMap.h:110

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