Class Acts::InterpolatedBFieldMap¶
-
template<typename grid_t>
class Acts::InterpolatedBFieldMap : public Acts::InterpolatedMagneticField¶ 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.
- tparam grid_t
The Grid type which provides the field storage and interpolation
Public Functions
-
inline Result<Vector3> getField(const Vector3 &position) const¶
retrieve field at given position
- Parameters
position – [in] global 3D position
- Returns
magnetic field value at the given position
- Pre
The given
position
must lie within the range of the underlying magnetic field map.
-
inline virtual Result<Vector3> getField(const Vector3 &position, MagneticFieldProvider::Cache &cache) const override¶
retrieve magnetic field value
- Parameters
position – [in] global 3D position
cache – [inout] Field provider specific cache object
- Returns
magnetic field vector at given position
-
inline Result<FieldCell> getFieldCell(const Vector3 &position) const¶
retrieve field cell for given position
- Parameters
position – [in] global 3D position
- Returns
field cell containing the given global position
- Pre
The given
position
must lie within the range of the underlying magnetic field map.
-
inline virtual Result<Vector3> getFieldGradient(const Vector3 &position, ActsMatrix<3, 3> &derivative, MagneticFieldProvider::Cache &cache) const override¶
retrieve magnetic field value & its gradient
Note
currently the derivative is not calculated
Note
Cache is not used currently
- 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
-
inline const Grid &getGrid() const¶
Get a const reference on the underlying grid structure.
- Returns
grid reference
-
inline virtual std::vector<double> getMax() const override¶
get the maximum value of all axes of the field map
- Returns
vector returning the maxima of all field map axes
-
inline virtual std::vector<double> getMin() const override¶
get the minimum value of all axes of the field map
- Returns
vector returning the minima of all field map axes
-
inline virtual std::vector<size_t> getNBins() const override¶
get the number of bins for all axes of the field map
- Returns
vector returning number of bins for all field map axes
-
inline virtual bool isInside(const Vector3 &position) const override¶
check whether given 3D position is inside look-up domain
- Parameters
position – [in] global 3D position
- Returns
true
if position is inside the defined look-up grid, otherwisefalse
-
inline bool isInsideLocal(const ActsVector<DIM_POS> &gridPosition) const¶
check whether given 3D position is inside look-up domain
- Parameters
gridPosition – [in] local N-D position
- Returns
true
if position is inside the defined look-up grid, otherwisefalse
-
inline virtual MagneticFieldProvider::Cache makeCache(const MagneticFieldContext &mctx) const override¶
Make an opaque cache for the magnetic field.
- Parameters
mctx – The magnetic field context to generate cache for
- Returns
Cache The opaque cache object
-
struct Cache¶
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¶
Config structure for the interpolated B field map.
Public Members
-
double scale = 1.¶
global B-field scaling factor
Note
Negative values for
scale
are accepted and will invert the direction of the magnetic field.
-
std::function<Vector3(const FieldType&, const Vector3&)> transformBField¶
calculating the global 3D coordinates (cartesian) of the magnetic field with the local n dimensional field and the global 3D position as input
- std::function< ActsVector< DIM_POS >const Vector3 &)> transformPos
mapping of global 3D coordinates (cartesian) onto grid space
-
double scale = 1.¶
-
struct FieldCell¶
struct representing smallest grid unit in magnetic field grid
This type encapsulate all required information to perform linear interpolation of magnetic field values within a confined 3D volume.
Public Functions
-
inline FieldCell(std::array<double, DIM_POS> lowerLeft, std::array<double, DIM_POS> upperRight, std::array<Vector3, N> fieldValues)¶
default constructor
- Parameters
lowerLeft – [in] generalized lower-left corner of hyper box (containing the minima of the hyper box along each Dimension)
upperRight – [in] generalized upper-right corner of hyper box (containing the maxima of the hyper box along each Dimension)
fieldValues – [in] field values at the hyper box corners sorted in the canonical order defined in Acts::interpolate
-
inline Vector3 getField(const ActsVector<DIM_POS> &position) const¶
retrieve field at given position
- Parameters
position – [in] global 3D position
- Returns
magnetic field value at the given position
- Pre
The given
position
must lie within the current field cell.
-
inline bool isInside(const ActsVector<DIM_POS> &position) const¶
check whether given 3D position is inside this field cell
- Parameters
position – [in] global 3D position
- Returns
true
if position is inside the current field cell, otherwisefalse
-
inline FieldCell(std::array<double, DIM_POS> lowerLeft, std::array<double, DIM_POS> upperRight, std::array<Vector3, N> fieldValues)¶