BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSArray1DCoords.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 BDSARRAY1DCOORDS_H
20#define BDSARRAY1DCOORDS_H
21
22#include "BDSArray2DCoords.hh"
23#include "BDSDimensionType.hh"
24
25#include "G4Types.hh"
26
27#include <ostream>
28
29class BDSExtent;
30
38{
39public:
42 BDSArray1DCoords() = delete;
43 BDSArray1DCoords(G4int nX,
44 G4double xMinIn,
45 G4double xMaxIn,
46 BDSDimensionType dimensionIn = BDSDimensionType::x);
47 virtual ~BDSArray1DCoords(){;}
48
50 virtual void ExtractSection2(G4double x,
51 BDSFieldValue (&localData)[2],
52 G4double& xFrac) const;
53
55 virtual void ExtractSection4(G4double x,
56 BDSFieldValue (&localData)[4],
57 G4double& xFrac) const;
58
60 virtual BDSFieldValue ExtractNearest(G4double x,
61 G4double y = 0,
62 G4double z = 0,
63 G4double t = 0) const;
64
66 friend std::ostream& operator<< (std::ostream& out, BDSArray1DCoords const &a);
67
71 virtual BDSExtent Extent() const;
72};
73
74#endif
1D array with spatial mapping derived from BDSArray4DCoords.
BDSArray1DCoords()=delete
virtual void ExtractSection4(G4double x, BDSFieldValue(&localData)[4], G4double &xFrac) const
Extract 4 points lying around coordinate x, where x will be between points 2 and 3.
virtual void ExtractSection2(G4double x, BDSFieldValue(&localData)[2], G4double &xFrac) const
Extract 2 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. y,z,t ignored but required for overload.
virtual BDSExtent Extent() const
friend std::ostream & operator<<(std::ostream &out, BDSArray1DCoords const &a)
Output stream.
2D array with spatial mapping derived from BDSArray4DCoords.
const G4int nX
Dimension.
Definition: BDSArray4D.hh:120
Holder for +- extents in 3 dimensions.
Definition: BDSExtent.hh:39