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;
38 averageTime += times[s] /
nsteps;
39 avgx += globalPositions[s].getX() /
nsteps;
40 avgy += globalPositions[s].getY() /
nsteps;
41 avgz += globalPositions[s].getZ() /
nsteps;
42 avglx += localPositions[s].getX() /
nsteps;
43 avgly += localPositions[s].getY() /
nsteps;
44 avglz += localPositions[s].getZ() /
nsteps;
47 avgGlobalPosition = G4ThreeVector(avgx, avgy, avgz);
48 avgLocalPosition = G4ThreeVector(avglx, avgly, avglz);
51 if (!processNames.empty()) {
52 processName = processNames.front();
58 }
else if (bit == 2) {
60 }
else if (bit == 3) {
62 }
else if (bit == 4) {
117 if (avgGlobalPosition.getX() == UNINITIALIZEDNUMBERQUANTITY && avgGlobalPosition.getY() == UNINITIALIZEDNUMBERQUANTITY) {
121 double avgx = 0, avgy = 0, avgz = 0;
123 auto nsteps = edeps.size();
124 for (
size_t s = 0; s <
nsteps; s++) {
125 if (totalEnergyDeposited > 0) {
126 avgx += globalPositions[s].getX() * edeps[s] / tote;
127 avgy += globalPositions[s].getY() * edeps[s] / tote;
128 avgz += globalPositions[s].getZ() * edeps[s] / tote;
130 averageTime += times[s] /
nsteps;
131 avgx += globalPositions[s].getX() /
nsteps;
132 avgy += globalPositions[s].getY() /
nsteps;
133 avgz += globalPositions[s].getZ() /
nsteps;
136 avgGlobalPosition = G4ThreeVector(avgx, avgy, avgz);
139 return avgGlobalPosition;
150 if (avgLocalPosition.getX() == UNINITIALIZEDNUMBERQUANTITY && avgLocalPosition.getY() == UNINITIALIZEDNUMBERQUANTITY) {
154 double avgx = 0, avgy = 0, avgz = 0;
156 auto nsteps = edeps.size();
157 for (
size_t s = 0; s <
nsteps; s++) {
158 if (totalEnergyDeposited > 0) {
159 avgx += localPositions[s].getX() * edeps[s] / tote;
160 avgy += localPositions[s].getY() * edeps[s] / tote;
161 avgz += localPositions[s].getZ() * edeps[s] / tote;
163 averageTime += times[s] /
nsteps;
164 avgx += localPositions[s].getX() /
nsteps;
165 avgy += localPositions[s].getY() /
nsteps;
166 avgz += localPositions[s].getZ() /
nsteps;
169 avgLocalPosition = G4ThreeVector(avgx, avgy, avgz);
172 return avgLocalPosition;