16#include <boost/serialization/access.hpp>
17#include <boost/serialization/array.hpp>
47 FieldValue(
const I& bx,
const I& by,
const I& bz,
const I& z)
57 :
fB(
utils::simd::Cast<I, T, 3>(other.
fB))
75 void Set(
const I& bx,
const I& by,
const I& bz,
const I& z)
88 for (
size_t iD = 0; iD <
fB.size(); ++iD) {
96 [[gnu::always_inline]] std::tuple<T, T, T>
Get()
const {
return std::make_tuple(
fB[0],
fB[1],
fB[2]); }
109 [[gnu::always_inline]] T
GetBx()
const {
return fB[0]; }
112 [[gnu::always_inline]] T
GetBy()
const {
return fB[1]; }
115 [[gnu::always_inline]] T
GetBz()
const {
return fB[2]; }
118 [[gnu::always_inline]] T
GetZ()
const {
return fZ; }
121 [[gnu::always_inline]]
bool IsZero()
const
124 if constexpr (std::is_same_v<T, fvec>) {
125 return bZero.isFull();
133 void CheckConsistency()
const;
143 [[gnu::always_inline]]
void SetSimdEntry(
double bx,
double by,
double bz,
double z,
size_t i)
152 std::string
ToString(
int indentLevel = 0)
const;
156 friend class boost::serialization::access;
157 template<
class Archive>
std::string ToString(CbmCutId id)
Convert CbmCutId to a string representation.
Common constant definitions for the Kalman Filter library.
Collection of generic mathematical methods.
FieldValue()=default
Default constructor.
void serialize(Archive &ar, const unsigned int)
FieldValue & operator=(const FieldValue &other)=default
Copy assignment operator.
T GetComponent(int iD) const
Gets component by index.
void Set(const I &bx, const I &by, const I &bz, const I &z)
Constructor from components.
GeoVector_t< T > fB
Magnetic flux vector [kG].
T GetBz() const
Gets magnetic flux density z-component [kG].
FieldValue(const FieldValue< I > &other)
Copy constructor.
T GetAbsSq() const
Gets squared absolute magnetic flux [kG2].
void SetSimdEntries(const FieldValue &other, const kf::utils::masktype< T > &mask)
Combines the current magnetic field value with another one using a mask.
T GetBx() const
Gets magnetic flux x-component [kG].
FieldValue(const I &bx, const I &by, const I &bz, const I &z)
Constructor from components.
std::tuple< T, T, T > Get() const
Gets magnetic flux density x, y, z-components [kG].
T GetBy() const
Gets magnetic flux density y-component [kG].
T GetZ() const
Gets z-coordinate of the spatial point [cm].
bool IsZero() const
Checks, if the field value is zero (negligible)
~FieldValue()=default
Destructor.
void SetSimdEntry(double bx, double by, double bz, double z, size_t i)
Sets magnetic flux density components to the field function.
T GetAbs() const
Gets absolute magnetic flux [kG].
constexpr auto MinField
Minimal (negligible) magnetic field value [kG].
DataOut Cast(const DataT &val)
Converts a value of type DataT to type DataOut.
void SetEntry(DataT &out, DataIn in, size_t)
Sets a value at a specific index in the output data.
typename std::conditional< std::is_same< T, fvec >::value, fmask, bool >::type masktype
fvec iif(const fmask &m, const fvec &t, const fvec &f)
std::array< T, 3 > GeoVector_t
Geometry (spatial) vector.