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

Class that provides the magnetic strength in a quadrupole. More...

#include <BDSFieldMagMultipole.hh>

Inheritance diagram for BDSFieldMagMultipole:
Inheritance graph
Collaboration diagram for BDSFieldMagMultipole:
Collaboration graph

Public Member Functions

 BDSFieldMagMultipole (BDSMagnetStrength const *strength, G4double const brho, G4int const orderIn=12)
 
virtual G4ThreeVector GetField (const G4ThreeVector &position, const G4double t=0) const
 Access the field value. More...
 
- 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

 BDSFieldMagMultipole ()
 Private default constructor to force use of supplied constructor.
 

Private Attributes

G4int order
 Order up to which field components are considered. More...
 
G4int maximumNonZeroOrder
 
std::vector< G4double > normalComponents
 Normal field components (normal - ie not skew) = kn * brho. More...
 
std::vector< G4double > skewComponents
 Skew field components = kns * brho. More...
 

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

Class that provides the magnetic strength in a quadrupole.

The magnetic field is calculated from the strength parameters "kn" up to a specified order and a design rigidity (brho).

Definition at line 38 of file BDSFieldMagMultipole.hh.

Constructor & Destructor Documentation

◆ BDSFieldMagMultipole()

BDSFieldMagMultipole::BDSFieldMagMultipole ( BDSMagnetStrength const *  strength,
G4double const  brho,
G4int const  orderIn = 12 
)

Definition at line 30 of file BDSFieldMagMultipole.cc.

◆ ~BDSFieldMagMultipole()

virtual BDSFieldMagMultipole::~BDSFieldMagMultipole ( )
inlinevirtual

Definition at line 45 of file BDSFieldMagMultipole.hh.

Member Function Documentation

◆ GetField()

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

Access the field value.

Implements BDSFieldMag.

Definition at line 67 of file BDSFieldMagMultipole.cc.

References BDS::IsFiniteStrength(), maximumNonZeroOrder, normalComponents, and skewComponents.

Here is the call graph for this function:

Field Documentation

◆ maximumNonZeroOrder

G4int BDSFieldMagMultipole::maximumNonZeroOrder
private

Identify which is the maximum non-zero order in either normal or skew components and only sum up to this in the field calculation. Just an optimisation to save addition.

Definition at line 61 of file BDSFieldMagMultipole.hh.

Referenced by GetField().

◆ normalComponents

std::vector<G4double> BDSFieldMagMultipole::normalComponents
private

Normal field components (normal - ie not skew) = kn * brho.

Definition at line 64 of file BDSFieldMagMultipole.hh.

Referenced by GetField().

◆ order

G4int BDSFieldMagMultipole::order
private

Order up to which field components are considered.

Definition at line 56 of file BDSFieldMagMultipole.hh.

◆ skewComponents

std::vector<G4double> BDSFieldMagMultipole::skewComponents
private

Skew field components = kns * brho.

Definition at line 67 of file BDSFieldMagMultipole.hh.

Referenced by GetField().


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