10#include <tracking/vxdHoughTracking/filters/pathFilters/TwoHitVariables.h>
11#include <tracking/spacePointCreation/SpacePoint.h>
12#include <framework/geometry/B2Vector3.h>
15#include <boost/math/special_functions/sign.hpp>
22 namespace vxdHoughTracking {
61 return (
sqrt(std::pow(circleCenter.
X() -
m_oHit.
X(), 2) + std::pow(circleCenter.
Y() -
m_oHit.
Y(), 2)) +
63 sqrt(std::pow(circleCenter.
X() -
m_iHit.
X(), 2) + std::pow(circleCenter.
Y() -
m_iHit.
Y(), 2))) / 3.;
72 return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
82 return (std::isnan(result) || std::isinf(result)) ?
double(0) : result;
93 double result = acos(twoHitVariables.
getCosXY());
94 return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
113 double result = acos(twoHitVariables.
getCosXY());
114 return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
137 if (a11 * a22 == a12 * a21) {
142 double s = (b1 * a22 - b2 * a21) / (a11 * a22 - a12 * a21);
152 if (circleCenter.
Perp2() > 1e30) {
159 return (fabs(circleCenter.
Perp() - circleRadius));
167 if (circleCenter.
Perp2() > 1e30) {
182 return (std::isnan(result) || std::isinf(result)) ?
double(0) : result;
191 double slopeOC = outerTwoHitVariables.
getRZSlope();
192 double slopeCI = innerTwoHitVariables.
getRZSlope();
194 return slopeCI - slopeOC;
202 if (circleCenter.
Perp2() > 1e30) {
215 double alfaOCr = acos(outerTwoHitVariables.
getCosXY()) * circleRadius ;
216 double alfaCIr = acos(innerTwoHitVariables.
getCosXY()) * circleRadius ;
221 return (std::isnan(result) || std::isinf(result)) ?
double(0) : result;
229 if (circleCenter.
Perp2() > 1e30) {
238 double alfaOC = acos(outerTwoHitVariables.
getCosXY());
239 double alfaCI = acos(innerTwoHitVariables.
getCosXY());
250 if (circleCenter.
Perp2() > 1e30) {
260 double alfaAB = outerTwoHitVariables.
getCosXY();
261 double alfaBC = innerTwoHitVariables.
getCosXY();
266 return (std::isnan(result) || std::isinf(result)) ?
double(0) : result;
274 if (circleCenter.
Perp2() > 1e30) {
279 return 0.00299792458 *
m_BFieldZ * circleRadius;
288 using boost::math::sign;
299 using boost::math::sign;
DataType Z() const
access variable Z (= .at(2) without boundary check)
DataType Perp2() const
The transverse component squared (R^2 in cylindrical coordinate system).
DataType X() const
access variable X (= .at(0) without boundary check)
B2Vector3< DataType > Orthogonal() const
Vector orthogonal to this one.
DataType Y() const
access variable Y (= .at(1) without boundary check)
DataType Mag() const
The magnitude (rho in spherical coordinate system).
DataType Mag2() const
The magnitude squared (rho^2 in spherical coordinate system).
DataType Dot(const B2Vector3< DataType > &p) const
Scalar product.
DataType Perp() const
The transverse component (R in cylindrical coordinate system).
Class that allows the calculation of simple variables to estimate the quality of a triplet of hits.
double getCosAngleRZSimple()
calculates the cosine of the angle between the hits/vectors (RZ), returning unit: none (calculation f...
double getDeltaSlopeZoverS()
compares the "slopes" z over arc length. calcDeltaSlopeZOverS is invariant under rotations in the r-z...
int getCurvatureSign(const B2Vector3D &oHit, const B2Vector3D &cHit, const B2Vector3D &iHit)
calculates calculates the sign of the curvature of 3-hit-tracklet given as arguments.
B2Vector3D m_cHit
center hit position
B2Vector3D getCircleCenterXY()
calculates an estimation of circleCenter position, result is returned as the x and y value of the B2V...
int getCurvatureSign()
calculates calculates the sign of the curvature of given 3-hit-tracklet.
ThreeHitVariables()
basic constructor
void setBFieldZ(const double bfieldZ=1.5)
Set the B-Field value used for pT calculations.
double getDeltaSoverZ()
calculates the helixparameter describing the deviation in arc length per unit in z....
B2Vector3D m_outerDifferenceVector
The following two differences are used very often, so calculate once on construction vector containin...
double calcAvgDistanceXY(const B2Vector3D &circleCenter)
helper function which calculates the average distance in XY from the given center
double getAngle3D()
calculates the angle between the hits/vectors (3D), returning unit: angle in radian
ThreeHitVariables(const B2Vector3D &oHit, const B2Vector3D &cHit, const B2Vector3D &iHit)
actual useful constructor
void setHits(const B2Vector3D &oHit, const B2Vector3D &cHit, const B2Vector3D &iHit)
Set hits if not given in constructor of if they need to be changed.
double getCosAngleXY()
calculates the angle between the hits/vectors (XY), returning unit: none (calculation for degrees is ...
double m_BFieldZ
BField along z to estimate pT.
double getCircleDistanceIP()
calculates the distance of the point of closest approach of circle to the IP, returning unit: cm
B2Vector3D m_oHit
outermost hit position
B2Vector3D m_iHit
innermost hit position
double getSimplePTEstimate()
calculates the estimation of the transverse momentum of the 3-hit-tracklet, returning unit: GeV/c
double performHelixParamterFit()
calculates the helixparameter describing the deviation in z per unit angle, returning unit: none
B2Vector3D m_innerDifferenceVector
vector containing the difference m_cHit - m_iHit
double getAngleRZ()
calculates the angle between the hits/vectors (RZ), returning unit: angle in radian
double getAngle3DSimple()
calculates the angle between the hits/vectors (3D), returning unit: none (calculation for degrees is ...
double getCircleRadius()
calculates the estimation of the circle radius of the 3-hit-tracklet, returning unit: cm.
double getDeltaSlopeRZ()
calculates deviations in the slope of the inner segment and the outer segment, returning unit: none
double getAngleXY()
Calculates the angle in x-y between two vectors return unit: rad (0 - pi)
Class that allows the calculation of simple variables to check whether a combination of two hits shou...
double getCosXY()
calculate the cosine of the angle between two vectors in x-y
double getRZSlope()
get an estimate for the slope in R-z, similar to theta
B2Vector3< double > B2Vector3D
typedef for common usage with double
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.