PlasmaMLPALLAS
Loading...
Searching...
No Matches
PlasmaMLPALLASEventAction.hh
Go to the documentation of this file.
1#ifndef PlasmaMLPALLASEventAction_h
2#define PlasmaMLPALLASEventAction_h 1
3
12#include "G4UserEventAction.hh"
14
15class G4Event;
16
23{
24 float x = 0.0;
25 float xp = 0.0;
26 float y = 0.0;
27 float yp = 0.0;
28 float z = 0.0;
29 float zp = 0.0;
30 float energy = 0.0;
31};
32
33
40{
41 float x = 0.0;
42 float y = 0.0;
43 float z = 0.0;
44 float energy = 0.0;
45 bool flag =false;
46
47 // Methods to set data
48 void SetXInteraction(float d) { x =d; }
49 void SetYInteraction(float d) { y =d; }
50 void SetZInteraction(float d) { z =d; }
51 void SetEnergy(float d) { energy =d; }
52 void ActiveFlag(){flag=true;}
53 void ResetFlag(){flag=false;}
54
55 // Methods to access data
56 float GetXInteraction() const { return x; }
57 float GetYInteraction() const { return y; }
58 float GetZInteraction() const { return z; }
59 float GetEnergy() const { return energy; }
60 bool GetFlag() {return flag;}
61
62
63};
64
71{
72 std::vector<float> x_exit;
73 std::vector<float> y_exit;
74 std::vector<float> z_exit;
75 std::vector<int> parentID;
76 std::vector<int> particleID;
77 std::vector<float> energy;
78 float deposited_energy = 0.0;
79 std::vector<float> total_deposited_energy;
80 G4bool flag = false;
81
82 // Methods to add data
83 void AddXExit(float d) { x_exit.push_back(d); }
84 void AddYExit(float d) { y_exit.push_back(d); }
85 void AddZExit(float d) { z_exit.push_back(d); }
86 void AddParentID(int d) { parentID.push_back(d); }
87 void AddParticleID(int d) { particleID.push_back(d); }
88 void AddEnergy(float d) { energy.push_back(d); }
89 void AddDepositedEnergy(float d) { deposited_energy += d; }
90 void AddTotalDepositedEnergy(float d) { total_deposited_energy.push_back(d); }
91
92 // Size accessors
93 size_t XExitSize() const { return x_exit.size(); }
94 size_t YExitSize() const { return y_exit.size(); }
95 size_t ZExitSize() const { return z_exit.size(); }
96 size_t ParentIDSize() const { return parentID.size(); }
97 size_t ParticleIDSize() const { return particleID.size(); }
98 size_t EnergySize() const { return energy.size(); }
99 size_t TotalDepositedEnergySize() const { return total_deposited_energy.size(); }
100
101 // Index accessors
102 float GetXExit(size_t i) const { return x_exit.at(i); }
103 float GetYExit(size_t i) const { return y_exit.at(i); }
104 float GetZExit(size_t i) const { return z_exit.at(i); }
105 int GetParentID(size_t i) const { return parentID.at(i); }
106 int GetParticleID(size_t i) const { return particleID.at(i); }
107 float GetEnergy(size_t i) const { return energy.at(i); }
108 float GetTotalDepositedEnergy(size_t i) const { return total_deposited_energy.at(i); }
109
110 // Flags
111 void ActivateFlag() { flag = true; }
112 void ResetFlag() { flag = false; }
113 G4bool ReturnFlag() const { return flag; }
114
116 float GetDepositedEnergy() const { return deposited_energy; }
117};
118
125class PlasmaMLPALLASEventAction : public G4UserEventAction
126{
127public:
129 PlasmaMLPALLASEventAction(const char *);
130
133
135 void BeginOfEventAction(const G4Event *);
136
138 void EndOfEventAction(const G4Event *);
139
141 void SetXStart(G4float d) { StatsInput.x = d; }
142 void SetXpStart(G4float d) { StatsInput.xp = d; }
143 void SetYStart(G4float d) { StatsInput.y = d; }
144 void SetYpStart(G4float d) { StatsInput.yp = d; }
145 void SetZStart(G4float d) { StatsInput.z = d; }
146 void SetZpStart(G4float d) { StatsInput.zp = d; }
147 void SetEnergyStart(G4float d) { StatsInput.energy = d; }
148
150 void SetEnergy(G4float d) { StatsQuadrupoles.energy = d; }
151
158 RunTallyQuadrupoles& GetStatsQuadrupoles() { return StatsQuadrupoles; }
159
161 RunTallyCollimators& GetVerticalCollimators() { return StatsVerticalColl; }
162 RunTallyCollimators& GetHorizontalCollimators() { return StatsHorizontalColl; }
163
165 RunTallyYAG& GetBSYAG() { return StatsBSYAG; }
166 RunTallyYAG& GetBSPECYAG() { return StatsBSPECYAG; }
167
168private:
169 TTree *EventTree;
170 TBranch *EventBranch;
171 RunTallyInput StatsInput;
172 RunTallyQuadrupoles StatsQuadrupoles;
173 RunTallyCollimators StatsHorizontalColl;
174 RunTallyCollimators StatsVerticalColl;
175 RunTallyYAG StatsBSYAG;
176 RunTallyYAG StatsBSPECYAG;
177 G4String suffixe;
178};
179
180#endif
Event action class for PlasmaMLPALLAS.
Definition PlasmaMLPALLASEventAction.hh:126
void EndOfEventAction(const G4Event *)
Called at the end of each event.
Definition PlasmaMLPALLASEventAction.cc:82
void SetZStart(G4float d)
Definition PlasmaMLPALLASEventAction.hh:145
void BeginOfEventAction(const G4Event *)
Called at the beginning of each event.
Definition PlasmaMLPALLASEventAction.cc:56
RunTallyCollimators & GetHorizontalCollimators()
Definition PlasmaMLPALLASEventAction.hh:162
RunTallyYAG & GetBSYAG()
Definition PlasmaMLPALLASEventAction.hh:165
void SetEnergy(G4float d)
Definition PlasmaMLPALLASEventAction.hh:150
void SetXpStart(G4float d)
Definition PlasmaMLPALLASEventAction.hh:142
void SetYpStart(G4float d)
Definition PlasmaMLPALLASEventAction.hh:144
void SetXStart(G4float d)
Definition PlasmaMLPALLASEventAction.hh:141
RunTallyYAG & GetBSPECYAG()
Definition PlasmaMLPALLASEventAction.hh:166
void SetYStart(G4float d)
Definition PlasmaMLPALLASEventAction.hh:143
RunTallyQuadrupoles & GetStatsQuadrupoles()
Definition PlasmaMLPALLASEventAction.hh:158
void SetEnergyStart(G4float d)
Definition PlasmaMLPALLASEventAction.hh:147
RunTallyCollimators & GetVerticalCollimators()
Definition PlasmaMLPALLASEventAction.hh:161
void SetZpStart(G4float d)
Definition PlasmaMLPALLASEventAction.hh:146
~PlasmaMLPALLASEventAction()
Destructor for PlasmaMLPALLASEventAction.
Definition PlasmaMLPALLASEventAction.cc:43
Structure for collimators statistics.
Definition PlasmaMLPALLASEventAction.hh:40
void SetYInteraction(float d)
Definition PlasmaMLPALLASEventAction.hh:49
bool GetFlag()
Definition PlasmaMLPALLASEventAction.hh:60
void SetZInteraction(float d)
Definition PlasmaMLPALLASEventAction.hh:50
float energy
Definition PlasmaMLPALLASEventAction.hh:44
void ResetFlag()
Definition PlasmaMLPALLASEventAction.hh:53
void SetXInteraction(float d)
Definition PlasmaMLPALLASEventAction.hh:48
bool flag
Definition PlasmaMLPALLASEventAction.hh:45
float x
Definition PlasmaMLPALLASEventAction.hh:41
float GetZInteraction() const
Definition PlasmaMLPALLASEventAction.hh:58
void SetEnergy(float d)
Definition PlasmaMLPALLASEventAction.hh:51
float z
Definition PlasmaMLPALLASEventAction.hh:43
float GetXInteraction() const
Definition PlasmaMLPALLASEventAction.hh:56
float GetEnergy() const
Definition PlasmaMLPALLASEventAction.hh:59
float GetYInteraction() const
Definition PlasmaMLPALLASEventAction.hh:57
float y
Definition PlasmaMLPALLASEventAction.hh:42
void ActiveFlag()
Definition PlasmaMLPALLASEventAction.hh:52
Structure to store per-event input particle data.
Definition PlasmaMLPALLASEventAction.hh:23
float energy
Definition PlasmaMLPALLASEventAction.hh:30
float x
Definition PlasmaMLPALLASEventAction.hh:24
float zp
Definition PlasmaMLPALLASEventAction.hh:29
float xp
Definition PlasmaMLPALLASEventAction.hh:25
float yp
Definition PlasmaMLPALLASEventAction.hh:27
float z
Definition PlasmaMLPALLASEventAction.hh:28
float y
Definition PlasmaMLPALLASEventAction.hh:26
Definition PlasmaMLPALLASQuadrupoleUtils.hh:56
float energy
Definition PlasmaMLPALLASQuadrupoleUtils.hh:61
Structure for YAG detector statistics.
Definition PlasmaMLPALLASEventAction.hh:71
std::vector< float > z_exit
Definition PlasmaMLPALLASEventAction.hh:74
std::vector< int > parentID
Definition PlasmaMLPALLASEventAction.hh:75
int GetParticleID(size_t i) const
Definition PlasmaMLPALLASEventAction.hh:106
G4bool ReturnFlag() const
Definition PlasmaMLPALLASEventAction.hh:113
void AddYExit(float d)
Definition PlasmaMLPALLASEventAction.hh:84
float GetTotalDepositedEnergy(size_t i) const
Definition PlasmaMLPALLASEventAction.hh:108
size_t TotalDepositedEnergySize() const
Definition PlasmaMLPALLASEventAction.hh:99
void AddDepositedEnergy(float d)
Definition PlasmaMLPALLASEventAction.hh:89
float GetXExit(size_t i) const
Definition PlasmaMLPALLASEventAction.hh:102
size_t ParticleIDSize() const
Definition PlasmaMLPALLASEventAction.hh:97
void AddParticleID(int d)
Definition PlasmaMLPALLASEventAction.hh:87
float deposited_energy
Definition PlasmaMLPALLASEventAction.hh:78
void ResetFlag()
Definition PlasmaMLPALLASEventAction.hh:112
std::vector< int > particleID
Definition PlasmaMLPALLASEventAction.hh:76
size_t XExitSize() const
Definition PlasmaMLPALLASEventAction.hh:93
float GetYExit(size_t i) const
Definition PlasmaMLPALLASEventAction.hh:103
void AddParentID(int d)
Definition PlasmaMLPALLASEventAction.hh:86
int GetParentID(size_t i) const
Definition PlasmaMLPALLASEventAction.hh:105
G4bool flag
Definition PlasmaMLPALLASEventAction.hh:80
size_t YExitSize() const
Definition PlasmaMLPALLASEventAction.hh:94
std::vector< float > x_exit
Definition PlasmaMLPALLASEventAction.hh:72
void ResetDepositedEnergy()
Definition PlasmaMLPALLASEventAction.hh:115
void AddTotalDepositedEnergy(float d)
Definition PlasmaMLPALLASEventAction.hh:90
size_t ZExitSize() const
Definition PlasmaMLPALLASEventAction.hh:95
std::vector< float > energy
Definition PlasmaMLPALLASEventAction.hh:77
float GetDepositedEnergy() const
Definition PlasmaMLPALLASEventAction.hh:116
size_t EnergySize() const
Definition PlasmaMLPALLASEventAction.hh:98
void AddZExit(float d)
Definition PlasmaMLPALLASEventAction.hh:85
size_t ParentIDSize() const
Definition PlasmaMLPALLASEventAction.hh:96
void ActivateFlag()
Definition PlasmaMLPALLASEventAction.hh:111
float GetEnergy(size_t i) const
Definition PlasmaMLPALLASEventAction.hh:107
float GetZExit(size_t i) const
Definition PlasmaMLPALLASEventAction.hh:104
std::vector< float > y_exit
Definition PlasmaMLPALLASEventAction.hh:73
std::vector< float > total_deposited_energy
Definition PlasmaMLPALLASEventAction.hh:79
void AddEnergy(float d)
Definition PlasmaMLPALLASEventAction.hh:88
void AddXExit(float d)
Definition PlasmaMLPALLASEventAction.hh:83