Belle II Software  release-08-01-10
MagneticField Class Reference

Magnetic field map. More...

#include <MagneticField.h>

Inheritance diagram for MagneticField:
Collaboration diagram for MagneticField:

Public Member Functions

 MagneticField ()
 Empty Constructor.
 
 ~MagneticField ()
 Delete all components.
 
 MagneticField (const MagneticField &)=delete
 Disallow copying the magnetic field.
 
 MagneticField (MagneticField &&other) noexcept
 But allow move construction.
 
ROOT::Math::XYZVector getField (const ROOT::Math::XYZVector &pos) const
 Calculate the magnetic field at a given position. More...
 
ROOT::Math::XYZVector getFieldInTesla (const ROOT::Math::XYZVector &pos) const
 Convenience function to get the field directly in Tesla. More...
 
void addComponent (MagneticFieldComponent *component)
 Add a new component to the magnetic field. More...
 

Private Member Functions

 ClassDef (MagneticField, 1)
 ROOT dictionary definition.
 

Private Attributes

std::vector< MagneticFieldComponent * > m_components
 Magnetic field components to evaluate the field.
 

Detailed Description

Magnetic field map.

It can be used directly using a DBObjPtr<MagneticField> instance in your class. Alternatively there is a BFieldManager class which encapsulates the DBObjPtr already. Field evaluation is then a simple call to BFieldManager::getField().

This class contains the Magnetic field map to be stored in the Database and used during simulation and reconstruction. The field can be assembled from multiple components (constant, 3D, 2D, ...) in different regions. By default all components valid in a certain region will be added to obtain the final field value but components can also be flagged as exclusive in which case only the field of this particular component will be returned.

Definition at line 32 of file MagneticField.h.

Member Function Documentation

◆ addComponent()

void addComponent ( MagneticFieldComponent component)
inline

Add a new component to the magnetic field.

Ownership is taken over by the MagneticField instance

Definition at line 59 of file MagneticField.h.

◆ getFieldInTesla()

ROOT::Math::XYZVector getFieldInTesla ( const ROOT::Math::XYZVector &  pos) const
inline

Convenience function to get the field directly in Tesla.

Parameters
posposition where the field should be evaluated in framework units.
Returns
magnetic field at pos in framework units.

Definition at line 57 of file MagneticField.h.


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