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
BDSFieldMagSolenoidLoop Class Reference

Class that provides the magnetic field due to a cylinder of current. More...

#include <BDSFieldMagSolenoidLoop.hh>

Inheritance diagram for BDSFieldMagSolenoidLoop:
Inheritance graph
Collaboration diagram for BDSFieldMagSolenoidLoop:
Collaboration graph

Public Member Functions

 BDSFieldMagSolenoidLoop (G4double strength, G4bool strengthIsCurrent, G4double radiusIn)
 Explicit constructor. Strength can be either I or B0 as specified by 'strengthIsCurrent'.
 
 BDSFieldMagSolenoidLoop (BDSMagnetStrength const *strength, G4double radiusIn)
 
virtual G4ThreeVector GetField (const G4ThreeVector &position, const G4double t=0) const
 Calculate the field value.
 
G4double GetB0 () const
 Accessor.
 
G4double GetI () const
 Accessor.
 
- Public Member Functions inherited from BDSFieldMag
 BDSFieldMag ()
 
 BDSFieldMag (G4Transform3D transformIn)
 
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

G4double OnAxisBz (G4double zp, G4double zm) const
 

Private Attributes

G4double a
 
G4double B0
 
G4double I
 
G4double spatialLimit
 
G4double mu0OverPiTimesITimesA
 

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

Class that provides the magnetic field due to a cylinder of current.

This follows the parameterisation and uses the algorithm for the generalised complete elliptical integral as described in:

Cylindrical Magnets and ideal Solenoids, N. Derby and S. Olbert, American Journal of Physics 78, 229 (2010); https://doi.org/10.1119/1.3256157 and also at https://arxiv.org/abs/0909.3880.

The field is calculated in cylindrical coordinates. A complete description is in the manual.

The strength is effectively stored in the member variable mu0OverPiTimesITimesA, but I and B0 are accessible for inspection.

Author
Laurie Nevay

Definition at line 47 of file BDSFieldMagSolenoidLoop.hh.

Constructor & Destructor Documentation

◆ BDSFieldMagSolenoidLoop() [1/2]

BDSFieldMagSolenoidLoop::BDSFieldMagSolenoidLoop ( G4double  strength,
G4bool  strengthIsCurrent,
G4double  radiusIn 
)

Explicit constructor. Strength can be either I or B0 as specified by 'strengthIsCurrent'.

Definition at line 37 of file BDSFieldMagSolenoidLoop.cc.

References BDSFieldMag::finiteStrength, and BDS::IsFinite().

Here is the call graph for this function:

◆ BDSFieldMagSolenoidLoop() [2/2]

BDSFieldMagSolenoidLoop::BDSFieldMagSolenoidLoop ( BDSMagnetStrength const *  strength,
G4double  radiusIn 
)

Alternative constructor for field factory that uses "field" (i.e. B) strength from the magnet strength instance.

Definition at line 32 of file BDSFieldMagSolenoidLoop.cc.

◆ ~BDSFieldMagSolenoidLoop()

virtual BDSFieldMagSolenoidLoop::~BDSFieldMagSolenoidLoop ( )
inlinevirtual

Definition at line 60 of file BDSFieldMagSolenoidLoop.hh.

Member Function Documentation

◆ GetB0()

G4double BDSFieldMagSolenoidLoop::GetB0 ( ) const
inline

Accessor.

Definition at line 67 of file BDSFieldMagSolenoidLoop.hh.

◆ GetField()

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

Calculate the field value.

Implements BDSFieldMag.

Definition at line 64 of file BDSFieldMagSolenoidLoop.cc.

References BDS::CEL().

Here is the call graph for this function:

◆ GetI()

G4double BDSFieldMagSolenoidLoop::GetI ( ) const
inline

Accessor.

Definition at line 68 of file BDSFieldMagSolenoidLoop.hh.

◆ OnAxisBz()

G4double BDSFieldMagSolenoidLoop::OnAxisBz ( G4double  zp,
G4double  zm 
) const
private

Approximation for rho=0 Bz field. Brho=0 by definition. zp and zm are z+halfLength and z-halfLength. Returns Bz.

Field Documentation

◆ a

G4double BDSFieldMagSolenoidLoop::a
private

Definition at line 76 of file BDSFieldMagSolenoidLoop.hh.

◆ B0

G4double BDSFieldMagSolenoidLoop::B0
private

Definition at line 77 of file BDSFieldMagSolenoidLoop.hh.

◆ I

G4double BDSFieldMagSolenoidLoop::I
private

Definition at line 78 of file BDSFieldMagSolenoidLoop.hh.

◆ mu0OverPiTimesITimesA

G4double BDSFieldMagSolenoidLoop::mu0OverPiTimesITimesA
private

Definition at line 80 of file BDSFieldMagSolenoidLoop.hh.

◆ spatialLimit

G4double BDSFieldMagSolenoidLoop::spatialLimit
private

Definition at line 79 of file BDSFieldMagSolenoidLoop.hh.


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