BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Private Member Functions | Private Attributes
BDSFieldMagDipole Class Reference

A uniform dipole field. More...

#include <BDSFieldMagDipole.hh>

Inheritance diagram for BDSFieldMagDipole:
Inheritance graph
Collaboration diagram for BDSFieldMagDipole:
Collaboration graph

Public Member Functions

 BDSFieldMagDipole (const G4ThreeVector &field)
 Initialise with field of correct magnitude and direction. More...
 
 BDSFieldMagDipole (const BDSMagnetStrength *strength)
 
virtual G4ThreeVector GetField (const G4ThreeVector &position, const G4double t=0) const
 Access the field value. More...
 
G4ThreeVector FieldValue () const
 
- Public Member Functions inherited from BDSFieldMag
 BDSFieldMag ()
 
 BDSFieldMag (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...
 

Private Member Functions

 BDSFieldMagDipole ()
 Private default constructor to ensure use of supplied constructor.
 

Private Attributes

G4ThreeVector localField
 

Additional Inherited Members

- Protected Attributes inherited from BDSFieldMag
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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ BDSFieldMagDipole() [1/2]

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.

Here is the call graph for this function:

◆ BDSFieldMagDipole() [2/2]

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.

Here is the call graph for this function:

◆ ~BDSFieldMagDipole()

virtual BDSFieldMagDipole::~BDSFieldMagDipole ( )
inlinevirtual

Definition at line 50 of file BDSFieldMagDipole.hh.

Member Function Documentation

◆ FieldValue()

G4ThreeVector BDSFieldMagDipole::FieldValue ( ) const
inline

Definition at line 56 of file BDSFieldMagDipole.hh.

◆ GetField()

G4ThreeVector BDSFieldMagDipole::GetField ( const G4ThreeVector &  position,
const G4double  t = 0 
) const
virtual

Access the field value.

Implements BDSFieldMag.

Definition at line 54 of file BDSFieldMagDipole.cc.

References localField.

Field Documentation

◆ localField

G4ThreeVector BDSFieldMagDipole::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().


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