8#include <tracking/trackingUtilities/eventdata/trajectories/CDCBFieldUtil.h>
10#include <tracking/trackingUtilities/geometry/VectorUtil.h>
12#include <tracking/trackingUtilities/numerics/ERotation.h>
13#include <tracking/trackingUtilities/numerics/ESign.h>
15#include <framework/geometry/BFieldManager.h>
17#include <framework/geometry/B2Vector3.h>
19#include <Math/Vector3D.h>
20#include <Math/Vector2D.h>
25using namespace TrackingUtilities;
30 double c_EarthMagneticField = 3.2e-5 *
Unit::T;
31 return not(b > 5 * c_EarthMagneticField);
41 return getBFieldZ(ROOT::Math::XYZVector(0, 0, 0));
46 return getBFieldZ(ROOT::Math::XYZVector(pos2D.X(), pos2D.Y(), 0));
54 if (VectorUtil::hasNAN(pos3D))
return NAN;
63 return 1.0 / (bField * TMath::C()) * 1E11;
95 return std::fmin(4440, absMom2D / (bZ * 0.00299792458));
99 const ROOT::Math::XYVector& pos2D)
105 const ROOT::Math::XYZVector& pos3D)
114 return - charge * bZ * 0.00299792458 * std::fmax(0, 1 / absMom2D);
119 const ROOT::Math::XYVector& pos2D)
126 const ROOT::Math::XYZVector& pos3D)
134 return std::fmin(20, std::fabs(bZ * 0.00299792458 / curvature));
138 const ROOT::Math::XYVector& pos2D)
144 const ROOT::Math::XYZVector& pos3D)
static double curvatureToAbsMom2D(double curvature, double bZ)
Conversion helper for two dimensional curvature to momenta.
static double getAlphaZ(const ROOT::Math::XYVector &pos2D)
Getter for the signed alpha of the magnetic field in z direction.
static bool isOff()
Indicator if the magnetic field is off in the current geometry.
static ESign getBFieldZSign()
Getter for the sign of the magnetic field in z direction.
static ESign ccwInfoToChargeSign(ERotation ccwInfo)
Conversion helper from clockwise or counterclockwise travel to the charge sign.
static double getBFieldZ()
Getter for the signed magnetic field strength in z direction at the origin ( in Tesla )
static ERotation chargeSignToERotation(ESign chargeSign)
Conversion helper from the charge sign to clockwise or counterclockwise travel.
static ERotation chargeToERotation(double charge)
Conversion help for charges to clockwise or counterclockwise travel.
static double absMom2DToCurvature(double absMom2D, double charge, double bZ)
Conversion helper for momenta to two dimensional curvature.
static double getAlphaFromBField(double bField)
Translator from magnetic field strength in Tesla to the alpha value.
static double absMom2DToBendRadius(double absMom2D, double bZ)
Conversion helper for momenta to two dimensional (absolute) bend radius.
static const double T
[tesla]
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
Abstract base class for different kinds of events.