5#ifndef MUONHOUGHPATTERNEVENT_MUONHOUGHMATHUTILS_H
6#define MUONHOUGHPATTERNEVENT_MUONHOUGHMATHUTILS_H
28 constexpr double z_end = 15000.;
43 static int sgn(
double d);
45 static int step(
double d,
double x0 = 0);
Scalar phi() const
phi method
Scalar theta() const
theta method
std::vector< size_t > vec
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
static std::string intToString(int i)
converts integer to string
static int step(double d, double x0=0)
step function at place x0
static double incrementTillAbove0(double x, double inc, double zero=0)
increments x with inc till above x
static double distanceOfLineToOrigin2D(double a, double b)
distance of line y = ax + b to origin
virtual ~MuonHoughMathUtils()=default
destructor
static double angleFrom0ToPi(double angle)
computes angle in rad between 0 and Pi
static void thetasForCurvedHit(double ratio, MuonHoughHit *hit, double &theta1, double &theta2)
calculates theta at (x,y,z) for curved track model, for positive and negative curvature
static double angleFrom0To360(double angle)
computes angle in degrees between 0 and 360
static bool lineThroughCylinder(const Amg::Vector3D &vec, double phi, double theta, double r_0, double z_0)
calculates if line (x,y,z,phi,theta) crosses cylinder (r_0,z_0) around origin
static double signedDistanceOfLineToOrigin2D(double x, double y, double phi)
signed distance of line with point (x,y) and angle phi to origin
static double angleFromMinusPiToPi(double angle)
computes angle in rad between -Pi and Pi
static Amg::Vector3D shortestPointOfLineToOrigin3D(const Amg::Vector3D &vec, double phi, double theta)
calculates the 3d-point closest to origin in xy-plane
static double thetaForCurvedHit(double invcurvature, MuonHoughHit *hit)
calculates theta at (x,y,z) for curved track model
double angleFromRadialToGrad(double angle) const
converts angle in rad to degrees
double angleFromGradToRadial(double angle) const
converts angle in degrees to rad
MuonHoughMathUtils()
default constructor
static Amg::Vector3D shortestPointOfLineToOrigin(const Amg::Vector3D &vec, double phi, double theta)
calculates the 3d-point closest to origin
static int sgn(double d)
sign (-1 or 1) of a double
static double distanceToLine2D(double x0, double y0, double r, double phi)
distance from (x0,y0) to line (r,phi)
static double signedDistanceCurvedToHit(double z0, double theta, double invcurvature, const Amg::Vector3D &hit)
calculates distance of point (x,y,z) to curved track with z0, theta and invcurvature for curved track...
static double distanceToLine(double x0, double y0, double r0, double phi)
distance from (x0,y0) to the line (r0,phi), phi in rad
static double angleFrom0To180(double angle)
computes angle in degrees between 0 and 180
static double signedDistanceToLine(double x0, double y0, double r0, double phi)
distance from (x0,y0) to the line (r0,phi), phi in rad
static void extrapolateCurvedRoad(const Amg::Vector3D &roadpos, const Amg::Vector3D &roadmom, const Amg::Vector3D &pos, Amg::Vector3D &roadpose, Amg::Vector3D &roaddire)
extrapolates road to global position
static double distanceToLine3D(const Amg::Vector3D &point, const Amg::Vector3D &l_trans, double phi, double theta)
distance from (x0,y0,z0) to line (x,y,z,phi,theta)
void zero(TH2 *h)
zero the contents of a 2d histogram
Eigen::Matrix< double, 3, 1 > Vector3D
constexpr double tan_barrel
relation for transition between endcap and barrel 11.43 m (r) / 14m (z)
constexpr double radius_cylinder
radius of cylinder
constexpr double z_cylinder
length of cylinder
constexpr double degree_rad_conversion_factor
constexpr double z_magnetic_range_squared
range where hit is curved in endcap region ('squared')
constexpr double z_end
z value whereafter no magnetic field / curvature
constexpr double z_magnetic_range
range where hit is curved in endcap region
constexpr double rad_degree_conversion_factor