BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSArray2DCoordsRQuad.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 BDSARRAY2DCOORDSRQUAD_H
20#define BDSARRAY2DCOORDSRQUAD_H
21
22#include "BDSArray2DCoords.hh"
23#include "BDSFieldValue.hh"
24
25#include "G4Types.hh"
26
27#include <ostream>
28
66{
67public:
68 BDSArray2DCoordsRQuad() = delete;
70 explicit BDSArray2DCoordsRQuad(BDSArray2DCoords* arrayIn);
71 virtual ~BDSArray2DCoordsRQuad(){;}
72
74 virtual G4bool OutsideCoords(G4double x,
75 G4double y,
76 G4double z,
77 G4double t) const;
78
79 virtual G4double ArrayCoordsFromX(G4double x) const;
80 virtual G4double ArrayCoordsFromY(G4double y) const;
81
82 virtual G4int NearestX(G4double x) const;
83 virtual G4int NearestY(G4double y) const;
85
87 virtual const BDSFieldValue& GetConst(G4int x,
88 G4int y,
89 G4int z = 0,
90 G4int t = 0) const;
91
92 virtual G4bool Outside(G4int x,
93 G4int y,
94 G4int z,
95 G4int t) const;
97
100 virtual std::ostream& Print(std::ostream& out) const;
101
103 friend std::ostream& operator<< (std::ostream& out, BDSArray2DCoordsRQuad const &a);
104
105private:
109};
110
111#endif
A wrapper to achieve 2D reflection of a minimal quadrupole field solve.
virtual G4int NearestX(G4double x) const
Overridden from BDSArray4DCoords.
virtual G4int NearestY(G4double y) const
Overridden from BDSArray4DCoords.
virtual G4double ArrayCoordsFromY(G4double y) const
Overridden from BDSArray4DCoords.
virtual const BDSFieldValue & GetConst(G4int x, G4int y, G4int z=0, G4int t=0) const
Overridden from BDSArray4D.
virtual G4double ArrayCoordsFromX(G4double x) const
Overridden from BDSArray4DCoords.
virtual G4bool Outside(G4int x, G4int y, G4int z, G4int t) const
Overridden from BDSArray4D.
virtual G4bool OutsideCoords(G4double x, G4double y, G4double z, G4double t) const
Overridden from BDSArray4DCoords.
friend std::ostream & operator<<(std::ostream &out, BDSArray2DCoordsRQuad const &a)
Delegate function to call polymorphic Print().
virtual std::ostream & Print(std::ostream &out) const
2D array with spatial mapping derived from BDSArray4DCoords.