BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSArray1DCoordsTransformed.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 BDSARRAY1DCOORDSTRANSFORMED_H
20#define BDSARRAY1DCOORDSTRANSFORMED_H
21
22#include "BDSArray1DCoords.hh"
23#include "BDSDimensionType.hh"
24#include "BDSFieldValue.hh"
25
26#include "G4Types.hh"
27
28#include <ostream>
29
32
46{
47public:
52 BDSArrayOperatorIndex* indexOperatorIn,
53 BDSArrayOperatorValue* valueOperatorIn);
55
58 virtual void ExtractSection2(G4double x,
59 BDSFieldValue (&localData)[2],
60 G4double& xFrac) const;
61
64 virtual void ExtractSection4(G4double x,
65 BDSFieldValue (&localData)[4],
66 G4double& xFrac) const;
67
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, BDSArray1DCoordsTransformed const &a);
78
79private:
80 BDSArrayOperatorIndex* indexOperator;
81 BDSArrayOperatorValue* valueOperator;
82
86};
87
88#endif
Wrapped BDSArray1DCoords with possible transformation to extend field.
friend std::ostream & operator<<(std::ostream &out, BDSArray1DCoordsTransformed const &a)
Delegate function to call polymorphic Print().
virtual std::ostream & Print(std::ostream &out) const
virtual void ExtractSection2(G4double x, BDSFieldValue(&localData)[2], G4double &xFrac) const
virtual void ExtractSection4(G4double x, BDSFieldValue(&localData)[4], G4double &xFrac) const
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.
BDSArray1DCoordsTransformed()=delete
No default constructor.
1D array with spatial mapping derived from BDSArray4DCoords.
Interface for modifying by reference array indices.
Interface for modifying field values.