BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSArray2DCoords.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 BDSARRAY2DCOORDS_H
19#define BDSARRAY2DCOORDS_H
20
21#include "BDSArray3DCoords.hh"
22#include "BDSDimensionType.hh"
23
24#include "G4Types.hh"
25
26#include <ostream>
27
28class BDSExtent;
29
37{
38public:
41 BDSArray2DCoords() = delete;
42
43 BDSArray2DCoords(G4int nX, G4int nY,
44 G4double xMinIn, G4double xMaxIn,
45 G4double yMinIn, G4double yMaxIn,
46 BDSDimensionType xDimensionIn = BDSDimensionType::x,
47 BDSDimensionType yDimensionIn = BDSDimensionType::y);
48 virtual ~BDSArray2DCoords(){;}
49
51 virtual void ExtractSection2x2(G4double x,
52 G4double y,
53 BDSFieldValue (&localData)[2][2],
54 G4double& xFrac,
55 G4double& yFrac) const;
56
58 virtual void ExtractSection4x4(G4double x,
59 G4double y,
60 BDSFieldValue (&localData)[4][4],
61 G4double& xFrac,
62 G4double& yFrac) const;
63
65 virtual BDSFieldValue ExtractNearest(G4double x,
66 G4double y = 0,
67 G4double z = 0,
68 G4double t = 0) const ;
69
71 friend std::ostream& operator<< (std::ostream& out, BDSArray2DCoords const &a);
72
76 virtual BDSExtent Extent() const;
77};
78
79#endif
2D array with spatial mapping derived from BDSArray4DCoords.
virtual void ExtractSection4x4(G4double x, G4double y, BDSFieldValue(&localData)[4][4], G4double &xFrac, G4double &yFrac) const
Extract 4x4 points lying around coordinate x.
virtual BDSExtent Extent() const
virtual BDSFieldValue ExtractNearest(G4double x, G4double y=0, G4double z=0, G4double t=0) const
Extract nearest field value from array. z,t ignored but required for overload.
BDSArray2DCoords()=delete
friend std::ostream & operator<<(std::ostream &out, BDSArray2DCoords const &a)
Output stream.
virtual void ExtractSection2x2(G4double x, G4double y, BDSFieldValue(&localData)[2][2], G4double &xFrac, G4double &yFrac) const
Extract 2x2 points lying around coordinate x.
3D array with spatial mapping derived from BDSArray4DCoords.
const G4int nY
Dimension.
const G4int nX
Dimension.
Holder for +- extents in 3 dimensions.
Definition BDSExtent.hh:38