BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSFieldMagInterpolated.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 BDSFIELDMAGINTERPOLATED_H
19#define BDSFIELDMAGINTERPOLATED_H
20#include "BDSExtent.hh"
21#include "BDSFieldMag.hh"
22
23#include "G4Transform3D.hh"
24#include "G4Types.hh"
25
26class BDSInterpolator;
27
35{
36public:
37 BDSFieldMagInterpolated() = delete;
38 BDSFieldMagInterpolated(const BDSInterpolator* interpolator,
39 const G4Transform3D& offset,
40 G4double scalingIn = 1.0);
41
42 virtual ~BDSFieldMagInterpolated(){;}
43
44 virtual G4bool TimeVarying() const {return timeVarying;}
45
46 inline G4double Scaling() const {return scaling;}
47 inline void SetScaling(G4double scalingIn) {scaling = scalingIn;}
48
50 inline BDSExtent ExtentNoOffset() const {return extentNoOffset;}
51
53 inline BDSExtent Extent() const {return extentNoOffset.Translate(transform.getTranslation());}
54
55 inline G4double SmallestSpatialStep() const {return smallestSpatialStep;}
56
57protected:
58 G4bool timeVarying;
59
60private:
61 G4double scaling;
63 G4double smallestSpatialStep;
64};
65
66#endif
Holder for +- extents in 3 dimensions.
Definition BDSExtent.hh:38
BDSExtent Translate(const G4ThreeVector &offset) const
Provide a new copy of this extent with an offset applied.
Definition BDSExtent.hh:124
Class to provide scaling and a base class pointer for interpolator fields.
BDSExtent Extent() const
For now, we will ignore any rotation of the transform. TODO.
virtual G4bool TimeVarying() const
BDSExtent extentNoOffset
Extent without offset.
BDSExtent ExtentNoOffset() const
Extent of field without any offset (ie in its own coordinate frame).
G4double scaling
Field value scaling.
Interface for static magnetic fields that may or may not be local.
G4Transform3D transform
Transform to apply for the field relative to the local coordinates of the geometry.
Interface for all interpolators containing basic extent of validity.