43 xyzt{
false,
false,
false,
false},
44 zeroInArrayCoords{0,0,0,0},
45 dimensionInverted{
false,
false,
false,
false}
53 G4String newName =
"Reflect(";
54 for (
const auto& v : xyzt)
55 {newName += std::to_string(v);}
59 auto zeroV = arrayInfo.zeroPoint;
60 auto nPoints = arrayInfo.nPoints;
61 for (G4int i = 0; i < 4; i++)
63 G4bool inverted = (zeroV[i] >= nPoints[i] - 1) && (nPoints[i] > 1);
64 dimensionInverted[i] = inverted;
65 zeroInArrayCoords[i] = inverted ? nPoints[i] - 1 : (G4int)std::floor(zeroV[i]);
75 G4int* values[4] = {&x, &y, &z, &t};
76 for (G4int i = 0; i < 4; i++)
78 G4int v = *(values[i]);
79 if (dimensionInverted[i])
80 { *(values[i]) = xyzt[i] && v > zeroInArrayCoords[i] ? zeroInArrayCoords[i] - (v- zeroInArrayCoords[i]) : v;}
82 { *(values[i]) = xyzt[i] && v < zeroInArrayCoords[i] ? std::abs(v - zeroInArrayCoords[i]) : v; }
86 virtual void ApplyX(G4int& x)
const {x = xyzt[0] ? std::abs(x) : x;}
87 virtual void ApplyY(G4int& y)
const {y = xyzt[1] ? std::abs(y) : y;}
88 virtual void ApplyZ(G4int& z)
const {z = xyzt[2] ? std::abs(z) : z;}
89 virtual void ApplyT(G4int& t)
const {t = xyzt[3] ? std::abs(t) : t;}
91 virtual void TransformLimits(G4double& xMin, G4double& xMax,
92 G4double& yMin, G4double& yMax,
93 G4double& zMin, G4double& zMax,
94 G4double& tMin, G4double& tMax)
const
96 xMin = -std::abs(xMax);
97 yMin = -std::abs(yMax);
98 zMin = -std::abs(zMax);
99 tMin = -std::abs(tMax);
103 std::array<G4bool,4> xyzt;
104 std::array<G4int, 4> zeroInArrayCoords;
105 std::array<G4bool,4> dimensionInverted;