Belle II Software  release-06-01-15
BFieldManager Class Reference

Bfield manager to obtain the magnetic field at any point. More...

#include <BFieldManager.h>

Collaboration diagram for BFieldManager:

Static Public Member Functions

static void getField (const double *pos, double *field)
 return the magnetic field at a given position. More...
 
static TVector3 getField (const TVector3 &pos)
 return the magnetic field at a given position. More...
 
static B2Vector3D getField (double x, double y, double z)
 return the magnetic field at a given position. More...
 
static B2Vector3D getField (const B2Vector3D &pos)
 return the magnetic field at a given position. More...
 
static B2Vector3D getFieldInTesla (const B2Vector3D &pos)
 return the magnetic field at a given position in Tesla. More...
 
static BFieldManagergetInstance ()
 Return the instance of the magnetic field manager.
 

Private Member Functions

 BFieldManager ()=default
 Singleton: private constructor.
 
 BFieldManager (BFieldManager &)=delete
 Singleton: no copy constructor.
 
BFieldManageroperator= (const BFieldManager &)=delete
 Singleton: no assignment operator.
 
 ~BFieldManager ()=default
 Empty destructor: this is just a wrapper to access the database object.
 
B2Vector3D calculate (const B2Vector3D &pos) const
 Calculate the field value at a given position and return it. More...
 

Private Attributes

DBObjPtr< MagneticFieldm_magfield
 Pointer to the actual magnetic field in the database.
 

Detailed Description

Bfield manager to obtain the magnetic field at any point.

This class is implemented as singleton, there can only be one magnetic field. It has static members to get the field at a given point.

Note
For internal use in the simulation, there is also a BFieldMap class in the geometry package with similar behaviour. To ensure consistent output, the BFieldFrameworkInterface component provides a wrapper around BFieldMap and is used by default.

Definition at line 32 of file BFieldManager.h.

Member Function Documentation

◆ getField() [1/3]

static B2Vector3D getField ( const B2Vector3D pos)
inlinestatic

return the magnetic field at a given position.

Parameters
posposition where to evaluate the magnetic field
Returns
magnetic field value at position pos in framework units

Definition at line 62 of file BFieldManager.h.

◆ getField() [2/3]

static TVector3 getField ( const TVector3 &  pos)
inlinestatic

return the magnetic field at a given position.

Parameters
posposition where to evaluate the magnetic field
Returns
magnetic field value at position pos in framework units

Definition at line 43 of file BFieldManager.h.

◆ getField() [3/3]

static B2Vector3D getField ( double  x,
double  y,
double  z 
)
inlinestatic

return the magnetic field at a given position.

Parameters
xx coordinate of the position where to evaluate the magnetic field
yy coordinate of the position where to evaluate the magnetic field
zz coordinate of the position where to evaluate the magnetic field
Returns
magnetic field value at position pos in framework units

Definition at line 54 of file BFieldManager.h.

◆ getFieldInTesla()

static B2Vector3D getFieldInTesla ( const B2Vector3D pos)
inlinestatic

return the magnetic field at a given position in Tesla.

Parameters
posposition where to evaluate the magnetic field
Returns
magnetic field value at position pos in Tesla

Definition at line 70 of file BFieldManager.h.


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