BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSArray2DCoords.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 BDSARRAY2DCOORDS_H
20#define BDSARRAY2DCOORDS_H
21
22#include "BDSArray3DCoords.hh"
23#include "BDSDimensionType.hh"
24
25#include "G4Types.hh"
26
27#include <ostream>
28
29class BDSExtent;
30
38{
39public:
42 BDSArray2DCoords() = delete;
43
44 BDSArray2DCoords(G4int nX, G4int nY,
45 G4double xMinIn, G4double xMaxIn,
46 G4double yMinIn, G4double yMaxIn,
47 BDSDimensionType xDimensionIn = BDSDimensionType::x,
48 BDSDimensionType yDimensionIn = BDSDimensionType::y);
49 virtual ~BDSArray2DCoords(){;}
50
52 virtual void ExtractSection2x2(G4double x,
53 G4double y,
54 BDSFieldValue (&localData)[2][2],
55 G4double& xFrac,
56 G4double& yFrac) const;
57
59 virtual void ExtractSection4x4(G4double x,
60 G4double y,
61 BDSFieldValue (&localData)[4][4],
62 G4double& xFrac,
63 G4double& yFrac) const;
64
66 virtual BDSFieldValue ExtractNearest(G4double x,
67 G4double y = 0,
68 G4double z = 0,
69 G4double t = 0) const ;
70
72 friend std::ostream& operator<< (std::ostream& out, BDSArray2DCoords const &a);
73
77 virtual BDSExtent Extent() const;
78};
79
80#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.
Definition: BDSArray4D.hh:121
const G4int nX
Dimension.
Definition: BDSArray4D.hh:120
Holder for +- extents in 3 dimensions.
Definition: BDSExtent.hh:39