19#ifndef BDSARRAY4DCOORDS_H
20#define BDSARRAY4DCOORDS_H
22#include "BDSArray4D.hh"
23#include "BDSDimensionType.hh"
24#include "BDSFourVector.hh"
59 G4double xMinIn, G4double xMaxIn,
60 G4double yMinIn, G4double yMaxIn,
61 G4double zMinIn, G4double zMaxIn,
62 G4double tMinIn, G4double tMaxIn,
104 G4double& y, G4double& yArr)
const
107 G4double& y, G4double& yArr,
108 G4double& z, G4double& zArr)
const
111 G4double& y, G4double& yArr,
112 G4double& z, G4double& zArr,
113 G4double& t, G4double& tArr)
const
186 G4double& tFrac)
const;
197 G4double& tFrac)
const;
203 G4double t = 0)
const;
207 virtual std::ostream&
Print(std::ostream& out)
const;
215 inline G4double XMin()
const {
return xMin;}
216 inline G4double YMin()
const {
return yMin;}
217 inline G4double ZMin()
const {
return zMin;}
218 inline G4double TMin()
const {
return tMin;}
219 inline G4double XMax()
const {
return xMax;}
220 inline G4double YMax()
const {
return yMax;}
221 inline G4double ZMax()
const {
return zMax;}
222 inline G4double TMax()
const {
return tMax;}
262 G4double smallestSpatialStep;
270 std::array<G4int, 4> dimensions;
274 static void CheckStep(G4double step,
const G4String& name);
Overlay of 4D array that provides uniform only spatial coordinate mapping.
G4double xMin
Dimension parameter - protected for derived class access.
void ArrayCoordsFromXY(G4double &x, G4double &xArr, G4double &y, G4double &yArr) const
Utility version to forward to individual function.
virtual G4bool OutsideCoords(G4double x, G4double y, G4double z, G4double t) const
Whether the spatial coordinates lie outside the range of the array or not.
G4double yMin
Dimension parameter - protected for derived class access.
G4double XStep() const
The distance in spatial coordinates between any two points in the array.
G4double YFromArrayCoords(G4double yCoord) const
Return spatial value from a continuous array coordinate in one dimension.
virtual G4double ArrayCoordsFromX(G4double x) const
Not much point in being both virtual and inline (in our use case) but has to be virtual.
BDSFourVector< G4int > NearestXYZT(const BDSFourVector< G4double > &pos) const
Return the index of the nearest field value in space via four-vector.
G4double SmallestSpatialStep() const
G4double yStep
Dimension parameter - protected for derived class access.
BDSDimensionType ThirdDimension() const
Accessor for each dimension label. e.g. array 'x' = spatial z.
virtual std::ostream & Print(std::ostream &out) const
virtual G4int NearestY(G4double y) const
Not much point in being both virtual and inline (in our use case) but has to be virtual.
virtual G4double ArrayCoordsFromZ(G4double z) const
Not much point in being both virtual and inline (in our use case) but has to be virtual.
virtual G4int NearestX(G4double x) const
Not much point in being both virtual and inline (in our use case) but has to be virtual.
BDSDimensionType SecondDimension() const
Accessor for each dimension label. e.g. array 'x' = spatial z.
BDSFourVector< G4double > XYZTFromArrayCoords(G4double x, G4double y, G4double z, G4double t) const
virtual BDSExtent Extent() const
Return the SPATIAL (only) extent of this field without any offset. Ignores time.
virtual G4double ArrayCoordsFromY(G4double y) const
Not much point in being both virtual and inline (in our use case) but has to be virtual.
std::array< G4int, 4 > ArrayToSpatialDimensionIndices() const
Access all indices at once.
virtual G4double ArrayCoordsFromT(G4double t) const
Not much point in being both virtual and inline (in our use case) but has to be virtual.
G4double zMax
Dimension parameter - protected for derived class access.
virtual G4int NearestT(G4double t) const
Not much point in being both virtual and inline (in our use case) but has to be virtual.
virtual G4bool TimeVarying() const
G4double tMin
Dimension parameter - protected for derived class access.
friend std::ostream & operator<<(std::ostream &out, BDSArray4DCoords const &a)
Output stream.
BDSDimensionType FourthDimension() const
Accessor for each dimension label. e.g. array 'x' = spatial z.
G4double zMin
Dimension parameter - protected for derived class access.
BDSDimensionType xDimension
virtual G4int NearestZ(G4double z) const
Not much point in being both virtual and inline (in our use case) but has to be virtual.
G4double xStep
Dimension parameter - protected for derived class access.
virtual void OutsideCoordsWarn(G4double x, G4double y, G4double z, G4double t) const
virtual void ExtractSection2x2x2x2(G4double x, G4double y, G4double z, G4double t, BDSFieldValue(&localData)[2][2][2][2], G4double &xFrac, G4double &yFrac, G4double &zFrac, G4double &tFrac) const
Extract 2x2x2x2 points lying around coordinate x.
G4double YStep() const
The distance in spatial coordinates between any two points in the array.
G4int DimensionIndex(BDSDimensionType spatialDimension) const
G4double yMax
Dimension parameter - protected for derived class access.
G4double xMax
Dimension parameter - protected for derived class access.
virtual void ExtractSection4x4x4x4(G4double x, G4double y, G4double z, G4double t, BDSFieldValue(&localData)[4][4][4][4], G4double &xFrac, G4double &yFrac, G4double &zFrac, G4double &tFrac) const
Extract 4x4x4x4 points lying around coordinate x.
G4double TFromArrayCoords(G4double tCoord) const
Return spatial value from a continuous array coordinate in one dimension.
G4double tMax
Dimension parameter - protected for derived class access.
G4double zStep
Dimension parameter - protected for derived class access.
G4double TStep() const
The distance in spatial coordinates between any two points in the array.
void ArrayCoordsFromXYZ(G4double &x, G4double &xArr, G4double &y, G4double &yArr, G4double &z, G4double &zArr) const
Utility version to forward to individual function.
void ArrayCoordsFromXYZT(G4double &x, G4double &xArr, G4double &y, G4double &yArr, G4double &z, G4double &zArr, G4double &t, G4double &tArr) const
Utility version to forward to individual function.
BDSArray4DCoords()=delete
G4double ZFromArrayCoords(G4double zCoord) const
Return spatial value from a continuous array coordinate in one dimension.
G4double XFromArrayCoords(G4double xCoord) const
Return spatial value from a continuous array coordinate in one dimension.
G4double ZStep() const
The distance in spatial coordinates between any two points in the array.
BDSFourVector< G4int > NearestXYZT(G4double x, G4double y, G4double z, G4double t) const
Return the index of the nearest field value in space.
virtual BDSFieldValue ExtractNearest(G4double x, G4double y=0, G4double z=0, G4double t=0) const
Extract nearest field value from array.
BDSFourVector< G4double > ArrayCoordsFromXYZT(G4double x, G4double y, G4double z, G4double t) const
Convenience function to easily get array coords in all dimensions at once.
G4double tStep
Dimension parameter - protected for derived class access.
BDSDimensionType FirstDimension() const
Accessor for each dimension label. e.g. array 'x' = spatial z.
void BuildDimensionIndex()
Build up an array of ints based on the order of dimensions stored in the array.
4D array and base class for 3,2 & 1D arrays.
Holder for +- extents in 3 dimensions.
A simple templated four vector class.