 |
Belle II Software
release-05-02-19
|
14 #include "tracking/vxdCaTracking/TwoHitFilters.h"
15 #include "tracking/vxdCaTracking/FilterExceptions.h"
16 #include <framework/logging/Logger.h>
25 class ThreeHitFilters {
46 ThreeHitFilters(TVector3& outerHit, TVector3& centerHit, TVector3& innerHit,
double magneticFieldStrength = 1.5):
67 void resetValues(TVector3& outerHit, TVector3& centerHit, TVector3& innerHit)
118 angle = (angle * (180. / M_PI));
137 angle = (angle * (180. / M_PI));
159 angle = (angle * (180. / M_PI));
186 double calcPt(
double radius)
219 double alfaAB =
fullAngle2D(points2hitA, points2hitB);
222 return (alfaAB *
m_vecBC[2]) - (alfaBC *
251 double alfaAB =
calcAngle2D(points2hitA, points2hitB);
252 double alfaBC =
calcAngle2D(points2hitB, points2hitC);
267 double angle = ((vecA[0] * vecB[0] + vecA[1] * vecB[1]) / sqrt(vecA.Perp2() * vecB.Perp2()));
283 double calcRadius(TVector3& a, TVector3& b, TVector3& c, TVector3& circleCenter)
285 return ((circleCenter - a).Perp() + (circleCenter - b).Perp() + (circleCenter - c).Perp()) /
292 void calcCircleCenter(TVector3& a, TVector3& b, TVector3& c, TVector3& circleCenter)
296 double inX = b[0] - c[0];
297 double inY = b[1] - c[1];
298 double outX = a[0] - b[0];
299 double outY = a[1] - b[1];
306 double b1 = b[0] + outX * 0.5 - (c[0] + inX * 0.5);
307 double b2 = b[1] + outY * 0.5 - (c[1] + inY * 0.5);
309 if (a11 * a22 == a12 * a21) {
throw FilterExceptions::Straight_Line(); }
311 double s = (b1 * a22 - b2 * a21) / (a11 * a22 - a12 * a21);
313 circleCenter.SetXYZ(c[0] + inX * 0.5 + s * inY, c[1] + inY * 0.5 - s * inX, 0.);
319 int calcSign(TVector3& a, TVector3& b, TVector3& c);
324 int calcSign(TVector3& a, TVector3& b, TVector3& c, TVector3& sigma_a, TVector3& sigma_b, TVector3& sigma_c)
326 TVector3 c2b = b - c; c2b.SetZ(0.);
327 TVector3 b2a = a - b; b2a.SetZ(0.);
328 double angle = atan2(b2a[0], b2a[1]) - atan2(c2b[0], c2b[1]);
329 double sigmaan = (sigma_a.Mag() + sigma_b.Mag() + sigma_c.Mag()) / (3.*(c2b.Mag() +
331 if (angle < (-sigmaan)) {
return -1; }
332 else if (angle > sigmaan) {
return 1; }
371 B2ERROR(
"sanityCheckRadius: given radius is " << radius <<
", which is below threshold of " << 0.0000001 <<
", throwing exception");
372 throw FilterExceptions::Circle_too_small();
void resetValues(TVector3 &outerHit, TVector3 ¢erHit, TVector3 &innerHit)
Overrides Constructor-Setup.
double calcAngleRZ()
calculates the angle between the hits/vectors (RZ), returning unit: none (calculation for degrees is ...
double m_magneticFieldFactor
is factor containing speed of light (c), the magnetic field (b) and the scaling factor s for conversi...
TVector3 m_hitB
center hit (position relevant for useful filter calculation) used for the filter calculation
double calcRadius(TVector3 &a, TVector3 &b, TVector3 &c, TVector3 &circleCenter)
calculates an estimation of the radius of given hits and existing estimation of circleCenter,...
double m_z2
internal intermediate value storing z^2, no enduser-relevance
TwoHitFilters m_twoHitFilter
instance of TwoHitFilters-class used for some internal calculations
double fullAngleRZ()
calculates the angle between the hits/vectors (RZ), returning unit: angle in degrees
double fullAngle2D(TVector3 &vecA, TVector3 &vecB)
calculates the angle between the hits/vectors (2D), generalized, returning unit: angle in radians WAR...
void checkCalcCircleCenter()
checks whether the calcCircleCenter()-Member has been executed already and executes it if not
double calcCircleDist2IP()
calculates the distance of the point of closest approach of circle to the IP, returning unit: cm
double filterNan(double value)
returns zero if value is nan or inf
double calcHelixFit()
reverse compatibility, calls calcHelixParameterFit
double fullAngleXY()
calculates the angle between the hits/vectors (XY), returning unit: angle in degrees
double calcDeltaSlopeRZ()
calculates deviations in the slope of the inner segment and the outer segment, returning unit: none
double calcSlopeRZ() const
calculates the angle of the slope of the hits in RZ, returnValue = theta = atan(r/z)
double m_x2
internal intermediate value storing x^2, no enduser-relevance
int calcSign(TVector3 &a, TVector3 &b, TVector3 &c)
calculates calculates the sign of the curvature of given 3-hit-tracklet.
double calcAngleXY()
calculates the angle between the hits/vectors (XY), returning unit: none (calculation for degrees is ...
double calcAngle2D(TVector3 &vecA, TVector3 &vecB)
calculates the angle between the hits/vectors (2D), generalized, returning unit: none.
double calcAngle3D()
calculates the angle between the hits/vectors (3D), returning unit: none (calculation for degrees is ...
Abstract base class for different kinds of events.
ThreeHitFilters()
Empty constructor.
TVector3 m_hitA
outer hit (position relevant for useful filter calculation) used for the filter calculation
TVector3 m_centerABC
center position of a circle in r-phi-plane formed by the 3 hits
~ThreeHitFilters()
Destructor.
double fullAngle3D()
calculates the angle between the hits/vectors (3D), returning unit: angle in degrees
double m_radius
radius[cm] of a circle in r-phi-plane formed by the 3 hits
TVector3 m_vecAB
vector pointing from center hit to outer hit (outer segment)
double calcHelixParameterFit()
calculates the helixparameter describing the deviation in z per unit angle, returning unit: none
double getMagneticField()
returns the set value of the magnetic field in Tesla
double calcDeltaSlopeZOverS()
compares the "slopes" z over arc length.
void resetMagneticField(double magneticFieldStrength=1.5)
Overrides Constructor-Setup for magnetic field.
double m_y2
internal intermediate value storing y^2, no enduser-relevance
void resetValues(TVector3 &outerHit, TVector3 &innerHit)
Overrides Constructor-Setup.
double calcDeltaSOverZ()
calculates the helixparameter describing the deviation in arc length per unit in z.
void calcCircleCenter(TVector3 &a, TVector3 &b, TVector3 &c, TVector3 &circleCenter)
calculates an estimation of circleCenter position, result is written into the 4th input-parameter
TVector3 m_vecBC
vector pointing from inner hit to center hit (inner segment)
bool m_circleCenterCalculated
initially set to false, will be set true if calcCircleCenter() is used at least once
void sanityCheckRadius(double radius)
check Radius for bad values and throw exception if the value is bad
void checkCalcRadius()
checks whether the calcRadius()-Member has been executed already and executes it if not
TVector3 m_hitC
inner hit (position relevant for useful filter calculation) used for the filter calculation
double filterNan(double value) const
nice little nanChecker returns 0 if value was nan or inf, else returns value itself
double calcPt()
calculates the estimation of the transverse momentum of the 3-hit-tracklet, returning unit: GeV/c
bool m_radiusCalculated
initially set to false, will be set true if calcInvCurvature() is used at least once