BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSArray1DCoords.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 BDSARRAY1DCOORDS_H
19#define BDSARRAY1DCOORDS_H
20
21#include "BDSArray2DCoords.hh"
22#include "BDSDimensionType.hh"
23
24#include "G4Types.hh"
25
26#include <ostream>
27
28class BDSExtent;
29
37{
38public:
41 BDSArray1DCoords() = delete;
42 BDSArray1DCoords(G4int nX,
43 G4double xMinIn,
44 G4double xMaxIn,
45 BDSDimensionType dimensionIn = BDSDimensionType::x);
46 virtual ~BDSArray1DCoords(){;}
47
49 virtual void ExtractSection2(G4double x,
50 BDSFieldValue (&localData)[2],
51 G4double& xFrac) const;
52
54 virtual void ExtractSection4(G4double x,
55 BDSFieldValue (&localData)[4],
56 G4double& xFrac) const;
57
59 virtual BDSFieldValue ExtractNearest(G4double x,
60 G4double y = 0,
61 G4double z = 0,
62 G4double t = 0) const;
63
65 friend std::ostream& operator<< (std::ostream& out, BDSArray1DCoords const &a);
66
70 virtual BDSExtent Extent() const;
71};
72
73#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.
Holder for +- extents in 3 dimensions.
Definition BDSExtent.hh:38