16#ifndef _MUG_OPTICAL_DETECTOR_HH_
17#define _MUG_OPTICAL_DETECTOR_HH_
22#include "G4Allocator.hh"
23#include "G4THitsCollection.hh"
24#include "G4TouchableHandle.hh"
26#include "G4VSensitiveDetector.hh"
33class RMGOpticalDetectorHit :
public G4VHit {
37 RMGOpticalDetectorHit() =
default;
38 ~RMGOpticalDetectorHit() =
default;
40 RMGOpticalDetectorHit(RMGOpticalDetectorHit
const&) =
delete;
41 RMGOpticalDetectorHit& operator=(RMGOpticalDetectorHit
const&) =
delete;
42 RMGOpticalDetectorHit(RMGOpticalDetectorHit&&) =
delete;
43 RMGOpticalDetectorHit& operator=(RMGOpticalDetectorHit&&) =
delete;
45 bool operator==(
const RMGOpticalDetectorHit&)
const;
47 inline void*
operator new(size_t);
48 inline void operator delete(
void*);
50 void Print()
override;
76 ~RMGOpticalDetector() =
default;
78 RMGOpticalDetector(RMGOpticalDetector
const&) =
delete;
79 RMGOpticalDetector& operator=(RMGOpticalDetector
const&) =
delete;
80 RMGOpticalDetector(RMGOpticalDetector&&) =
delete;
81 RMGOpticalDetector& operator=(RMGOpticalDetector&&) =
delete;
91 RMGOpticalDetectorHitsCollection* fHitsCollection =
nullptr;
98inline void* RMGOpticalDetectorHit::operator
new(size_t) {
99 if (!RMGOpticalDetectorHitAllocator)
101 return (
void*)RMGOpticalDetectorHitAllocator->MallocSingle();
104inline void RMGOpticalDetectorHit::operator
delete(
void* hit) {
Hit produced by RMGOpticalDetector when an optical photon is absorbed.
Definition RMGOpticalDetector.hh:33
int detector_uid
Remage unique identifier of the absorbing detector.
Definition RMGOpticalDetector.hh:55
void Draw() override
Color the detector volume if hit.
Definition RMGOpticalDetector.cc:49
double photon_wavelength
Absorbed-photon wavelength (Geant4 length units).
Definition RMGOpticalDetector.hh:56
double global_time
Global time at absorption (Geant4 time units).
Definition RMGOpticalDetector.hh:57
G4TouchableHandle detector_touchable
Touchable of the absorbing volume, used by Draw.
Definition RMGOpticalDetector.hh:54
void Initialize(G4HCofThisEvent *hit_coll) override
Allocate and register the hit collection for the current event.
Definition RMGOpticalDetector.cc:73
bool ProcessHits(G4Step *step, G4TouchableHistory *history) override
Record an absorbed optical photon as a hit.
Definition RMGOpticalDetector.cc:89