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();
110 double avgx = 0, avgy = 0, avgz = 0;
112 auto nsteps = edeps.size();
113 for (
size_t s = 0; s <
nsteps; s++) {
115 if (totalEnergyDeposited > 0) {
116 avgx += globalPositions[s].getX() * edeps[s] / tote;
117 avgy += globalPositions[s].getY() * edeps[s] / tote;
118 avgz += globalPositions[s].getZ() * edeps[s] / tote;
122 averageTime += times[s] /
nsteps;
123 avgx += globalPositions[s].getX() /
nsteps;
124 avgy += globalPositions[s].getY() /
nsteps;
125 avgz += globalPositions[s].getZ() /
nsteps;
128 avgGlobalPosition = G4ThreeVector(avgx, avgy, avgz);
131 return avgGlobalPosition;
139 double avgx = 0, avgy = 0, avgz = 0;
141 auto nsteps = edeps.size();
142 for (
size_t s = 0; s <
nsteps; s++) {
144 if (totalEnergyDeposited > 0) {
145 avgx += localPositions[s].getX() * edeps[s] / tote;
146 avgy += localPositions[s].getY() * edeps[s] / tote;
147 avgz += localPositions[s].getZ() * edeps[s] / tote;
151 averageTime += times[s] /
nsteps;
152 avgx += localPositions[s].getX() /
nsteps;
153 avgy += localPositions[s].getY() /
nsteps;
154 avgz += localPositions[s].getZ() /
nsteps;
157 avgLocalPosition = G4ThreeVector(avgx, avgy, avgz);
159 return avgLocalPosition;