22 double avgx = 0, avgy = 0, avgz = 0;
23 double avglx = 0, avgly = 0, avglz = 0;
26 auto nsteps = edeps.size();
27 for (
size_t s = 0; s <
nsteps; s++) {
30 averageTime += times[s] * edeps[s] / tote;
31 avgx += globalPositions[s].getX() * edeps[s] / tote;
32 avgy += globalPositions[s].getY() * edeps[s] / tote;
33 avgz += globalPositions[s].getZ() * edeps[s] / tote;
34 avglx += localPositions[s].getX() * edeps[s] / tote;
35 avgly += localPositions[s].getY() * edeps[s] / tote;
36 avglz += localPositions[s].getZ() * edeps[s] / tote;
40 averageTime += times[s] /
nsteps;
41 avgx += globalPositions[s].getX() /
nsteps;
42 avgy += globalPositions[s].getY() /
nsteps;
43 avgz += globalPositions[s].getZ() /
nsteps;
44 avglx += localPositions[s].getX() /
nsteps;
45 avgly += localPositions[s].getY() /
nsteps;
46 avglz += localPositions[s].getZ() /
nsteps;
49 avgGlobalPosition = G4ThreeVector(avgx, avgy, avgz);
50 avgLocalPosition = G4ThreeVector(avglx, avgly, avglz);
53 if (!processNames.empty()) {
54 processName = processNames.front();
111 double avgx = 0, avgy = 0, avgz = 0;
113 auto nsteps = edeps.size();
114 for (
size_t s = 0; s <
nsteps; s++) {
116 if (totalEnergyDeposited > 0) {
117 avgx += globalPositions[s].getX() * edeps[s] / tote;
118 avgy += globalPositions[s].getY() * edeps[s] / tote;
119 avgz += globalPositions[s].getZ() * edeps[s] / tote;
123 averageTime += times[s] /
nsteps;
124 avgx += globalPositions[s].getX() /
nsteps;
125 avgy += globalPositions[s].getY() /
nsteps;
126 avgz += globalPositions[s].getZ() /
nsteps;
129 avgGlobalPosition = G4ThreeVector(avgx, avgy, avgz);
132 return avgGlobalPosition;
140 double avgx = 0, avgy = 0, avgz = 0;
142 auto nsteps = edeps.size();
143 for (
size_t s = 0; s <
nsteps; s++) {
145 if (totalEnergyDeposited > 0) {
146 avgx += localPositions[s].getX() * edeps[s] / tote;
147 avgy += localPositions[s].getY() * edeps[s] / tote;
148 avgz += localPositions[s].getZ() * edeps[s] / tote;
152 averageTime += times[s] /
nsteps;
153 avgx += localPositions[s].getX() /
nsteps;
154 avgy += localPositions[s].getY() /
nsteps;
155 avgz += localPositions[s].getZ() /
nsteps;
158 avgLocalPosition = G4ThreeVector(avgx, avgy, avgz);
160 return avgLocalPosition;