22#include "BDSFieldValue.hh"
23#include "BDSFourVector.hh"
58 BDSArray4D(G4int nXIn, G4int nYIn, G4int nZIn, G4int nTIn);
62 inline G4int
NX()
const {
return nX;}
63 inline G4int
NY()
const {
return nY;}
64 inline G4int
NZ()
const {
return nZ;}
65 inline G4int
NT()
const {
return nT;}
112 virtual std::ostream&
Print(std::ostream& out)
const;
131 std::vector<BDSFieldValue>
data;
4D array and base class for 3,2 & 1D arrays.
virtual void OutsideWarn(G4int x, G4int y, G4int z, G4int t) const
Use Outside() but warn and exit if the coordinates requested are outside the array.
G4int NZ() const
Access the number of elements in a given dimension.
friend std::ostream & operator<<(std::ostream &out, BDSArray4D const &a)
Output stream.
std::vector< BDSFieldValue > data
A 1D array representing all the data.
virtual G4bool Outside(G4int x, G4int y, G4int z, G4int t) const
Return whether the indices are valid and lie within the array boundaries or not.
virtual BDSFieldValue & operator()(G4int x, G4int y=0, G4int z=0, G4int t=0)
Setter & (technically, a non-const) accessor.
G4int NX() const
Access the number of elements in a given dimension.
G4int NT() const
Access the number of elements in a given dimension.
const BDSFieldValue & operator()(BDSFourVector< G4int > &pos)
Convenience accessor to operator().
BDSFieldValue defaultValue
Need to store a default value so it can be return by reference.
const BDSFieldValue & operator()(const BDSFourVector< G4int > &pos) const
Convenience accessor to operator().
BDSFourVector< G4int > NXYZT() const
Access the number of elements in a given dimension.
virtual const BDSFieldValue & GetConst(G4int x, G4int y=0, G4int z=0, G4int t=0) const
virtual std::ostream & Print(std::ostream &out) const
G4int NY() const
Access the number of elements in a given dimension.
A simple templated four vector class.
const Type & y() const
Accessor by name.
const Type & z() const
Accessor by name.
const Type & x() const
Accessor by name.
const Type & t() const
Accessor by name.