BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
A uniform dipole field. More...
#include <BDSFieldMagDipole.hh>
Public Member Functions | |
BDSFieldMagDipole (const G4ThreeVector &field) | |
Initialise with field of correct magnitude and direction. | |
BDSFieldMagDipole (const BDSMagnetStrength *strength) | |
virtual G4ThreeVector | GetField (const G4ThreeVector &position, const G4double t=0) const |
Access the field value. | |
G4ThreeVector | FieldValue () const |
![]() | |
BDSFieldMag () | |
BDSFieldMag (G4Transform3D transformIn) | |
virtual G4ThreeVector | GetField (const G4ThreeVector &position, const G4double t=0) const =0 |
virtual G4bool | TimeVarying () const |
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. | |
virtual void | SetTransform (const G4Transform3D &transformIn) |
void | SetModulator (BDSModulator *modulatorIn) |
Set the optional modulator. | |
G4bool | FiniteStrength () const |
Accessor. | |
Private Member Functions | |
BDSFieldMagDipole () | |
Private default constructor to ensure use of supplied constructor. | |
Private Attributes | |
G4ThreeVector | localField |
Additional Inherited Members | |
![]() | |
G4bool | finiteStrength |
Flag to cache whether finite nor not. | |
G4Transform3D | transform |
Transform to apply for the field relative to the local coordinates of the geometry. | |
G4bool | transformIsNotIdentity |
Cache of whether to use transform at all. | |
BDSModulator * | modulator |
Optional modulator;. | |
A uniform dipole field.
This class represents a uniform dipole field. This may optionally be constructed with a unit vector to denote a different direction. This uses the parameters "angle" and "length" (the magnetic field length) from the input BDSMagnetStrength instance. MADX uses angle rather than k0, so we follow that convention.
Definition at line 39 of file BDSFieldMagDipole.hh.
BDSFieldMagDipole::BDSFieldMagDipole | ( | const G4ThreeVector & | field | ) |
Initialise with field of correct magnitude and direction.
Definition at line 27 of file BDSFieldMagDipole.cc.
References BDSFieldMag::finiteStrength, BDS::IsFinite(), and localField.
BDSFieldMagDipole::BDSFieldMagDipole | ( | const BDSMagnetStrength * | strength | ) |
This constructor uses bx, by and bz from the strength to form a unit vector, however if these are all 0 and 'field' is finite (in strength), then a field along unit y with strength 'field' is provided.
Definition at line 36 of file BDSFieldMagDipole.cc.
References BDSFieldMag::finiteStrength, BDS::IsFinite(), and localField.
|
inlinevirtual |
Definition at line 50 of file BDSFieldMagDipole.hh.
|
inline |
Definition at line 56 of file BDSFieldMagDipole.hh.
|
virtual |
Access the field value.
Implements BDSFieldMag.
Definition at line 54 of file BDSFieldMagDipole.cc.
References localField.
|
private |
The vector of the field. This constructed in local coordinates and the first time the field is queried, the auxiliary navigator (through inheritance) is used to transform the vector to global coordinates.
Definition at line 65 of file BDSFieldMagDipole.hh.
Referenced by BDSFieldMagDipole(), and GetField().