Class ConstantBField

Nested Relationships

Class Documentation

class Acts::ConstantBField

This class implements a simple constant magnetic field.

The magnetic field value has to be set at creation time, but can be updated later on.

Public Functions

ConstantBField(Vector3D B)

Construct constant magnetic field from field vector.

Parameters
  • [in] B: magnetic field vector in global coordinate system

ConstantBField(double Bx = 0., double By = 0., double Bz = 0.)

construct constant magnetic field from components

Parameters
  • [in] Bx: magnetic field component in global x-direction

  • [in] By: magnetic field component in global y-direction

  • [in] Bz: magnetic field component in global z-direction

Vector3D getField(const Vector3D&) const

retrieve magnetic field value

Return

magnetic field vector

Note

The position is ignored and only kept as argument to provide a consistent interface with other magnetic field services.

Parameters
  • [in] position: global position

Vector3D getField(const Vector3D&, Cache&) const

retrieve magnetic field value

Return

magnetic field vector

Note

The position is ignored and only kept as argument to provide a consistent interface with other magnetic field services.

Parameters
  • [in] position: global position

  • [in] cache: Cache object (is ignored)

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

retrieve magnetic field value & its gradient

Return

magnetic field vector

Note

The position is ignored and only kept as argument to provide a consistent interface with other magnetic field services.

Note

currently the derivative is not calculated

Parameters
  • [in] position: global position

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

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

retrieve magnetic field value & its gradient

Return

magnetic field vector

Note

The position is ignored and only kept as argument to provide a consistent interface with other magnetic field services.

Note

currently the derivative is not calculated

Parameters
  • [in] position: global position

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

  • [in] cache: Cache object (is ignored)

bool isInside(const Vector3D&) const

check whether given 3D position is inside look-up domain

Return

true if position is inside the defined look-up grid, otherwise false

Note

The method will always return true for the constant B-Field

Parameters
  • [in] position: global 3D position

void setField(double Bx, double By, double Bz)

update magnetic field vector from components

Parameters
  • [in] Bx: magnetic field component in global x-direction

  • [in] By: magnetic field component in global y-direction

  • [in] Bz: magnetic field component in global z-direction

void setField(const Vector3D &B)

update magnetic field vector

Parameters
  • [in] B: magnetic field vector in global coordinate system

struct Cache

Public Functions

Cache(std::reference_wrapper<const MagneticFieldContext>)

constructor with context