BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSArray3DCoords.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSARRAY3DCOORDS_H
19#define BDSARRAY3DCOORDS_H
20
21#include "BDSArray4DCoords.hh"
22
23#include "G4Types.hh"
24
25#include <ostream>
26
37{
38public:
41 BDSArray3DCoords() = delete;
42
43 BDSArray3DCoords(G4int nX, G4int nY, G4int nZ,
44 G4double xMinIn, G4double xMaxIn,
45 G4double yMinIn, G4double yMaxIn,
46 G4double zMinIn, G4double zMaxIn,
47 BDSDimensionType xDimensionIn = BDSDimensionType::x,
48 BDSDimensionType yDimensionIn = BDSDimensionType::y,
49 BDSDimensionType zDimensionIn = BDSDimensionType::z);
50 virtual ~BDSArray3DCoords(){;}
51
53 virtual void ExtractSection2x2x2(G4double x,
54 G4double y,
55 G4double z,
56 BDSFieldValue (&localData)[2][2][2],
57 G4double& xFrac,
58 G4double& yFrac,
59 G4double& zFrac) const;
60
62 virtual void ExtractSection4x4x4(G4double x,
63 G4double y,
64 G4double z,
65 BDSFieldValue (&localData)[4][4][4],
66 G4double& xFrac,
67 G4double& yFrac,
68 G4double& zFrac) const;
69
71 virtual BDSFieldValue ExtractNearest(G4double x,
72 G4double y = 0,
73 G4double z = 0,
74 G4double t = 0) const;
75
77 friend std::ostream& operator<< (std::ostream& out, BDSArray3DCoords const &a);
78};
79
80#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.
const G4int nY
Dimension.
const G4int nX
Dimension.