ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::SolenoidBField Class Referencefinal

Analytical solenoid magnetic field implementation. More...

#include <Acts/MagneticField/SolenoidBField.hpp>

Inheritance diagram for Acts::SolenoidBField:
[legend]
Collaboration diagram for Acts::SolenoidBField:
[legend]

Classes

struct  Cache
struct  Config
 Config struct for the SolenoidBfield. More...

Public Member Functions

 SolenoidBField (Config config)
 the constructor with a shared pointer
Vector2 getField (const Vector2 &position) const
 Retrieve magnetic field value in local (r,z) coordinates.
Vector3 getField (const Vector3 &position) const
 Get the B field at a position.
Result< Vector3getField (const Vector3 &position, MagneticFieldProvider::Cache &cache) const override
 Retrieve magnetic field value at a given location.
MagneticFieldProvider::Cache makeCache (const MagneticFieldContext &mctx) const override
 Make an opaque cache for the magnetic field.
Public Member Functions inherited from Acts::MagneticFieldProvider
virtual ~MagneticFieldProvider ()=default

Additional Inherited Members

Public Types inherited from Acts::MagneticFieldProvider
using Cache = Acts::AnyBase<sizeof(char) * 512>
 Opaque cache type that can store arbitrary implementation specific cache data.

Detailed Description

Analytical solenoid magnetic field implementation.

Concept

This class 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.

Picture of a solenoid field in rz, with arrows indicating the direction of the field, and their size denoting the strength. The field is almost homogeneous in the center.
Note
A configuration of
cfg.length = 5.8_m;
cfg.radius = (2.56 + 2.46) * 0.5 * 0.5_m;
cfg.nCoils = 1154;
cfg.bMagCenter = 2_T;
SolenoidBField bField(cfg);
SolenoidBField(Config config)
the constructor with a shared pointer
Config struct for the SolenoidBfield.
Definition SolenoidBField.hpp:102
std::size_t nCoils
The number of coils that make up the solenoid.
Definition SolenoidBField.hpp:109
double bMagCenter
The target magnetic field strength at the center.
Definition SolenoidBField.hpp:112
double radius
Radius at which the coils are located.
Definition SolenoidBField.hpp:104
double length
Extent of the solenoid in z.
Definition SolenoidBField.hpp:107
roughly corresponds to the solenoid wrapping the Inner Detector in ATLAS!
Warning
As the evaluation of \(E_1(k^2)\) and \(E_2(k^2)\) is slow. The Acts::InterpolatedBFieldMap easily outperforms Acts::SolenoidBField. A helper is provided that builds a map from the analytical implementation and is much faster to lookup: Acts::solenoidFieldMap.

Implementation

  • \(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

\[ E_1(k^2) = \int_0^{\pi/2} \left( 1 - k^2 \sin^2{\theta} \right )^{-1/2} \mathrm{d}\theta \]

\[ E_2(k^2) = \int_0^{\pi/2}\sqrt{1 - k^2 \sin^2{\theta}} \mathrm{d}\theta \]

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

\[ k^2 = \frac{4Rr}{(R+r)^2 + z^2} \]

Using these, you can evaluate the two components \(B_r\) and \(B_z\) of the magnetic field:

\[ B_r(r, z) = \frac{\mu_0 I}{4\pi} \frac{kz}{\sqrt{Rr^3}} \left[ \left(\frac{2-k^2}{2-2k^2}\right)E_2(k^2) - E_1(k^2) \right ] \]

\[ B_z(r,z) = \frac{\mu_0 I}{4\pi} \frac{k}{\sqrt{Rr}} \left[ \left( \frac{(R+r)k^2-2r}{2r(1-k^2)} \right ) E_2(k^2) + E_1(k^2) \right ] \]

In the implementation the factor of \((\mu_0\cdot I)\) is defined to be a scaling factor. It is evaluated and defined as the magnetic field in the center of the coil, i.e. the scale set in Acts::SolenoidBField::Config::bMagCenter.

Constructor & Destructor Documentation

◆ SolenoidBField()

Acts::SolenoidBField::SolenoidBField ( Config config)
explicit

the constructor with a shared pointer

Note
since it is a shared field, we enforce it to be const
Template Parameters
bFieldis the shared BField to be stored
Parameters
configConfiguration struct containing solenoid parameters

Member Function Documentation

◆ getField() [1/3]

Vector2 Acts::SolenoidBField::getField ( const Vector2 & position) const

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

Parameters
[in]positionlocal 2D position
Returns
Magnetic field vector in local (r,z) coordinates

◆ getField() [2/3]

Vector3 Acts::SolenoidBField::getField ( const Vector3 & position) const

Get the B field at a position.

Parameters
positionThe position to query at
Returns
Magnetic field vector in global coordinates

◆ getField() [3/3]

Result< Vector3 > Acts::SolenoidBField::getField ( const Vector3 & position,
MagneticFieldProvider::Cache & cache ) const
overridevirtual

Retrieve magnetic field value at a given location.

Requires an instance of Acts::MagneticFieldProvider::Cache created through makeCache.

Parameters
[in]positionglobal 3D position for the lookup
[in,out]cacheField provider specific cache object
Returns
magnetic field vector at given position

Implements Acts::MagneticFieldProvider.

◆ makeCache()

MagneticFieldProvider::Cache Acts::SolenoidBField::makeCache ( const MagneticFieldContext & mctx) const
overridevirtual

Make an opaque cache for the magnetic field.

Instructs the specific implementation to generate a Acts::MagneticFieldProvider::Cache instance for magnetic field lookup.

Parameters
mctxThe magnetic field context to generate cache for
Returns
Cache The opaque cache object

Implements Acts::MagneticFieldProvider.