|
| | GHit (std::shared_ptr< GTouchable > gt, HitBitSet hbs, const G4Step *thisStep=nullptr, const std::string &cScheme="default") |
| | Construct a hit container and optionally seed it from a step.
|
| |
| | ~GHit () override=default |
| | Destructor.
|
| |
| void * | operator new (size_t) |
| | Allocate a GHit via the G4Allocator associated with this type.
|
| |
| void | operator delete (void *) |
| | Deallocate a GHit via the G4Allocator associated with this type.
|
| |
| void | Draw () override |
| | Visualize the hit using Geant4 visualization primitives.
|
| |
| bool | is_same_hit (const GHit *hit) const |
| | Compare this hit against another hit by sensitive-element identity.
|
| |
| std::vector< double > | getEdeps () const |
| | Get per-step energy depositions.
|
| |
| std::vector< double > | getTimes () const |
| | Get per-step global times.
|
| |
| std::vector< G4ThreeVector > | getGlobalPositions () const |
| | Get per-step global positions.
|
| |
| std::vector< G4ThreeVector > | getLocalPositions () const |
| | Get per-step local positions.
|
| |
| std::vector< int > | getPids () const |
| | Get per-step particle PDG encodings (when enabled).
|
| |
| int | getPid () const |
| | Convenience accessor for the first particle ID.
|
| |
| std::vector< double > | getEs () const |
| | Get per-step total energies (when enabled).
|
| |
| double | getE () const |
| | Convenience accessor for the first energy value.
|
| |
| size_t | nsteps () const |
| | Number of recorded steps for the optional-energy vector.
|
| |
| std::string | getProcessName () const |
| | Get the representative process name for the hit.
|
| |
| std::shared_ptr< GTouchable > | getGTouchable () const |
| | Get the associated sensitive-element descriptor.
|
| |
| std::vector< GIdentifier > | getGID () const |
| | Get the detector element identity.
|
| |
| std::vector< double > | getDetectorDimensions () const |
| | Get the sensitive-element dimensions.
|
| |
| void | calculateInfosForBit (int bit) |
| | Compute and cache derived information for the requested bit.
|
| |
| double | getTotalEnergyDeposited () |
| | Get the total deposited energy across all recorded steps.
|
| |
| double | getAverageTime () |
| | Get the average time associated with the hit.
|
| |
| G4ThreeVector | getAvgLocalPosition () |
| | Get the average local position of the hit.
|
| |
| G4ThreeVector | getAvgGlobaPosition () |
| | Get the average global position of the hit.
|
| |
| void | addHitInfosForBitset (HitBitSet hbs, const G4Step *thisStep) |
| | Append per-step information from a G4Step according to a bitset.
|
| |
| void | randomizeHitForTesting (int nsteps) |
| | Randomize internal vectors for test-only usage.
|
| |
| std::vector< int > | getTTID () const |
| | Get the touchable identity values as integers.
|
| |
A GHit is a G4VHit that accumulates per-step quantities while a track traverses a sensitive detector element and deposits energy.
Conceptually, this class has two layers of information:
- Per-step vectors: always-collected quantities (energy deposition, time, local/global positions) plus optional quantities controlled by
HitBitSet.
- Aggregated quantities: totals/averages (e.g., total energy deposited, average time, average positions, representative process name) computed lazily from the per-step vectors.
The optional information is controlled by HitBitSet (see ghitConventions.h : bit meanings and expected future extensions).
- Note
- This class does not own the sensitive-element description. The associated
GTouchable is stored as a std::shared_ptr so that the hit can be compared against other hits and can query identity/dimensions.
Definition at line 42 of file ghit.h.
| void GHit::calculateInfosForBit |
( |
int | bit | ) |
|
This is primarily used to compute bit-0 derived quantities (total energy, average time, average local/global positions, representative process name).
- Parameters
-
| bit | Bit index for which derived information should be computed. |
- Note
- Bits beyond 0 are currently placeholders for future extensions (see ghitConventions.h : planned bits).
Implementation notes (non-Doxygen):
- Derived quantities use a lazy-cache model (computed on first access).
- Energy-weighted averages are used when total deposited energy is non-zero.
- When total energy is zero, fall back to simple arithmetic averaging.
Definition at line 16 of file calculations.cc.