 |
Belle II Software
release-05-01-25
|
10 #include <tracking/trackFindingCDC/geometry/Helix.h>
12 #include <tracking/trackFindingCDC/geometry/HelixParameters.h>
13 #include <tracking/trackFindingCDC/geometry/PerigeeCircle.h>
14 #include <tracking/trackFindingCDC/geometry/PerigeeParameters.h>
15 #include <tracking/trackFindingCDC/geometry/SZLine.h>
16 #include <tracking/trackFindingCDC/geometry/SZParameters.h>
18 #include <tracking/trackFindingCDC/geometry/Vector3D.h>
20 #include <boost/math/tools/minima.hpp>
29 using namespace TrackFindingCDC;
36 if (denominator == 0) {
39 if (not std::isfinite(arcLength2D)) {
53 double deltaZ = point.
z() -
szLine().
map(arcLength2D);
54 if (not firstPeriod) {
55 if (fabs(deltaZ) >
zPeriod() / 2) {
56 double newDeltaZ = std::remainder(deltaZ,
zPeriod());
57 double nPeriodShift = (deltaZ - newDeltaZ) /
zPeriod();
63 using boost::math::tools::brent_find_minima;
65 auto distance3D = [
this, &point](
const double & s) ->
double {
67 return pos.distance(point);
72 double lowerS = arcLength2D - searchWidth;
73 double upperS = arcLength2D + searchWidth;
75 int bits = std::numeric_limits<double>::digits;
76 boost::uintmax_t nMaxIter = 100;
78 std::pair<double, double> sBounds = brent_find_minima(distance3D, lowerS, upperS, bits, nMaxIter);
83 double firstDistance = distance3D(sBounds.first);
84 double secondDistance = distance3D(sBounds.second);
85 if (firstDistance < secondDistance) {
88 return sBounds.second;
103 using namespace NHelixParameterIndices;
104 jacobian(c_Z0, c_Curv) = tanL * (jacobian(c_Phi0, c_Curv) - sArc) / curv;
105 jacobian(c_Z0, c_Phi0) = tanL * (jacobian(c_Phi0, c_Phi0) - 1.) / curv;
106 jacobian(c_Z0, c_I) = tanL * jacobian(c_Phi0, c_I) / curv;
107 jacobian(c_Z0, c_TanL) = sArc;
114 return output <<
"Helix("
116 <<
"phi0=" << helix.
phi0() <<
","
117 <<
"impact=" << helix.
impactXY() <<
","
119 <<
"z0=" << helix.
z0() <<
")";
double curvatureXY() const
Getter for the signed curvature in the xy projection.
double arcLengthTo(const Vector2D &point) const
Calculates the arc length between the perigee and the given point.
Extension of the generalized circle also caching the perigee coordinates.
double tanLambda() const
Getter for the proportinality factor from arc length in xy space to z.
std::ostream & operator<<(std::ostream &output, const Helix &helix)
Output operator for debugging and the generation of unittest error messages.
double arcLength2DToClosest(const Vector3D &point, bool firstPeriod=true) const
Calculates the perpendicular travel distance at which the helix has the closest approach to the given...
static CovarianceMatrix identity()
Returns an identity matrix.
const SZLine & szLine() const
Getter for the projection into xy space.
HelixJacobian passiveMoveByJacobian(const Vector3D &by) const
Computes the Jacobi matrix for a move of the coordinate system by the given vector.
PerigeeJacobian passiveMoveByJacobian(const Vector2D &by) const
Computes the Jacobi matrix for a move of the coordinate system by the given vector.
double perimeterXY() const
Getter for the perimeter of the circle in the xy projection.
Abstract base class for different kinds of events.
double z0() const
Getter for z coordinate at the perigee point of the helix.
A three dimensional vector.
double map(double s) const
Maps the two dimensional arc length s to z.
double zPeriod() const
Getter for the distance in z at which the two points on the helix coincide in the xy projection.
const PerigeeCircle & circleXY() const
Getter for the projection into xy space.
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
double impactXY() const
Getter for the signed distance to the z axes at the perigee point.
A matrix implementation to be used as an interface typ through out the track finder.
double z() const
Getter for the z coordinate.
double distance(const Vector2D &point) const
Getter for the proper signed distance of the point to the circle.
Vector3D atArcLength2D(double s) const
Calculates the point, which lies at the give perpendicular travel distance (counted from the perigee)
static HelixUtil::CovarianceMatrix stackBlocks(const PerigeeUtil::CovarianceMatrix &perigeeCov, const SZUtil::CovarianceMatrix &szCov)
Combine covariance matrices from the xy space and the sz space in their respective blocks.
double d0() const
Getter for the signed distance to the z axes at the perigee point.
double phi0() const
Getter for the azimuth angle of the direction of flight at the perigee.