11 #include <geometry/bfieldmap/BFieldComponentAbs.h>
13 #include <framework/logging/Logger.h>
49 ROOT::Math::XYZVector
getBField(
const ROOT::Math::XYZVector& point)
const;
89 friend struct std::default_delete<
BFieldMap>;
100 BFIELDCOMP* newComponent =
new BFIELDCOMP;
102 return *newComponent;
108 ROOT::Math::XYZVector magFieldVec(0.0, 0.0, 0.0);
110 if (std::isnan(point.X()) || std::isnan(point.Y()) || std::isnan(point.Z())) {
111 B2ERROR(
"Bfield requested for a position containing NaN, returning field 0");
116 magFieldVec += comp->calculate(point);
The BFieldComponentAbs class.
Simple BFieldComponent to just wrap the existing BFieldMap with the new BFieldManager.
This class represents the magnetic field of the Belle II detector.
BFieldMap()
The constructor is hidden to avoid that someone creates an instance of this class.
std::list< BFieldComponentAbs * > m_components
The components of the magnetic field.
void initialize()
Initialize the magnetic field after adding all components.
BFieldMap & operator=(const BFieldMap &)
Disable/Hide the copy assignment operator.
virtual ~BFieldMap()
The destructor of the BFieldMap class.
BFieldMap(const BFieldMap &)
Disable/Hide the copy constructor.
void clear()
Clear the existing components.
static BFieldMap & Instance()
Static method to get a reference to the BFieldMap instance.
bool m_isMapInitialized
If false the map hasn't been initialized yet.
ROOT::Math::XYZVector getBField(const ROOT::Math::XYZVector &point) const
Returns the magnetic field of the Belle II detector at the specified space point.
BFIELDCOMP & addBFieldComponent()
Adds a new BField component to the Belle II magnetic field.
Abstract base class for different kinds of events.