19 double avgx = 0, avgy = 0, avgz = 0;
20 double avglx = 0, avgly = 0, avglz = 0;
23 auto nsteps_ = edeps.size();
24 for (
size_t s = 0; s < nsteps_; s++) {
27 averageTime += times[s] * edeps[s] / tote;
28 avgx += globalPositions[s].getX() * edeps[s] / tote;
29 avgy += globalPositions[s].getY() * edeps[s] / tote;
30 avgz += globalPositions[s].getZ() * edeps[s] / tote;
31 avglx += localPositions[s].getX() * edeps[s] / tote;
32 avgly += localPositions[s].getY() * edeps[s] / tote;
33 avglz += localPositions[s].getZ() * edeps[s] / tote;
36 averageTime += times[s] / nsteps_;
37 avgx += globalPositions[s].getX() / nsteps_;
38 avgy += globalPositions[s].getY() / nsteps_;
39 avgz += globalPositions[s].getZ() / nsteps_;
40 avglx += localPositions[s].getX() / nsteps_;
41 avgly += localPositions[s].getY() / nsteps_;
42 avglz += localPositions[s].getZ() / nsteps_;
45 avgGlobalPosition = G4ThreeVector(avgx, avgy, avgz);
46 avgLocalPosition = G4ThreeVector(avglx, avgly, avglz);
49 if (!processNames.empty()) {
50 processName = processNames.front();
90 double avgx = 0, avgy = 0, avgz = 0;
92 auto nsteps_ = edeps.size();
93 for (
size_t s = 0; s < nsteps_; s++) {
94 if (totalEnergyDeposited > 0) {
95 avgx += globalPositions[s].getX() * edeps[s] / tote;
96 avgy += globalPositions[s].getY() * edeps[s] / tote;
97 avgz += globalPositions[s].getZ() * edeps[s] / tote;
100 averageTime += times[s] / nsteps_;
101 avgx += globalPositions[s].getX() / nsteps_;
102 avgy += globalPositions[s].getY() / nsteps_;
103 avgz += globalPositions[s].getZ() / nsteps_;
106 avgGlobalPosition = G4ThreeVector(avgx, avgy, avgz);
109 return avgGlobalPosition;
117 double avgx = 0, avgy = 0, avgz = 0;
119 auto nsteps_ = edeps.size();
120 for (
size_t s = 0; s < nsteps_; s++) {
121 if (totalEnergyDeposited > 0) {
122 avgx += localPositions[s].getX() * edeps[s] / tote;
123 avgy += localPositions[s].getY() * edeps[s] / tote;
124 avgz += localPositions[s].getZ() * edeps[s] / tote;
127 averageTime += times[s] / nsteps_;
128 avgx += localPositions[s].getX() / nsteps_;
129 avgy += localPositions[s].getY() / nsteps_;
130 avgz += localPositions[s].getZ() / nsteps_;
133 avgLocalPosition = G4ThreeVector(avgx, avgy, avgz);
135 return avgLocalPosition;