G4XTankSteppingAction.h
Go to the documentation of this file.
1 #ifndef _G4XTankSimulatorAG_G4XTankSteppingAction_h_
2 #define _G4XTankSimulatorAG_G4XTankSteppingAction_h_
3 
4 #include <G4UserSteppingAction.hh>
5 #include <globals.hh>
6 
7 #include <utl/Particle.h>
8 
9 #include <vector>
10 #include <string>
11 using std::vector;
12 using std::string;
13 
14 class G4Step;
15 
16 namespace G4XTankSimulatorAG {
17 
18 #if __cplusplus >= 201103L
19 #include <memory>
20 typedef std::shared_ptr<utl::Particle> smartPointer;
21 #else
22 #include <boost/shared_ptr.hpp>
23 
24 typedef boost::shared_ptr<utl::Particle> smartPointer;
25 #endif /* __cplusplus >= 201103L */
26 
27 class PartData {
28  public:
30  Pname="unknown";
31  PDGCode=-1;
32  x=0;
33  y=0;
34  z=0;
35  px=0;
36  py=0;
37  pz=0;
38  KinE = 0;
39  Time = 0;
40  }
41  string Pname;
42  int PDGCode;
43  int TrackID;
45  //Position
46  double x;
47  double y;
48  double z;
49  //Direction
50  double px;
51  double py;
52  double pz;
53  //Energy & Time
54  double KinE;
55  double Time;
56 };
57 
67  class G4XTankSteppingAction : public G4UserSteppingAction {
68 
69  public:
72 
73  void UserSteppingAction(const G4Step *);
74 
75  static int GetCurrentParticleId() { return fgParticleId; }
76 
77 
78  typedef vector<PartData> PartCollection;
79  typedef vector<PartData>::iterator PartCollectionIt;
80 
83 
84  double fCounterDepth;
85 
87  fPData.PParent = p;
88  #ifdef AMIGA_DEBUG
89  G4cerr << "Setting parent to "
90  << fPData.PParent->GetType() << " \n";
91  #endif
92  }
93 
94  private:
95  static int fgParticleId;
96 
97  G4double fDepth;
99 
100 
101  };
102 }
103 
104 #endif
vector< PartData >::iterator PartCollectionIt
boost::shared_ptr< utl::Particle > smartPointer
Geant4 Stepping user action class.

, generated on Tue Sep 26 2023.