14 #include "Geant4/G4SDManager.hh" 22 constexpr
double Wavelength(
double energy);
30 : G4VSensitiveDetector(DetectorUniqueName), fUseLitePhotons(useLitePhotons)
33 G4SDManager::GetSDMpointer()->AddNewDetector(
this);
45 double const time = aStep->GetTrack()->GetGlobalTime();
48 double const energy = aStep->GetTrack()->GetVertexKineticEnergy() / CLHEP::eV;
49 bool const reflected = Wavelength(energy) > 200.0;
66 auto const&
track = *(aStep->GetTrack());
67 auto const& startPos =
track.GetVertexPosition();
76 G4StepPoint
const* preStepPoint = aStep->GetPreStepPoint();
79 G4ThreeVector worldPosition = preStepPoint->GetPosition();
80 G4ThreeVector localPosition =
81 preStepPoint->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(
84 localPosition.x() / CLHEP::cm, localPosition.y() / CLHEP::cm, localPosition.z() / CLHEP::cm};
105 aStep->GetTrack()->SetTrackStatus(fStopAndKill);
119 constexpr
double Wavelength(
double energy)
123 constexpr
double hc = 6.62607015e-34 * 299792458.0 / 1.602176634e-19 * 1e9;
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)
int GetOpDet(G4VPhysicalVolume const *)
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.
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 *)