G4SoilAction.cc
Go to the documentation of this file.
1 #include "G4SoilAction.h"
2 #include "G4StationSimulator.h"
3 
4 #include <G4Step.hh>
5 #include <G4TouchableHistory.hh>
6 
7 
8 namespace G4StationSimulatorOG {
9 
10  G4SoilAction::G4SoilAction(const G4String& name) :
11  G4VSensitiveDetector(name),
12  fG4StationSimulator(
13  dynamic_cast<G4StationSimulator&>(fwk::RunController::GetInstance().GetModule("G4StationSimulatorOG"))
14  )
15  { }
16 
17 
18  G4bool
19  G4SoilAction::ProcessHits(G4Step* const step, G4TouchableHistory* const /*rOHist*/)
20  {
22  return true;
23 
24  // Particle
25  const G4String& pName = step->GetTrack()->GetDefinition()->GetParticleName();
26  const G4double kin = step->GetTrack()->GetKineticEnergy();
27 
28  // Only first step inside scintillator (PreStepPoint() == fGeomBoundary on:
29  //
30  // vol1 | vol2 (Soil) | vol3
31  // | |
32  // | CurrStep |
33  // |o----------------o |
34  // | |
35  // |PrePoint PostPoint |
36  // | |
37  // |------------------------------------|
38  // | |
39  // | o----------------o|
40  // | |
41  // PrePoint PostPoint
42  //
43  // GeomBoundary Vol1-Vol2 GeomBoundary Vol2-Vol3
44 
45  if (step->GetPreStepPoint()->GetStepStatus() == fGeomBoundary) {
46 
47  if ((pName == "gamma" && kin < fG4StationSimulator.fUMDGammaCut) ||
48  ((pName == "mu+" || pName == "mu-") && kin < fG4StationSimulator.fUMDMuonsCut) ||
49  ((pName == "e+" || pName == "e-" ) && kin < fG4StationSimulator.fUMDElectCut) ||
51  step->GetTrack()->SetTrackStatus(fKillTrackAndSecondaries);
52  return false;
53  }
54 
55  }
56 
57  return true;
58  }
59 
60 }
G4StationSimulator & fG4StationSimulator
Definition: G4SoilAction.h:25
virtual G4bool ProcessHits(G4Step *const step, G4TouchableHistory *const rOhist) override
Definition: G4SoilAction.cc:19
G4SoilAction(const G4String &name)
Definition: G4SoilAction.cc:10
class that handles Geant4 SD Station simulation adopted from G4TankSimulator

, generated on Tue Sep 26 2023.