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();
78 G4StepPoint
const* preStepPoint = aStep->GetPreStepPoint();
81 G4ThreeVector worldPosition = preStepPoint->GetPosition();
82 G4ThreeVector localPosition =
83 preStepPoint->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(
86 localPosition.x() / CLHEP::cm, localPosition.y() / CLHEP::cm, localPosition.z() / CLHEP::cm};
108 aStep->GetTrack()->SetTrackStatus(fStopAndKill);
125 Wavelength(
double energy)
129 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.
process_name use argoneut_mc_hitfinder track
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)
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 *)