ghit
|
Represents a hit in the detector. More...
#include <ghit.h>
Public Member Functions | |
GHit (GTouchable *gt, HitBitSet hbs, const G4Step *thisStep=nullptr, string cScheme="default") | |
Constructor for GHit. More... | |
~GHit ()=default | |
Destructor for GHit. More... | |
void * | operator new (size_t) |
Overloaded new operator using G4Allocator. More... | |
void | operator delete (void *) |
Overloaded delete operator using G4Allocator. More... | |
void | Draw () override |
Draws the hit using Geant4 visualization. More... | |
bool | is_same_hit (GHit *hit) |
Compare two ghits. More... | |
vector< double > | getEdeps () const |
Gets the energy depositions from each step. More... | |
vector< double > | getTimes () const |
Gets the time stamps for each step. More... | |
vector< G4ThreeVector > | getGlobalPositions () const |
Gets the global positions recorded for the hit. More... | |
vector< G4ThreeVector > | getLocalPositions () const |
Gets the local positions recorded for the hit. More... | |
vector< int > | getPids () const |
Gets the particle IDs recorded for the hit. More... | |
int | getPid () const |
Returns the first particle ID. More... | |
vector< double > | getEs () const |
Gets the energy values recorded in bit 1. More... | |
double | getE () const |
Returns the first energy value. More... | |
string | getProcessName () const |
Gets the process name associated with the hit. More... | |
GTouchable * | getGTouchable () const |
Returns the GTouchable associated with the hit. More... | |
vector< GIdentifier > | getGID () const |
Returns the detector element identity. More... | |
vector< double > | getDetectorDimensions () const |
Returns the dimensions of the detector element. More... | |
void | calculateInfosForBit (int bit) |
Calculates averaged hit information for the specified bit. More... | |
double | getTotalEnergyDeposited () |
Computes the total energy deposited. More... | |
double | getAverageTime () |
G4ThreeVector | getAvgLocalPosition () |
Computes the average local position of the hit. More... | |
G4ThreeVector | getAvgGlobaPosition () |
Computes the average global position of the hit. More... | |
void | addHitInfosForBitset (HitBitSet hbs, const G4Step *thisStep) |
Adds hit information based on a HitBitSet. More... | |
vector< int > | getTTID () |
Returns the touchable identity values as integers. More... | |
This class is derived from G4VHit and is used to store information about a detector hit. It collects standard hit data (energy, time, positions) as well as additional information based on a configurable HitBitSet.
GHit::GHit | ( | GTouchable * | gt, |
HitBitSet | hbs, | ||
const G4Step * | thisStep = nullptr , |
||
string | cScheme = "default" |
||
) |
|
default |
void GHit::addHitInfosForBitset | ( | HitBitSet | hbs, |
const G4Step * | thisStep | ||
) |
This method extracts common hit data (positions, energy deposit, time) and then iterates over the bits in the HitBitSet to add additional information.
hbs | The HitBitSet that selects which additional information to record. |
thisStep | The current G4Step from which hit data is extracted. |
Definition at line 17 of file addHitInfos.cc.
void GHit::calculateInfosForBit | ( | int | bit | ) |
For bit 0, it calculates the total energy deposited, average time, and weighted average positions. The computation uses energy deposition as weights. For other bits, placeholders exist for future extensions. Notice: if the energy deposited is very low (~50eV), the rounding error on the average calculations could be up to 10^-3.
bit | The bit index for which to calculate the information. |
Definition at line 17 of file calculations.cc.
|
override |
double GHit::getAverageTime | ( | ) |
Definition at line 87 of file calculations.cc.
G4ThreeVector GHit::getAvgGlobaPosition | ( | ) |
Uses energy-weighted averaging if energy deposition is nonzero.
Definition at line 115 of file calculations.cc.
G4ThreeVector GHit::getAvgLocalPosition | ( | ) |
Uses energy-weighted averaging if available.
Definition at line 148 of file calculations.cc.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
double GHit::getTotalEnergyDeposited | ( | ) |
Sums the energy depositions over all steps.
Definition at line 76 of file calculations.cc.
vector< int > GHit::getTTID | ( | ) |
bool GHit::is_same_hit | ( | GHit * | hit | ) |
|
inline |