MdEdepSimulatorAG/SteppingAction.h
Go to the documentation of this file.
1 #ifndef _EdepSimulatorAG_SteppingAction_h_
2 #define _EdepSimulatorAG_SteppingAction_h_
3 
4 #include <globals.hh>
5 #include <G4UserSteppingAction.hh>
6 
7 #include <utl/Particle.h>
8 
9 #include <vector>
10 #include <map>
11 #include <string>
12 using std::vector;
13 using std::string;
14 using std::map;
15 
16 
17 namespace EdepSimulatorAG {
18 
19 class Data {
20 public:
21  Data()
22  {
23  Sname = "unknown";
24  Pname = "unknown";
25  PDGCode = -1;
26  ParentID = -1;
27  TrackID =- 1;
28  PParent = 0;
29  x = 0;
30  y = 0;
31  z = 0;
32  px = 0;
33  py = 0;
34  pz = 0;
35  KinE = 0;
36  Edep = 0;
37  Time = 0;
38  }
39 
40  string Sname;
41  string Pname;
42  int PDGCode;
43  int ParentID;//parent of any G4 particle created inside scintillator
44  int TrackID;
45  utl::Particle *PParent;//Injected particle in scintillator
46  //Position
47  double x;
48  double y;
49  double z;
50  //Direction
51  double px;
52  double py;
53  double pz;
54  //Energy & Time
55  double KinE;
56  double Edep;
57  double Time;
58 };
59 
60 
61 class DataCollection : public std::vector<Data> {
62 public:
63  DataCollection() : std::vector<Data>() { }
64  DataCollection(const Data &pd) : std::vector<Data>() { push_back(pd); }
65 };
66 
67 
68 class SteppingAction : public G4UserSteppingAction {
69 
70 public:
71 
72  typedef map<int, DataCollection> ScintMap;
73  typedef ScintMap::iterator ScintMapIt;
74 
76  virtual ~SteppingAction();
77 
78  virtual void UserSteppingAction(const G4Step*);
79 
80  void
82  {
83  fPParent = p;
84 #ifdef AMIGA_DEBUG
85  G4cerr << "Setting parent to "
86  << fPParent->GetType() << '\n';
87 #endif
88  }
89 
91 
92  //PartCollection fPartColl;
93  //PartCollectionIt fPartCollIt;
94 
95  void SetScintillatorId(int id) { fScintID = id; }
96  const ScintMap& GetScintMap() { return fScintMap; }
97  void ClearMap() { fScintMap.clear(); }
98 
99 private:
101  G4int fScintID;
103 
104 };
105 
106 }
107 
108 
109 #endif
Describes a particle for Simulation.
Definition: Particle.h:26
int GetType() const
Definition: Particle.h:101

, generated on Tue Sep 26 2023.