10 #include <tracking/vxdHoughTracking/filters/pathFilters/TwoHitVariables.h>
11 #include <tracking/spacePointCreation/SpacePoint.h>
12 #include <framework/geometry/B2Vector3.h>
21 namespace vxdHoughTracking {
60 return (sqrt(std::pow(circleCenter.
X() -
m_oHit.
X(), 2) + std::pow(circleCenter.
Y() -
m_oHit.
Y(), 2)) +
61 sqrt(std::pow(circleCenter.
X() -
m_cHit.
X(), 2) + std::pow(circleCenter.
Y() -
m_cHit.
Y(), 2)) +
62 sqrt(std::pow(circleCenter.
X() -
m_iHit.
X(), 2) + std::pow(circleCenter.
Y() -
m_iHit.
Y(), 2))) / 3.;
71 return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
81 return (std::isnan(result) || std::isinf(result)) ?
double(0) : result;
92 double result = acos(twoHitVariables.
getCosXY());
93 return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
112 double result = acos(twoHitVariables.
getCosXY());
113 return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
136 if (a11 * a22 == a12 * a21) {
141 double s = (b1 * a22 - b2 * a21) / (a11 * a22 - a12 * a21);
151 if (circleCenter.
Perp2() > 1e30) {
158 return (fabs(circleCenter.
Perp() - circleRadius));
166 if (circleCenter.
Perp2() > 1e30) {
181 return (std::isnan(result) || std::isinf(result)) ?
double(0) : result;
190 double slopeOC = outerTwoHitVariables.
getRZSlope();
191 double slopeCI = innerTwoHitVariables.
getRZSlope();
193 return slopeCI - slopeOC;
201 if (circleCenter.
Perp2() > 1e30) {
214 double alfaOCr = acos(outerTwoHitVariables.
getCosXY()) * circleRadius ;
215 double alfaCIr = acos(innerTwoHitVariables.
getCosXY()) * circleRadius ;
220 return (std::isnan(result) || std::isinf(result)) ?
double(0) : result;
228 if (circleCenter.
Perp2() > 1e30) {
237 double alfaOC = acos(outerTwoHitVariables.
getCosXY());
238 double alfaCI = acos(innerTwoHitVariables.
getCosXY());
249 if (circleCenter.
Perp2() > 1e30) {
259 double alfaAB = outerTwoHitVariables.
getCosXY();
260 double alfaBC = innerTwoHitVariables.
getCosXY();
265 return (std::isnan(result) || std::isinf(result)) ?
double(0) : result;
273 if (circleCenter.
Perp2() > 1e30) {
278 return 0.00299792458 *
m_BFieldZ * circleRadius;
287 using boost::math::sign;
298 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)
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.
B2Vector3< DataType > Orthogonal() const
Vector orthogonal to this one.
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
Abstract base class for different kinds of events.