BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSArray3DCoords.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BDSARRAY3DCOORDS_H
20#define BDSARRAY3DCOORDS_H
21
22#include "BDSArray4DCoords.hh"
23
24#include "G4Types.hh"
25
26#include <ostream>
27
38{
39public:
42 BDSArray3DCoords() = delete;
43
44 BDSArray3DCoords(G4int nX, G4int nY, G4int nZ,
45 G4double xMinIn, G4double xMaxIn,
46 G4double yMinIn, G4double yMaxIn,
47 G4double zMinIn, G4double zMaxIn,
48 BDSDimensionType xDimensionIn = BDSDimensionType::x,
49 BDSDimensionType yDimensionIn = BDSDimensionType::y,
50 BDSDimensionType zDimensionIn = BDSDimensionType::z);
51 virtual ~BDSArray3DCoords(){;}
52
54 virtual void ExtractSection2x2x2(G4double x,
55 G4double y,
56 G4double z,
57 BDSFieldValue (&localData)[2][2][2],
58 G4double& xFrac,
59 G4double& yFrac,
60 G4double& zFrac) const;
61
63 virtual void ExtractSection4x4x4(G4double x,
64 G4double y,
65 G4double z,
66 BDSFieldValue (&localData)[4][4][4],
67 G4double& xFrac,
68 G4double& yFrac,
69 G4double& zFrac) const;
70
72 virtual BDSFieldValue ExtractNearest(G4double x,
73 G4double y = 0,
74 G4double z = 0,
75 G4double t = 0) const;
76
78 friend std::ostream& operator<< (std::ostream& out, BDSArray3DCoords const &a);
79};
80
81#endif
3D array with spatial mapping derived from BDSArray4DCoords.
BDSArray3DCoords()=delete
friend std::ostream & operator<<(std::ostream &out, BDSArray3DCoords const &a)
Output stream.
virtual void ExtractSection2x2x2(G4double x, G4double y, G4double z, BDSFieldValue(&localData)[2][2][2], G4double &xFrac, G4double &yFrac, G4double &zFrac) const
Extract 2x2x2 points lying around coordinate x.
virtual void ExtractSection4x4x4(G4double x, G4double y, G4double z, BDSFieldValue(&localData)[4][4][4], G4double &xFrac, G4double &yFrac, G4double &zFrac) const
Extract 4x4x4 points lying around coordinate x.
virtual BDSFieldValue ExtractNearest(G4double x, G4double y=0, G4double z=0, G4double t=0) const
Extract nearest field value from array. t ignored but required for overload.
Overlay of 4D array that provides uniform only spatial coordinate mapping.
const G4int nZ
Dimension.
Definition: BDSArray4D.hh:122
const G4int nY
Dimension.
Definition: BDSArray4D.hh:121
const G4int nX
Dimension.
Definition: BDSArray4D.hh:120