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>

Inheritance diagram for SensorTraversal:

Public Types

typedef std::pair< iterator, iterator > range
 Iterator pair for a set of points.
 

Public Member Functions

 SensorTraversal ()=default
 Use default constructor.
 
void add (const G4ThreeVector &position, const G4ThreeVector &momentum, double electrons, double time, double length)
 add a new step
 
int getTrackID () const
 get Geant4 trackID
 
int getPDGCode () const
 get PDG code of the particle
 
double getElectrons () const
 get total number of deposited electrons so far
 
double getLength () const
 get flight length so far
 
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 pdgCode, bool primary)
 set initial values for a new track
 
void reset ()
 reset to be used again
 

Public Attributes

elements
 STL member.
 

Private Attributes

int m_trackID {0}
 Geant4 Track ID.
 
int m_pdgCode {0}
 PDG code for the particle.
 
double m_electrons {0}
 Total number of electrons deposited by this track.
 
double m_length {0}
 length of the sensor traversal
 
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 and TrueHit objects after a particle finishes its traversal of the sensitive detector

Definition at line 53 of file SensorTraversal.h.

Member Typedef Documentation

◆ range

typedef std::pair<iterator, iterator> range

Iterator pair for a set of points.

Definition at line 56 of file SensorTraversal.h.

Member Function Documentation

◆ add()

void add ( const G4ThreeVector &  position,
const G4ThreeVector &  momentum,
double  electrons,
double  time,
double  length 
)
inline

add a new step

Parameters
positionposition of the step
momentummomentum of the step
electronsnumber of deposited electrons during step
timeof the step
lengthof the step

Definition at line 68 of file SensorTraversal.h.

69 {
70 m_electrons += electrons;
71 m_length += length;
72 emplace_back(position, momentum, m_electrons, time, m_length);
73 }
double m_electrons
Total number of electrons deposited by this track.
double m_length
length of the sensor traversal

◆ getElectrons()

double getElectrons ( ) const
inline

get total number of deposited electrons so far

Definition at line 80 of file SensorTraversal.h.

80{ return m_electrons; }

◆ getLength()

double getLength ( ) const
inline

get flight length so far

Definition at line 82 of file SensorTraversal.h.

82{ return m_length; }

◆ getPDGCode()

int getPDGCode ( ) const
inline

get PDG code of the particle

Definition at line 78 of file SensorTraversal.h.

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

◆ getTrackID()

int getTrackID ( ) const
inline

get Geant4 trackID

Definition at line 76 of file SensorTraversal.h.

76{ return m_trackID; }
int m_trackID
Geant4 Track ID.

◆ hasEntered()

void hasEntered ( )
inline

indicate that the track originated outisde the current volume

Definition at line 89 of file SensorTraversal.h.

89{ 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 91 of file SensorTraversal.h.

91{ m_contained = false; }

◆ isContained()

bool isContained ( ) const
inline

return whether the track was contained in the volume so far

Definition at line 84 of file SensorTraversal.h.

84{ return m_contained; }

◆ isPrimary()

bool isPrimary ( ) const
inline

return whether the track belongs to a primary particle

Definition at line 86 of file SensorTraversal.h.

86{ 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 102 of file SensorTraversal.h.

103 {
104 m_trackID = 0;
105 m_pdgCode = 0;
106 m_electrons = 0;
107 m_length = 0;
108 m_contained = true;
109 m_primary = false;
110 clear();
111 }

◆ setInitial()

void setInitial ( int  trackID,
int  pdgCode,
bool  primary 
)
inline

set initial values for a new track

Definition at line 94 of file SensorTraversal.h.

95 {
96 m_trackID = trackID;
97 m_pdgCode = pdgCode;
98 m_primary = primary;
99 }

Member Data Documentation

◆ m_contained

bool m_contained {true}
private

Indication wether the track is completely contained inside the volume.

Definition at line 123 of file SensorTraversal.h.

◆ m_electrons

double m_electrons {0}
private

Total number of electrons deposited by this track.

Definition at line 119 of file SensorTraversal.h.

◆ m_length

double m_length {0}
private

length of the sensor traversal

Definition at line 121 of file SensorTraversal.h.

◆ m_pdgCode

int m_pdgCode {0}
private

PDG code for the particle.

Definition at line 117 of file SensorTraversal.h.

◆ m_primary

bool m_primary {false}
private

Indication whether track is from a primary particle.

Definition at line 125 of file SensorTraversal.h.

◆ m_trackID

int m_trackID {0}
private

Geant4 Track ID.

Definition at line 115 of file SensorTraversal.h.


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