BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSArray2DCoordsTransformed.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 BDSARRAY2DCOORDSTRANSFORMED_H
20#define BDSARRAY2DCOORDSTRANSFORMED_H
21
22#include "BDSArray2DCoords.hh"
23#include "BDSDimensionType.hh"
24#include "BDSFieldValue.hh"
25
26#include "G4Types.hh"
27
28#include <ostream>
29
32class BDSExtent;
33
43{
44public:
49 BDSArrayOperatorIndex* indexOperatorIn,
50 BDSArrayOperatorValue* valueOperatorIn);
52
55 virtual void ExtractSection2x2(G4double x,
56 G4double y,
57 BDSFieldValue (&localData)[2][2],
58 G4double& xFrac,
59 G4double& yFrac) const;
60
63 virtual void ExtractSection4x4(G4double x,
64 G4double y,
65 BDSFieldValue (&localData)[4][4],
66 G4double& xFrac,
67 G4double& yFrac) const;
68
69 virtual BDSFieldValue ExtractNearest(G4double x,
70 G4double y = 0,
71 G4double z = 0,
72 G4double t = 0) const;
73
74 virtual std::ostream& Print(std::ostream& out) const;
75
77 friend std::ostream& operator<< (std::ostream& out, BDSArray2DCoordsTransformed const &a);
78
79private:
80 BDSArrayOperatorIndex* indexOperator;
81 BDSArrayOperatorValue* valueOperator;
82
86};
87
88#endif
Wrapped BDSArray2DCoords with possible transformation to extend field.
virtual std::ostream & Print(std::ostream &out) const
BDSArray2DCoordsTransformed()=delete
No default constructor.
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.
friend std::ostream & operator<<(std::ostream &out, BDSArray2DCoordsTransformed const &a)
Delegate function to call polymorphic Print().
virtual void ExtractSection2x2(G4double x, G4double y, BDSFieldValue(&localData)[2][2], G4double &xFrac, G4double &yFrac) const
virtual void ExtractSection4x4(G4double x, G4double y, BDSFieldValue(&localData)[4][4], G4double &xFrac, G4double &yFrac) const
2D array with spatial mapping derived from BDSArray4DCoords.
Interface for modifying by reference array indices.
Interface for modifying field values.
Holder for +- extents in 3 dimensions.
Definition: BDSExtent.hh:39