Class SolenoidBField

Class Documentation

class Acts::SolenoidBField

Implements a multi-coil solenoid magnetic field.

On every call, the field is evaluated at that exact position. The field has radially symmetry, the field vectors point in +z direction. The config exposes a target field value in the center. This value is used to empirically determine a scale factor which reproduces this field value in the center.

E_1(k^2) = complete elliptic integral of the 1st kind E_2(k^2) = complete elliptic integral of the 2nd kind

E_1(k^2) and E_2(k^2) are usually indicated as K(k^2) and E(k^2) in literature, respectively _ 2 / pi / 2 2 2 - 1 / 2 E (k ) = | ( 1 - k sin {theta} ) dtheta 1 _/ 0

        _          ____________________
2 / pi / 2| / 2 2 E (k ) = | |/ 1 - k sin {theta} dtheta 2 _/ 0

k^2 = is a function of the point (r, z) and of the radius of the coil R

2 4Rr k = ———— 2 2 (R + r) + z Using these, you can evaluate the two components B_r and B_z of the magnetic field: _ _ mu I | / 2 \ | 0 kz | |2 - k | 2 2 | B (r, z) = – — | |—-|E (k ) - E (k ) | r 4pi ___ | | 2| 2 1 | | / 3 |_ \2 - 2k / _| |/ Rr

 _                                       _
mu I | / 2 \ | 0 k | | (R + r)k - 2r | 2 2 | B (r,z) = – - | | ———– | E (k ) + E (k ) | z 4pi __ | | 2 | 2 1 | |/Rr |_ \ 2r(1 - k ) / _|

Public Functions

SolenoidBField(Config config)

the constructur with a shared pointer

Note

since it is a shared field, we enforce it to be const

Template Parameters
  • bField: is the shared BField to be stored

Vector3D getField(const Vector3D &position) const

retrieve magnetic field value

Return

magnetic field vector at given position

Parameters
  • [in] position: global 3D position

Vector3D getField(const Vector3D &position, Cache&) const

Retrieve magnetic field value.

Parameters
  • [in] position: global 3D position

  • [in] cache: Cache object, passed through to wrapped BField

Vector2D getField(const Vector2D &position) const

Retrieve magnetic field value in local (r,z) coordinates.

Parameters
  • [in] position: local 2D position

Vector3D getFieldGradient(const Vector3D &position, ActsMatrixD<3, 3>&) const

retrieve magnetic field value & its gradient

Return

magnetic field vector

Note

currently the derivative is not calculated

Parameters
  • [in] position: global 3D position

  • [out] derivative: gradient of magnetic field vector as (3x3) matrix

Vector3D getFieldGradient(const Vector3D &position, ActsMatrixD<3, 3>&, Cache&) const

retrieve magnetic field value & its gradient

Return

magnetic field vector

Note

currently the derivative is not calculated

Parameters
  • [in] position: global 3D position

  • [out] derivative: gradient of magnetic field vector as (3x3) matrix

  • [in] cache: Cache object, passed through to wrapped BField

struct Cache

Public Functions

Cache(std::reference_wrapper<const MagneticFieldContext>)

Constructor with magnetic field context.

Parameters
  • mcfg: the magnetic field context

struct Config

Config struct for the SolenoidBfield.

Public Members

double bMagCenter

The target magnetic field strength at the center.

This will be used to scale coefficients

double length

Extent of the solenoid in z.

It goes from -length/2 to +length/2 by convention

size_t nCoils

The number of coils that make up the solenoid.

double radius

Radius at which the coils are located.