4 #include <fwk/RandomEngineRegistry.h>
5 #include <fwk/RunController.h>
7 #include <sdet/Station.h>
10 #include <sevt/SEvent.h>
11 #include <sevt/Station.h>
13 #include <utl/TabulatedFunction.h>
16 #include <G4TrackingManager.hh>
17 #include <G4TrackStatus.hh>
18 #include <G4OpticalPhoton.hh>
24 namespace G4StationSimulatorOG {
26 G4ClassificationOfNewTrack
27 G4StationStackingAction::ClassifyNewTrack(
const G4Track*
const track)
32 if (track->GetDefinition() != G4OpticalPhoton::OpticalPhoton())
37 const sevt::Station& station = G4StationSimulator::fgCurrent.GetEventStation();
45 if (signature ==
"G4StationSimulatorFullTrackOG")
56 const auto& dStation = G4StationSimulator::fgCurrent.GetDetectorStation();
57 const auto& pmt = dStation.GetPMT(1);
59 pmt.GetCollectionEfficiency() * pmt.GetQuantumEfficiency().InterpolateY(energy, 1);
61 const auto rand = &RandomEngineRegistry::GetInstance().Get(RandomEngineRegistry::eDetector).GetEngine();
62 const double keep = CLHEP::RandFlat::shoot(rand, 0, 1);
64 if (!dStation.HasSmallPMT())
65 return (keep > eff) ? fKill : fWaiting;
68 const auto& pmtSmall = dStation.GetPMT(4);
69 const double effSmall =
70 pmtSmall.GetCollectionEfficiency() * pmtSmall.GetQuantumEfficiency().InterpolateY(energy, 1);
72 return (keep >
std::max(eff, effSmall)) ? fKill : fWaiting;
class to hold data at Station level
sevt::StationSimData & GetSimData()
Get simulated data at station level.
const std::string & GetSimulatorSignature() const
Get name of the tank simulator module used to simulate this station.