File SolenoidBField.hpp¶
-
namespace Acts
Note
This file is foreseen for the
Geometry
module to replaceExtent
-
class SolenoidBField : public Acts::MagneticFieldProvider
- #include <Acts/MagneticField/SolenoidBField.hpp>
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
-
Vector2 getField(const Vector2 &position) const
Retrieve magnetic field value in local (r,z) coordinates.
- Parameters
position – [in] local 2D position
-
Vector3 getField(const Vector3 &position) const
Get the B field at a position.
- Parameters
position – The position to query at
-
virtual Result<Vector3> getField(const Vector3 &position, MagneticFieldProvider::Cache &cache) const override
Retrieve magnetic field value at a given location.
Requires a cache object created through makeCache().
- Parameters
position – [in] global 3D position for the lookup
cache – [inout] Field provider specific cache object
- Returns
magnetic field vector at given position
-
virtual Result<Vector3> getFieldGradient(const Vector3 &position, ActsMatrix<3, 3> &derivative, MagneticFieldProvider::Cache &cache) const override
Retrieve magnetic field value its its gradient.
Requires a cache object created through makeCache().
Note
currently the derivative is not calculated
- Parameters
position – [in] global 3D position
derivative – [out] gradient of magnetic field vector as (3x3) matrix
cache – [inout] Field provider specific cache object
- Returns
magnetic field vector
-
virtual MagneticFieldProvider::Cache makeCache(const MagneticFieldContext &mctx) const override
Make an opaque cache for the magnetic field.
Instructs the specific implementation to generate a
Cache
instance for magnetic field lookup.- Parameters
mctx – The magnetic field context to generate cache for
- Returns
Cache The opaque cache object
Private Functions
-
double k2(double r, double z) const¶
-
struct Cache
- #include <Acts/MagneticField/SolenoidBField.hpp>
Public Functions
-
inline Cache(const MagneticFieldContext &mctx)
Constructor with magnetic field context.
- Parameters
mctx – the magnetic field context
-
inline Cache(const MagneticFieldContext &mctx)
-
struct Config
- #include <Acts/MagneticField/SolenoidBField.hpp>
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.
-
double bMagCenter
-
SolenoidBField(Config config)
-
class SolenoidBField : public Acts::MagneticFieldProvider