Belle II Software development
SensorTraversal Class Reference

Class to keep track of the traversal of the sensitive volume for one track. More...

#include <SensorTraversal.h>

Public Member Functions

void add (const G4ThreeVector &position, double depEnergy, double visibleEnergy, double length)
 add a new step
 
int getTrackID () const
 get Geant4 trackID
 
int getLadderID () const
 get the ladder ID
 
int getSensorID () const
 get the sensor ID
 
int getPDGCode () const
 get PDG code of the particle
 
double getDepEnergy () const
 get total energy deposition
 
double getVisibleEnergy () const
 get visible energy deposition
 
double getLength () const
 get flight length so far
 
double getEntryTime () const
 get entry time
 
const G4ThreeVector & getEntryMomentum () const
 get entry momentum
 
const G4ThreeVector & getEntryPosition () const
 get entry position
 
const G4ThreeVector & getExitPosition () const
 get exit position
 
bool isContained () const
 return whether the track was contained in the volume so far
 
bool isPrimary () const
 return whether the track belongs to a primary particle
 
void hasEntered ()
 indicate that the track originated outisde the current volume
 
void hasLeft ()
 indicate that the track left the current volume
 
void setInitial (int trackID, int ladderID, int sensorID, int pdgCode, bool primary, const G4ThreeVector &position, const G4ThreeVector &momentum, double time)
 set initial values for a new track
 
void reset ()
 reset to be used again
 
bool check (int trackID, int ladderID, int sensorID)
 check if a track belongs to this object
 

Private Attributes

G4ThreeVector m_entryMomentum
 Entry Position.
 
G4ThreeVector m_entryPosition
 Entry Position.
 
G4ThreeVector m_exitPosition
 Exit Position.
 
int m_trackID {0}
 Geant4 Track ID.
 
int m_ladderID {0}
 Ladder ID.
 
int m_sensorID {0}
 Sensor ID.
 
int m_pdgCode {0}
 PDG code for the particle.
 
double m_depEnergy {0}
 Total deposited energy by this track.
 
double m_visibleEnergy {0}
 Total visible energy by this track.
 
double m_length {0}
 length of the sensor traversal
 
double m_entryTime {0}
 time the track entered the volume
 
bool m_contained {true}
 Indication wether the track is completely contained inside the volume.
 
bool m_primary {false}
 Indication whether track is from a primary particle.
 

Detailed Description

Class to keep track of the traversal of the sensitive volume for one track.

This class keeps the necessary information to create consolidated SimHit objects after a particle finishes its traversal of the sensitive detector

Definition at line 25 of file SensorTraversal.h.

Member Function Documentation

◆ add()

void add ( const G4ThreeVector &  position,
double  depEnergy,
double  visibleEnergy,
double  length 
)
inline

add a new step

Parameters
positionposition of the step
depEnergyenergy deposition
visibleEnergyvisible energy deposition
lengthflight length so far

Definition at line 33 of file SensorTraversal.h.

34 {
35 m_depEnergy += depEnergy;
36 m_visibleEnergy += visibleEnergy;
37 m_length += length;
38 m_exitPosition = position;
39 }
double m_visibleEnergy
Total visible energy by this track.
double m_depEnergy
Total deposited energy by this track.
double m_length
length of the sensor traversal
G4ThreeVector m_exitPosition
Exit Position.

◆ check()

bool check ( int  trackID,
int  ladderID,
int  sensorID 
)
inline

check if a track belongs to this object

Definition at line 104 of file SensorTraversal.h.

105 {
106 // object not set yet so we can use it
107 if (m_trackID == 0) return true;
108 return (trackID == m_trackID && ladderID == m_ladderID && sensorID == m_sensorID);
109 }

◆ getDepEnergy()

double getDepEnergy ( ) const
inline

get total energy deposition

Definition at line 50 of file SensorTraversal.h.

50{ return m_depEnergy; }

◆ getEntryMomentum()

const G4ThreeVector & getEntryMomentum ( ) const
inline

get entry momentum

Definition at line 58 of file SensorTraversal.h.

58{ return m_entryMomentum; }
G4ThreeVector m_entryMomentum
Entry Position.

◆ getEntryPosition()

const G4ThreeVector & getEntryPosition ( ) const
inline

get entry position

Definition at line 60 of file SensorTraversal.h.

60{ return m_entryPosition; }
G4ThreeVector m_entryPosition
Entry Position.

◆ getEntryTime()

double getEntryTime ( ) const
inline

get entry time

Definition at line 56 of file SensorTraversal.h.

56{ return m_entryTime; }
double m_entryTime
time the track entered the volume

◆ getExitPosition()

const G4ThreeVector & getExitPosition ( ) const
inline

get exit position

Definition at line 62 of file SensorTraversal.h.

62{ return m_exitPosition; }

◆ getLadderID()

int getLadderID ( ) const
inline

get the ladder ID

Definition at line 44 of file SensorTraversal.h.

44{ return m_ladderID; }

◆ getLength()

double getLength ( ) const
inline

get flight length so far

Definition at line 54 of file SensorTraversal.h.

54{ return m_length; }

◆ getPDGCode()

int getPDGCode ( ) const
inline

get PDG code of the particle

Definition at line 48 of file SensorTraversal.h.

48{ return m_pdgCode; }
int m_pdgCode
PDG code for the particle.

◆ getSensorID()

int getSensorID ( ) const
inline

get the sensor ID

Definition at line 46 of file SensorTraversal.h.

46{ return m_sensorID; }

◆ getTrackID()

int getTrackID ( ) const
inline

get Geant4 trackID

Definition at line 42 of file SensorTraversal.h.

42{ return m_trackID; }

◆ getVisibleEnergy()

double getVisibleEnergy ( ) const
inline

get visible energy deposition

Definition at line 52 of file SensorTraversal.h.

52{ return m_visibleEnergy; }

◆ hasEntered()

void hasEntered ( )
inline

indicate that the track originated outisde the current volume

Definition at line 70 of file SensorTraversal.h.

70{ m_contained = false; }
bool m_contained
Indication wether the track is completely contained inside the volume.

◆ hasLeft()

void hasLeft ( )
inline

indicate that the track left the current volume

Definition at line 72 of file SensorTraversal.h.

72{ m_contained = false; }

◆ isContained()

bool isContained ( ) const
inline

return whether the track was contained in the volume so far

Definition at line 65 of file SensorTraversal.h.

65{ return m_contained; }

◆ isPrimary()

bool isPrimary ( ) const
inline

return whether the track belongs to a primary particle

Definition at line 67 of file SensorTraversal.h.

67{ return m_primary; }
bool m_primary
Indication whether track is from a primary particle.

◆ reset()

void reset ( )
inline

reset to be used again

Definition at line 89 of file SensorTraversal.h.

90 {
91 m_trackID = 0;
92 m_ladderID = 0;
93 m_sensorID = 0;
94 m_pdgCode = 0;
95 m_depEnergy = 0;
97 m_length = 0;
98 m_contained = true;
99 m_primary = false;
100 m_entryTime = 0;
101 }

◆ setInitial()

void setInitial ( int  trackID,
int  ladderID,
int  sensorID,
int  pdgCode,
bool  primary,
const G4ThreeVector &  position,
const G4ThreeVector &  momentum,
double  time 
)
inline

set initial values for a new track

Definition at line 75 of file SensorTraversal.h.

77 {
78 m_trackID = trackID;
79 m_ladderID = ladderID;
80 m_sensorID = sensorID;
81 m_pdgCode = pdgCode;
82 m_primary = primary;
83 m_entryPosition = position;
84 m_entryMomentum = momentum;
85 m_entryTime = time;
86 }

Member Data Documentation

◆ m_contained

bool m_contained {true}
private

Indication wether the track is completely contained inside the volume.

Definition at line 135 of file SensorTraversal.h.

◆ m_depEnergy

double m_depEnergy {0}
private

Total deposited energy by this track.

Definition at line 127 of file SensorTraversal.h.

◆ m_entryMomentum

G4ThreeVector m_entryMomentum
private

Entry Position.

Definition at line 113 of file SensorTraversal.h.

◆ m_entryPosition

G4ThreeVector m_entryPosition
private

Entry Position.

Definition at line 115 of file SensorTraversal.h.

◆ m_entryTime

double m_entryTime {0}
private

time the track entered the volume

Definition at line 133 of file SensorTraversal.h.

◆ m_exitPosition

G4ThreeVector m_exitPosition
private

Exit Position.

Definition at line 117 of file SensorTraversal.h.

◆ m_ladderID

int m_ladderID {0}
private

Ladder ID.

Definition at line 121 of file SensorTraversal.h.

◆ m_length

double m_length {0}
private

length of the sensor traversal

Definition at line 131 of file SensorTraversal.h.

◆ m_pdgCode

int m_pdgCode {0}
private

PDG code for the particle.

Definition at line 125 of file SensorTraversal.h.

◆ m_primary

bool m_primary {false}
private

Indication whether track is from a primary particle.

Definition at line 137 of file SensorTraversal.h.

◆ m_sensorID

int m_sensorID {0}
private

Sensor ID.

Definition at line 123 of file SensorTraversal.h.

◆ m_trackID

int m_trackID {0}
private

Geant4 Track ID.

Definition at line 119 of file SensorTraversal.h.

◆ m_visibleEnergy

double m_visibleEnergy {0}
private

Total visible energy by this track.

Definition at line 129 of file SensorTraversal.h.


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