11#include <framework/dbobjects/MagneticFieldComponent.h>
12#include <framework/geometry/B2Vector3.h>
28 int nR,
int nPhi,
int nZ,
29 std::vector<ROOT::Math::XYZVector>&& fieldmap):
31 m_gridPitch{static_cast<float>((maxR - minR) / (nR - 1)), static_cast<float>(M_PI / (nPhi - 1)), static_cast<float>((maxZ - minZ) / (nZ - 1))},
37 bool inside(
const ROOT::Math::XYZVector& pos)
const override
39 const float z = pos.Z();
40 if (z < m_minZ || z >
m_maxZ)
return false;
41 const float r = pos.Rho();
45 ROOT::Math::XYZVector
getField(
const ROOT::Math::XYZVector& pos)
const override;
55 ROOT::Math::XYZVector
interpolate(
unsigned int ir,
unsigned int iphi,
unsigned int iz,
double wr,
double wphi,
double wz)
const;
71 std::vector<ROOT::Math::XYZVector>
m_bmap;
Describe one component of the Geometry.
bool inside(const ROOT::Math::XYZVector &pos) const override
return whether we are inside the active region for this component
MagneticFieldComponent3D(double minR, double maxR, double minZ, double maxZ, int nR, int nPhi, int nZ, std::vector< ROOT::Math::XYZVector > &&fieldmap)
Full constructor to create an object from data.
float m_maxR
maximal R=sqrt(x^2+y^2) for which this field is present
float m_gridPitch[3]
grid pitch in r, phi and z
int m_mapSize[3]
number of bins in r, phi and z
float m_maxZ
maximal Z for which this field is present
std::vector< ROOT::Math::XYZVector > m_bmap
magnetic field strength
ClassDefOverride(MagneticFieldComponent3D, 2)
ROOT dictionary.
float m_invgridPitch[3]
inverted grid pitch in r, phi and z
MagneticFieldComponent3D()
empty constructor for ROOT
float m_minZ
minimal Z for which this field is present
float m_minR
minimal R=sqrt(x^2+y^2) for which this field is present
Abstract base class for BField components.
ROOT::Math::XYZVector interpolate(unsigned int ir, unsigned int iphi, unsigned int iz, double wr, double wphi, double wz) const
Linear interpolate the magnetic field inside a bin.
ROOT::Math::XYZVector getField(const ROOT::Math::XYZVector &pos) const override
return the field assuming we are inside the active region as returned by inside()
Abstract base class for different kinds of events.