11 #include <framework/dbobjects/MagneticFieldComponent.h>
25 int nR,
int nPhi,
int nZ,
26 std::vector<B2Vector3F>&& fieldmap):
28 m_gridPitch{static_cast<float>((maxR - minR) / (nR - 1)), static_cast<float>(M_PI / (nPhi - 1)), static_cast<float>((maxZ - minZ) / (nZ - 1))},
36 const float z = pos.Z();
37 if (z < m_minZ || z >
m_maxZ)
return false;
38 const float r = pos.Perp();
52 B2Vector3D interpolate(
unsigned int ir,
unsigned int iphi,
unsigned int iz,
double wr,
double wphi,
double wz)
const;
Describe one component of the Geometry.
ClassDefOverride(MagneticFieldComponent3D, 1)
ROOT dictionary.
float m_maxR
maximal R=sqrt(x^2+y^2) for which this field is present
bool inside(const B2Vector3D &pos) const override
return whether we are inside the active region for this component
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
MagneticFieldComponent3D(double minR, double maxR, double minZ, double maxZ, int nR, int nPhi, int nZ, std::vector< B2Vector3F > &&fieldmap)
Full constructor to create an object from data.
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
std::vector< B2Vector3F > m_bmap
magnetic field strength
Abstract base class for BField components.
B2Vector3D 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.
B2Vector3D getField(const B2Vector3D &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.