BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
A wrapper class for BDSFieldMag that rotates it. More...
#include <BDSFieldMagSkew.hh>
Public Member Functions | |
BDSFieldMagSkew (BDSFieldMag *fieldIn, G4double angle=0) | |
Wrap a field and rotate it by angle (rad) in the x-y plane (about z axis). | |
virtual G4ThreeVector | GetField (const G4ThreeVector &position, const G4double t=0) const |
Get the field - local coordinates, and rotated. | |
![]() | |
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 | |
BDSFieldMagSkew ()=delete | |
Private default constructor to force use of supplied ones. | |
Private Attributes | |
BDSFieldMag *const | field |
G4RotationMatrix * | rotation |
The rotation matrix used to rotate the coordinates. | |
G4RotationMatrix * | antiRotation |
The opposite rotation matrix used to transform the resultant field vector. | |
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 wrapper class for BDSFieldMag that rotates it.
This is a wrapper class for a BDSFieldMag instance that rotates it by applying a rotation to the coordinates before querying the wrapped field object. This is intended to implement skew fields but any arbritary rotation can be applied, although this should be considered carefully.
This class does not own the field it wraps.
Definition at line 41 of file BDSFieldMagSkew.hh.
BDSFieldMagSkew::BDSFieldMagSkew | ( | BDSFieldMag * | fieldIn, |
G4double | angle = 0 |
||
) |
Wrap a field and rotate it by angle (rad) in the x-y plane (about z axis).
Definition at line 24 of file BDSFieldMagSkew.cc.
References antiRotation, field, BDSFieldMag::FiniteStrength(), BDSFieldMag::finiteStrength, and rotation.
|
virtual |
Definition at line 36 of file BDSFieldMagSkew.cc.
|
virtual |
Get the field - local coordinates, and rotated.
Implements BDSFieldMag.
Definition at line 42 of file BDSFieldMagSkew.cc.
References antiRotation, field, BDSFieldMag::GetField(), and rotation.
|
private |
The opposite rotation matrix used to transform the resultant field vector.
Definition at line 65 of file BDSFieldMagSkew.hh.
Referenced by BDSFieldMagSkew(), and GetField().
|
private |
The nominal non-skewed field. Just storage of a pointer to it. This class doesn't own it.
Definition at line 59 of file BDSFieldMagSkew.hh.
Referenced by BDSFieldMagSkew(), and GetField().
|
private |
The rotation matrix used to rotate the coordinates.
Definition at line 62 of file BDSFieldMagSkew.hh.
Referenced by BDSFieldMagSkew(), and GetField().