Deprecated/UpgradeASCIITests/G4TankSimulatorASCII/G4TankStackingAction.cc
Go to the documentation of this file.
1 #include "G4TankStackingAction.h"
2 #include "G4TankTrackingAction.h"
3 #include "G4TankSimulator.h"
4 
5 #include <fwk/RandomEngineRegistry.h>
6 
7 #include <sdet/Station.h>
8 #include <sdet/PMT.h>
9 
10 #include <utl/TabulatedFunction.h>
11 
12 #include <CLHEP/Random/RandFlat.h>
13 
14 #include <G4Track.hh>
15 #include <G4TrackingManager.hh>
16 #include <G4TrackStatus.hh>
17 #include <G4OpticalPhoton.hh>
18 
19 using namespace sdet;
20 using namespace fwk;
21 using namespace G4TankSimulatorASCII;
22 using CLHEP::RandFlat;
23 
24 
25 G4TankStackingAction::G4TankStackingAction() :
26  fCurrentDetectorStation(0)
27 {
29  &RandomEngineRegistry::GetInstance().Get(RandomEngineRegistry::eDetector);
30 }
31 
32 
33 G4ClassificationOfNewTrack
35 {
36  //Kill Decay Products from the Primary particle
37  if ( aTrack->GetParentID() ==1 && aTrack->GetCreatorProcess()->GetProcessName() == "Decay")
38  {
39 
40  if (aTrack->GetDefinition()->GetParticleName()=="e-" || aTrack->GetDefinition()->GetParticleName()=="e+" )
41  {
42  G4TankTrackingAction::MichelElectronKE=aTrack->GetKineticEnergy();
43  G4TankTrackingAction::MichelElectronTheta=aTrack->GetMomentumDirection().theta();
44  G4TankTrackingAction::MichelElectronZ=aTrack->GetPosition().z();
45 
46 
47  }
48  return fWaiting;
49  }
50 
51  // NOTE: for now, we assume that each pmt has the same collection
52  // and quantum efficiencies
53 
54  if (aTrack->GetDefinition() != G4OpticalPhoton::OpticalPhoton())
55  return fWaiting;
56 
57  // optical photon
58 
59  const double energy = aTrack->GetKineticEnergy() *
60  (utl::MeV / CLHEP::MeV);
61 
62  // Randomly kill photons according to quantum and collection
63  // efficiency to speed up simulation
64 
65  if (RandFlat::shoot(&fRandomEngine->GetEngine(), 0, 1) >
67  return fKill;
68 
69  return fWaiting;
70 }
71 
72 
73 void
75 {
76  fCurrentDetectorStation = station;
77 
79 
81 }
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.
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.