G4StationTrackingAction.cc
Go to the documentation of this file.
2 
3 #include <G4Track.hh>
4 #include <G4TrackingManager.hh>
5 #include <G4TrackStatus.hh>
6 
7 
8 namespace G4StationSimulatorOG {
9 
10  // Number of Cherenkov photons from injected particle
12  // Number of Cherenkov photons NOT coming directly from the injected particle. (eg. delta rays)
15 
16 
18  fIsUMDEnabled(umdEnable)
19  { }
20 
21 
22  void
24  {
25  firstStepInVolume = true;
26  fNumBounces = 0;
27 
28  const int code = track->GetDefinition()->GetPDGEncoding();
29 
30  if (code == 0) { // Optical photon
31 
32  const int parent = track->GetParentID();
33 
34  // Count number of Cerenkov photons
35  if (parent != 1) // not directly produced by the injected particle (eg delta ray)
36  ++fNumCDelta;
37  else // Produced by injected particle
38  ++fNumC;
39  }
40  }
41 
42 
43  void
44  G4StationTrackingAction::PostUserTrackingAction(const G4Track* const /*track*/)
45  {
46  firstStepInVolume = false;
47  }
48 
49 }
virtual void PreUserTrackingAction(const G4Track *const track) override
virtual void PostUserTrackingAction(const G4Track *const track) override

, generated on Tue Sep 26 2023.