Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::InterpolatedBFieldMap< grid_t > Class Template Reference

interpolate magnetic field value from field values on a given grid More...

#include <acts/blob/sPHENIX/Core/include/Acts/MagneticField/InterpolatedBFieldMap.hpp>

+ Inheritance diagram for Acts::InterpolatedBFieldMap< grid_t >:
+ Collaboration diagram for Acts::InterpolatedBFieldMap< grid_t >:

Classes

struct  Cache
 
struct  Config
 Config structure for the interpolated B field map. More...
 
struct  FieldCell
 struct representing smallest grid unit in magnetic field grid More...
 

Public Types

using Grid = grid_t
 
using FieldType = typename Grid::value_type
 

Public Member Functions

 InterpolatedBFieldMap (Config cfg)
 default constructor
 
minBin fill (1)
 
Result< FieldCellgetFieldCell (const Vector3 &position) const
 retrieve field cell for given position
 
std::vector< size_t > getNBins () const final
 get the number of bins for all axes of the field map
 
std::vector< doublegetMin () const final
 get the minimum value of all axes of the field map
 
std::vector< doublegetMax () const final
 get the maximum value of all axes of the field map
 
bool isInside (const Vector3 &position) const final
 check whether given 3D position is inside look-up domain
 
bool isInsideLocal (const ActsVector< DIM_POS > &gridPosition) const
 check whether given 3D position is inside look-up domain
 
const GridgetGrid () const
 Get a const reference on the underlying grid structure.
 
MagneticFieldProvider::Cache makeCache (const MagneticFieldContext &mctx) const final
 
 
Result< Vector3getField (const Vector3 &position) const
 retrieve field at given position
 
Vector3 getFieldUnchecked (const Vector3 &position) const final
 
Result< Vector3getField (const Vector3 &position, MagneticFieldProvider::Cache &cache) const final
 
 
Result< Vector3getFieldGradient (const Vector3 &position, ActsMatrix< 3, 3 > &derivative, MagneticFieldProvider::Cache &cache) const final
 
 

Public Attributes

 m_lowerLeft = m_cfg.grid.lowerLeftBinEdge(minBin)
 
 m_upperRight = m_cfg.grid.lowerLeftBinEdge(m_cfg.grid.numLocalBins())
 

Static Public Attributes

static constexpr size_t DIM_POS = Grid::DIM
 

Private Attributes

Config m_cfg
 
Grid::point_t m_lowerLeft
 
Grid::point_t m_upperRight
 

Detailed Description

template<typename grid_t>
class Acts::InterpolatedBFieldMap< grid_t >

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.
Template Parameters
grid_tThe Grid type which provides the field storage and interpolation

Definition at line 76 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 76 of file InterpolatedBFieldMap.hpp

Member Typedef Documentation

template<typename grid_t>
using Acts::InterpolatedBFieldMap< grid_t >::FieldType = typename Grid::value_type

Definition at line 79 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 79 of file InterpolatedBFieldMap.hpp

template<typename grid_t>
using Acts::InterpolatedBFieldMap< grid_t >::Grid = grid_t

Definition at line 78 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 78 of file InterpolatedBFieldMap.hpp

Constructor & Destructor Documentation

template<typename grid_t>
Acts::InterpolatedBFieldMap< grid_t >::InterpolatedBFieldMap ( Config  cfg)
inline

default constructor

Definition at line 180 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 180 of file InterpolatedBFieldMap.hpp

References testing::internal::move().

+ Here is the call graph for this function:

Member Function Documentation

template<typename grid_t>
minBin Acts::InterpolatedBFieldMap< grid_t >::fill ( )
template<typename grid_t>
Result<Vector3> Acts::InterpolatedBFieldMap< grid_t >::getField ( const Vector3 position) const
inline

retrieve field at given position

Parameters
[in]positionglobal 3D position
Returns
magnetic field value at the given position
Precondition
The given position must lie within the range of the underlying magnetic field map.

Definition at line 283 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 283 of file InterpolatedBFieldMap.hpp

References Acts::InterpolatedBFieldMap< grid_t >::Config::grid, Acts::InterpolatedBFieldMap< grid_t >::isInsideLocal(), Acts::InterpolatedBFieldMap< grid_t >::m_cfg, position, Acts::InterpolatedBFieldMap< grid_t >::Config::transformBField, and Acts::InterpolatedBFieldMap< grid_t >::Config::transformPos.

Referenced by Acts::InterpolatedBFieldMap< grid_t >::getFieldGradient().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename grid_t>
Result<Vector3> Acts::InterpolatedBFieldMap< grid_t >::getField ( const Vector3 position,
MagneticFieldProvider::Cache cache 
) const
inlinefinal

Definition at line 300 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 300 of file InterpolatedBFieldMap.hpp

References Acts::InterpolatedBFieldMap< grid_t >::Cache::fieldCell, Acts::InterpolatedBFieldMap< grid_t >::getFieldCell(), Acts::InterpolatedBFieldMap< grid_t >::m_cfg, position, and Acts::InterpolatedBFieldMap< grid_t >::Config::transformPos.

+ Here is the call graph for this function:

template<typename grid_t>
Result<FieldCell> Acts::InterpolatedBFieldMap< grid_t >::getFieldCell ( const Vector3 position) const
inline

retrieve field cell for given position

Parameters
[in]positionglobal 3D position
Returns
field cell containing the given global position
Precondition
The given position must lie within the range of the underlying magnetic field map.

Definition at line 194 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 194 of file InterpolatedBFieldMap.hpp

References assert, Acts::InterpolatedBFieldMap< grid_t >::DIM_POS, Acts::InterpolatedBFieldMap< grid_t >::Config::grid, i, index, Acts::InterpolatedBFieldMap< grid_t >::isInsideLocal(), Acts::InterpolatedBFieldMap< grid_t >::m_cfg, testing::internal::move(), position, Acts::InterpolatedBFieldMap< grid_t >::Config::transformBField, and Acts::InterpolatedBFieldMap< grid_t >::Config::transformPos.

Referenced by Acts::InterpolatedBFieldMap< grid_t >::getField().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename grid_t>
Result<Vector3> Acts::InterpolatedBFieldMap< grid_t >::getFieldGradient ( const Vector3 position,
ActsMatrix< 3, 3 > &  derivative,
MagneticFieldProvider::Cache cache 
) const
inlinefinal

Note
currently the derivative is not calculated
Cache is not used currently

Definition at line 319 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 319 of file InterpolatedBFieldMap.hpp

References Acts::InterpolatedBFieldMap< grid_t >::getField(), and position.

+ Here is the call graph for this function:

template<typename grid_t>
const Grid& Acts::InterpolatedBFieldMap< grid_t >::getGrid ( ) const
inline

Get a const reference on the underlying grid structure.

Returns
grid reference

Definition at line 268 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 268 of file InterpolatedBFieldMap.hpp

References Acts::InterpolatedBFieldMap< grid_t >::Config::grid, and Acts::InterpolatedBFieldMap< grid_t >::m_cfg.

template<typename grid_t>
std::vector<double> Acts::InterpolatedBFieldMap< grid_t >::getMax ( ) const
inlinefinal

get the maximum value of all axes of the field map

Returns
vector returning the maxima of all field map axes

Definition at line 237 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 237 of file InterpolatedBFieldMap.hpp

References Acts::InterpolatedBFieldMap< grid_t >::m_upperRight.

template<typename grid_t>
std::vector<double> Acts::InterpolatedBFieldMap< grid_t >::getMin ( ) const
inlinefinal

get the minimum value of all axes of the field map

Returns
vector returning the minima of all field map axes

Definition at line 230 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 230 of file InterpolatedBFieldMap.hpp

References Acts::InterpolatedBFieldMap< grid_t >::m_lowerLeft.

template<typename grid_t>
std::vector<size_t> Acts::InterpolatedBFieldMap< grid_t >::getNBins ( ) const
inlinefinal

get the number of bins for all axes of the field map

Returns
vector returning number of bins for all field map axes

Definition at line 222 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 222 of file InterpolatedBFieldMap.hpp

References Acts::InterpolatedBFieldMap< grid_t >::Config::grid, and Acts::InterpolatedBFieldMap< grid_t >::m_cfg.

template<typename grid_t>
bool Acts::InterpolatedBFieldMap< grid_t >::isInside ( const Vector3 position) const
inlinefinal

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

Parameters
[in]positionglobal 3D position
Returns
true if position is inside the defined look-up grid, otherwise false

Definition at line 246 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 246 of file InterpolatedBFieldMap.hpp

References Acts::InterpolatedBFieldMap< grid_t >::isInsideLocal(), Acts::InterpolatedBFieldMap< grid_t >::m_cfg, position, and Acts::InterpolatedBFieldMap< grid_t >::Config::transformPos.

+ Here is the call graph for this function:

template<typename grid_t>
bool Acts::InterpolatedBFieldMap< grid_t >::isInsideLocal ( const ActsVector< DIM_POS > &  gridPosition) const
inline

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

Parameters
[in]gridPositionlocal N-D position
Returns
true if position is inside the defined look-up grid, otherwise false

Definition at line 255 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 255 of file InterpolatedBFieldMap.hpp

References Acts::InterpolatedBFieldMap< grid_t >::DIM_POS, i, Acts::InterpolatedBFieldMap< grid_t >::m_lowerLeft, and Acts::InterpolatedBFieldMap< grid_t >::m_upperRight.

Referenced by Acts::InterpolatedBFieldMap< grid_t >::getField(), Acts::InterpolatedBFieldMap< grid_t >::getFieldCell(), and Acts::InterpolatedBFieldMap< grid_t >::isInside().

+ Here is the caller graph for this function:

template<typename grid_t>
MagneticFieldProvider::Cache Acts::InterpolatedBFieldMap< grid_t >::makeCache ( const MagneticFieldContext mctx) const
inlinefinal

Definition at line 271 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 271 of file InterpolatedBFieldMap.hpp

Member Data Documentation

template<typename grid_t>
constexpr size_t Acts::InterpolatedBFieldMap< grid_t >::DIM_POS = Grid::DIM
static
template<typename grid_t>
Acts::InterpolatedBFieldMap< grid_t >::m_lowerLeft = m_cfg.grid.lowerLeftBinEdge(minBin)

Definition at line 183 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 183 of file InterpolatedBFieldMap.hpp

Referenced by Acts::InterpolatedBFieldMap< grid_t >::getMin(), and Acts::InterpolatedBFieldMap< grid_t >::isInsideLocal().

template<typename grid_t>
Grid::point_t Acts::InterpolatedBFieldMap< grid_t >::m_lowerLeft
private

Definition at line 329 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 329 of file InterpolatedBFieldMap.hpp

template<typename grid_t>
Acts::InterpolatedBFieldMap< grid_t >::m_upperRight = m_cfg.grid.lowerLeftBinEdge(m_cfg.grid.numLocalBins())

Definition at line 184 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 184 of file InterpolatedBFieldMap.hpp

Referenced by Acts::InterpolatedBFieldMap< grid_t >::getMax(), and Acts::InterpolatedBFieldMap< grid_t >::isInsideLocal().

template<typename grid_t>
Grid::point_t Acts::InterpolatedBFieldMap< grid_t >::m_upperRight
private

Definition at line 330 of file InterpolatedBFieldMap.hpp.

View newest version in sPHENIX GitHub at line 330 of file InterpolatedBFieldMap.hpp


The documentation for this class was generated from the following file: