BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes
BDSFieldMagSkew Class Reference

A wrapper class for BDSFieldMag that rotates it. More...

#include <BDSFieldMagSkew.hh>

Inheritance diagram for BDSFieldMagSkew:
Inheritance graph
Collaboration diagram for BDSFieldMagSkew:
Collaboration graph

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.
 
- Public Member Functions inherited from BDSFieldMag
 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

- Protected Attributes inherited from BDSFieldMag
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.
 
BDSModulatormodulator
 Optional modulator;.
 

Detailed Description

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.

Author
Laurie Nevay

Definition at line 41 of file BDSFieldMagSkew.hh.

Constructor & Destructor Documentation

◆ BDSFieldMagSkew()

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.

Here is the call graph for this function:

◆ ~BDSFieldMagSkew()

BDSFieldMagSkew::~BDSFieldMagSkew ( )
virtual

Definition at line 36 of file BDSFieldMagSkew.cc.

Member Function Documentation

◆ GetField()

G4ThreeVector BDSFieldMagSkew::GetField ( const G4ThreeVector &  position,
const G4double  t = 0 
) const
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.

Here is the call graph for this function:

Field Documentation

◆ antiRotation

G4RotationMatrix* BDSFieldMagSkew::antiRotation
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().

◆ field

BDSFieldMag* const BDSFieldMagSkew::field
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().

◆ rotation

G4RotationMatrix* BDSFieldMagSkew::rotation
private

The rotation matrix used to rotate the coordinates.

Definition at line 62 of file BDSFieldMagSkew.hh.

Referenced by BDSFieldMagSkew(), and GetField().


The documentation for this class was generated from the following files: