18#include <boost/serialization/access.hpp>
19#include <boost/serialization/array.hpp>
35 static constexpr int kPolDegree{5};
36 static constexpr int kNofCoeff{((kPolDegree + 1) * (kPolDegree + 2)) / 2};
56 : fBx(utils::simd::Cast<I, T, kNofCoeff>(other.fBx))
57 , fBy(utils::simd::Cast<I, T, kNofCoeff>(other.fBy))
58 , fBz(utils::simd::Cast<I, T, kNofCoeff>(other.fBz))
59 , fZref(utils::simd::Cast<I, T>(other.fZref))
77 Horner<kPolDegree>(fBy.cbegin(),
x,
y),
78 Horner<kPolDegree>(fBz.cbegin(),
x,
y));
86 T dz = fZref - trkPar.
GetZ();
87 return GetFieldValue(trkPar.
GetX() + trkPar.
GetTx() * dz, trkPar.
GetY() + trkPar.
GetTy() * dz);
91 const T&
GetZref()
const {
return fZref; }
96 std::string
ToString(
int indentLevel = 0,
int verbose = 1)
const;
99 void CheckConsistency()
const;
103 friend class boost::serialization::access;
104 template<
class Archive>
116 T fZref{defs::Undef<T>};
std::string ToString(ECbmModuleId modId)
Common constant definitions for the Kalman Filter library.
Magnetic flux density vector representation.
Collection of generic mathematical methods.
A magnetic field approximation on the two-dimensional plane.
void serialize(Archive &ar, const unsigned int)
~FieldSlice()=default
Destructor.
FieldSlice & operator=(const FieldSlice &other)=default
Copy assignment operator.
FieldSlice(const FieldSlice< I > &other)
Copy constructor.
const T & GetZref() const
Gets reference z-coordinate of the slice [cm].
FieldSlice()=default
Default constructor.
constexpr FieldValue< T > GetFieldValueForLine(const TrackParam< T > &trkPar) const
Gets field value for the intersection with a straight track.
std::array< T, kNofCoeff > CoeffArray_t
Array of the approximation coefficients [<monomial>].
constexpr FieldValue< T > GetFieldValue(const T &x, const T &y) const
Gets field value at a point on the transverse plane.
Magnetic flux density vector.
T GetTy() const
Gets slope along y-axis.
T GetZ() const
Gets z position [cm].
T GetTx() const
Gets slope along x-axis.
T GetY() const
Gets y position [cm].
T GetX() const
Gets x position [cm].
TrackParam classes of different types.
std::function< std::tuple< double, double, double >(double, double, double)> FieldFn_t
Magnetic field function type Signature: tuple<Bx, By, Bz>(x, y, z);.