G4TankSimulatorOG/G4TankStackingAction.cc
Go to the documentation of this file.
1 #include "G4TankStackingAction.h"
2 #include "G4TankSimulator.h"
3 
4 #include <fwk/RandomEngineRegistry.h>
5 
6 #include <sdet/Station.h>
7 #include <sdet/PMT.h>
8 
9 #include <utl/TabulatedFunction.h>
10 
11 #include <CLHEP/Random/RandFlat.h>
12 
13 #include <G4Track.hh>
14 #include <G4TrackingManager.hh>
15 #include <G4TrackStatus.hh>
16 #include <G4OpticalPhoton.hh>
17 
18 using namespace sdet;
19 using namespace fwk;
20 using namespace G4TankSimulatorOG;
21 using CLHEP::RandFlat;
22 
23 
24 G4TankStackingAction::G4TankStackingAction() :
25  fCurrentDetectorStation(0)
26 {
28  &RandomEngineRegistry::GetInstance().Get(RandomEngineRegistry::eDetector);
29 }
30 
31 
32 G4ClassificationOfNewTrack
34 {
35  // NOTE: for now, we assume that each pmt has the same collection
36  // and quantum efficiencies
37 
38  if (aTrack->GetDefinition() != G4OpticalPhoton::OpticalPhoton())
39  return fWaiting;
40 
41  // optical photon
42 
43  const double energy = aTrack->GetKineticEnergy() *
44  (utl::MeV / CLHEP::MeV);
45 
46  // Randomly kill photons according to quantum and collection
47  // efficiency to speed up simulation
48 
49  if (RandFlat::shoot(&fRandomEngine->GetEngine(), 0, 1) >
51  return fKill;
52 
53  return fWaiting;
54 }
55 
56 
57 void
59 {
60  fCurrentDetectorStation = station;
61 
63 
65 }
Detector description interface for Station-related data.
RandomEngineType & GetEngine()
Definition: RandomEngine.h:32
const PMT & GetPMT(const int id) const
Get specified PMT by id.
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack)
constexpr double MeV
Definition: AugerUnits.h:184
double GetCollectionEfficiency() const
Collection efficiency.
double InterpolateY(const double x, const unsigned int polyDegree) const
Interpolate the Y value with a polyDegree polynomial.
const utl::TabulatedFunction & GetQuantumEfficiency() const
Quantum efficiency.

, generated on Tue Sep 26 2023.