19#ifndef BDSARRAYOPERATORINDEXFLIP_H
20#define BDSARRAYOPERATORINDEXFLIP_H
21#include "BDSArrayOperatorIndex.hh"
47 for (G4int i = 0; i < 4; i++)
48 {xyzt[0] = xyztIn[i] ? -1 : 1;}
50 G4String newName =
"Flip(";
51 for (
const auto& v : xyzt)
52 {newName += std::to_string(v < 0);}
68 virtual void ApplyX(G4int& x)
const {x *= xyzt[0];}
69 virtual void ApplyY(G4int& y)
const {y *= xyzt[1];}
70 virtual void ApplyZ(G4int& z)
const {z *= xyzt[2];}
71 virtual void ApplyT(G4int& t)
const {t *= xyzt[3];}
73 virtual void TransformLimits(G4double& xMin, G4double& xMax,
74 G4double& yMin, G4double& yMax,
75 G4double& zMin, G4double& zMax,
76 G4double& tMin, G4double& tMax)
const
79 {std::swap(xMin, xMax);}
81 {std::swap(yMin, yMax);}
83 {std::swap(zMin, zMax);}
85 {std::swap(tMin, tMax);}
89 std::array<G4int,4> xyzt;
1D array for completeness in array system.
virtual void Apply(G4int &x, G4int &y, G4int &z, G4int &t) const
Interface for modifying by reference array indices.