BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Interface for BDSIM electric fields that may or may not be local. More...
#include <BDSFieldE.hh>
Public Member Functions | |
BDSFieldE () | |
BDSFieldE (G4Transform3D transformIn) | |
virtual G4ThreeVector | GetField (const G4ThreeVector &position, const G4double t=0) const =0 |
virtual void | GetFieldValue (const G4double point[4], G4double *field) const |
virtual G4ThreeVector | GetFieldTransformed (const G4ThreeVector &position, const G4double t) const |
Get the field value after applying transform for local offset. More... | |
virtual void | SetTransform (const G4Transform3D &transformIn) |
G4bool | FiniteStrength () const |
Accessor. More... | |
Protected Attributes | |
G4bool | finiteStrength |
Flag to cache whether finite nor not. More... | |
G4Transform3D | transform |
Transform to apply for the field relative to the local coordinates of the geometry. More... | |
Private Attributes | |
G4Transform3D | inverseTransform |
The complimentary transform used to initially rotate the point of query. More... | |
Interface for BDSIM electric fields that may or may not be local.
Defines abstract interface for all derived electric fields. More common to use G4ThreeVectors than arrays so provides common functionality.
Definition at line 36 of file BDSFieldE.hh.
BDSFieldE::BDSFieldE | ( | ) |
Constructor takes transform in, which is inverted and applied to positions before querying the 'pure' derived field object. This allows local offset, translations, reflections and scalings to be applied if required - ie for misalignment from the local coordinates.
Definition at line 25 of file BDSFieldE.cc.
|
explicit |
Definition at line 31 of file BDSFieldE.cc.
|
inlinevirtual |
Definition at line 45 of file BDSFieldE.hh.
|
inline |
|
pure virtual |
Get the electric field vector in local coordinates. The derived class does not need to apply the transform.
Implemented in BDSFieldEZero, BDSFieldEGlobal, BDSFieldEGlobalPlacement, BDSFieldEInterpolated4D, BDSFieldESinusoid, BDSFieldEInterpolated1D, BDSFieldEInterpolated2D, BDSFieldEInterpolated2Layer, and BDSFieldEInterpolated3D.
Referenced by GetFieldTransformed().
|
virtual |
Get the field value after applying transform for local offset.
Reimplemented in BDSFieldEGlobal, and BDSFieldEGlobalPlacement.
Definition at line 37 of file BDSFieldE.cc.
References finiteStrength, GetField(), inverseTransform, and transform.
Referenced by BDSFieldEGlobal::GetField(), BDSFieldEGlobalPlacement::GetField(), BDSFieldEInterpolated2Layer::GetField(), and GetFieldValue().
|
virtual |
Implement interface to this class's GetField to fulfill G4ElectricField inheritance and allow a BDSFieldE instance to be passed around in the field factory even if it's not wrapped in a BDSFieldGlobal instance and is in fact in local coordinates. This uses GetFieldTransformed.
Definition at line 53 of file BDSFieldE.cc.
References GetFieldTransformed().
|
virtual |
Set the transform applied before evaluating the field. This can be used to account for any difference between the field coordinate system and the coordinate system of the geometry. Ie an offset aperture. This is a public interface to allow the transform to be set after construction so that derived classes don't need modified constructors.
Definition at line 66 of file BDSFieldE.cc.
References inverseTransform, and transform.
Referenced by BDSFieldFactory::CreateFieldERaw().
|
protected |
Flag to cache whether finite nor not.
Definition at line 74 of file BDSFieldE.hh.
Referenced by BDSFieldESinusoid::BDSFieldESinusoid(), FiniteStrength(), GetFieldTransformed(), BDSFieldEGlobal::GetFieldTransformed(), and BDSFieldEGlobalPlacement::GetFieldTransformed().
|
private |
The complimentary transform used to initially rotate the point of query.
Definition at line 82 of file BDSFieldE.hh.
Referenced by GetFieldTransformed(), and SetTransform().
|
protected |
Transform to apply for the field relative to the local coordinates of the geometry.
Definition at line 77 of file BDSFieldE.hh.
Referenced by BDSFieldEInterpolated::Extent(), GetFieldTransformed(), and SetTransform().