BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSInterpolator2D.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 BDSINTERPOLATOR2D_H
20#define BDSINTERPOLATOR2D_H
21#include "BDSArray2DCoords.hh"
22#include "BDSDimensionType.hh"
23#include "BDSExtent.hh"
24#include "BDSFieldValue.hh"
25#include "BDSInterpolator.hh"
26
27#include "G4Types.hh"
28#include "G4ThreeVector.hh"
29
39{
40public:
41 BDSInterpolator2D() = delete;
42 explicit BDSInterpolator2D(BDSArray2DCoords* arrayIn);
43 virtual ~BDSInterpolator2D(){;}
44
46 G4ThreeVector GetInterpolatedValue(G4double x, G4double y) const;
47
48 inline const BDSArray2DCoords* Array() const {return array;}
49
52
55
57 virtual BDSExtent Extent() const {return array->Extent();}
58
59protected:
63 virtual BDSFieldValue GetInterpolatedValueT(G4double x, G4double y) const = 0;
64
67};
68
69#endif
2D array with spatial mapping derived from BDSArray4DCoords.
virtual BDSExtent Extent() const
BDSDimensionType SecondDimension() const
Accessor for each dimension label. e.g. array 'x' = spatial z.
BDSDimensionType FirstDimension() const
Accessor for each dimension label. e.g. array 'x' = spatial z.
Holder for +- extents in 3 dimensions.
Definition: BDSExtent.hh:39
Interface for all 2D interpolators.
G4ThreeVector GetInterpolatedValue(G4double x, G4double y) const
Public interface to a 2D interpolator. Returns Geant4 type as that's what will be needed.
BDSDimensionType SecondDimension() const
Accessor for the active dimension this represents (second).
BDSDimensionType FirstDimension() const
Accessor for the active dimension this represents (first).
virtual BDSFieldValue GetInterpolatedValueT(G4double x, G4double y) const =0
virtual BDSExtent Extent() const
Extent of field.
BDSArray2DCoords * array
The field data.
Interface for all interpolators containing basic extent of validity.