14 #include "Geant4/G4SDManager.hh" 22 constexpr
double Wavelength(
double energy);
30 : G4VSensitiveDetector(DetectorUniqueName), fUseLitePhotons(useLitePhotons)
33 G4SDManager::GetSDMpointer()->AddNewDetector(
this);
46 double const time = aStep->GetTrack()->GetGlobalTime();
49 double const energy = aStep->GetTrack()->GetVertexKineticEnergy() /
CLHEP::eV;
50 bool const reflected = Wavelength(energy) > 200.0;
68 auto const& track = *(aStep->GetTrack());
69 auto const& startPos = track.GetVertexPosition();
73 ThePhoton.
Time = track.GetGlobalTime();
75 ThePhoton.
Energy = track.GetVertexKineticEnergy();
78 G4StepPoint
const* preStepPoint = aStep->GetPreStepPoint();
81 G4ThreeVector worldPosition = preStepPoint->GetPosition();
82 G4ThreeVector localPosition =
83 preStepPoint->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(
108 aStep->GetTrack()->SetTrackStatus(fStopAndKill);
129 constexpr
double hc = 6.62607015e-34 * 299792458.0 / 1.602176634e-19 * 1e9;
static constexpr double cm
bool const fUseLitePhotons
Fill simplified lite photons instead of full information photons.
All information of a photon entering the sensitive optical detector volume.
void AddLitePhoton(G4Step const *aStep, int OpDet)
Adds the photon at the specified step with reduced information.
geo::Point_t InitialPosition
Scintillation position in world coordinates [cm].
Simulation objects for optical detectors.
void AddPhoton(size_t opchannel, sim::OnePhoton &&photon, bool Reflected=false)
static constexpr double eV
void AddLitePhoton(int opchannel, int time, int nphotons, bool Reflected=false)
static OpDetLookup * Instance()
void AddPhoton(G4Step const *aStep, int OpDet)
Adds the photon at the specified step with full information.
int GetOpDet(G4VPhysicalVolume *)
static OpDetPhotonTable * Instance(bool LitePhotons=false)
OpDetLookup * fTheOpDetLookup
OpDetPhotonTable * fThePhotonTable
bool SetInSD
Whether the photon reaches the sensitive detector.
geo::OpticalPoint_t FinalLocalPosition
Where photon enters the optical detector in local coordinates [cm].
virtual void Initialize(G4HCofThisEvent *)
OpDetSensitiveDetector(G4String name, bool useLitePhotons=false)
float Energy
Scintillation photon energy [GeV].
virtual G4bool ProcessHits(G4Step *, G4TouchableHistory *)