Template Class InterpolatedBFieldMap

Class Documentation

template<typename Mapper_t>
class Acts::InterpolatedBFieldMap

interpolate magnetic field value from field values on a given grid

This class implements a magnetic field service which is initialized by a field map defined by:

  • a list of field values on a regular grid in some n-Dimensional space,

  • a transformation of global 3D coordinates onto this n-Dimensional space.

  • a transformation of local n-Dimensional magnetic field coordinates into global (cartesian) 3D coordinates

The magnetic field value for a given global position is then determined by:

  • mapping the position onto the grid,

  • looking up the magnetic field values on the closest grid points,

  • doing a linear interpolation of these magnetic field values.

Public Functions

InterpolatedBFieldMap(Config config)

create interpolated magnetic field map

Parameters
  • [in] config: configuration object

Config getConfiguration() const

get configuration object

Return

copy of the internal configuration object

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 &cache) const

retrieve magnetic field value

Return

magnetic field vector at given position

Parameters
  • [in] position: global 3D position

  • [inout] cache: Cache object. Contains field cell used for interpolation

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

Note

Cache is not used currently

Parameters
  • [in] position: global 3D position

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

  • [inout] cache: Cache object. Contains field cell used for

Mapper_t getMapper() const

convenience method to access underlying field mapper

Return

the field mapper

double getScale() const

get global scaling factor for magnetic field

Return

global factor for scaling the magnetic field

bool isInside(const Vector3D &position) const

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

Return

true if position is inside the defined BField map, otherwise false

Parameters
  • [in] position: global 3D position

void setConfiguration(const Config &config)

update configuration

Parameters
  • [in] config: new configuration object

struct Cache

Public Functions

Cache(std::reference_wrapper<const MagneticFieldContext>)

Constructor with magnetic field context.

Parameters
  • mcfg: the magnetic field context

Public Members

std::optional<typename Mapper_t::FieldCell> fieldCell
bool initialized = false
struct Config

configuration object for magnetic field interpolation

Public Functions

Config(Mapper_t m)

Public Members

Mapper_t mapper

object for global coordinate transformation and interpolation

This object performs the mapping of the global 3D coordinates onto the field grid and the interpolation of the field values on close-by grid points.

double scale = 1.

global B-field scaling factor

Note

Negative values for scale are accepted and will invert the direction of the magnetic field.