12 #include <framework/logging/Logger.h>
13 #include <framework/geometry/B2Vector3.h>
14 #include <framework/gearbox/Unit.h>
15 #include <framework/database/DBObjPtr.h>
16 #include <framework/dbobjects/MagneticField.h>
38 static void getField(
const double* pos,
double* field);
96 if (!
m_magfield) B2FATAL(
"Could not load magnetic field configuration from database");
void GetXYZ(Double_t *carray) const
directly copies coordinates to an array of double
Bfield manager to obtain the magnetic field at any point.
static B2Vector3D getField(double x, double y, double z)
return the magnetic field at a given position.
BFieldManager()=default
Singleton: private constructor.
static TVector3 getField(const TVector3 &pos)
return the magnetic field at a given position.
static BFieldManager & getInstance()
Return the instance of the magnetic field manager.
BFieldManager(BFieldManager &)=delete
Singleton: no copy constructor.
static B2Vector3D getFieldInTesla(const B2Vector3D &pos)
return the magnetic field at a given position in Tesla.
BFieldManager & operator=(const BFieldManager &)=delete
Singleton: no assignment operator.
static B2Vector3D getField(const B2Vector3D &pos)
return the magnetic field at a given position.
DBObjPtr< MagneticField > m_magfield
Pointer to the actual magnetic field in the database.
~BFieldManager()=default
Empty destructor: this is just a wrapper to access the database object.
Class for accessing objects in the database.
static const double T
[tesla]
B2Vector3D calculate(const B2Vector3D &pos) const
Calculate the field value at a given position and return it.
B2Vector3< double > B2Vector3D
typedef for common usage with double
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
Abstract base class for different kinds of events.