8#include <tracking/trackFindingCDC/filters/segmentRelation/HitGapSegmentRelationVarSet.h>
10#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
12#include <tracking/trackFindingCDC/numerics/Angle.h>
15using namespace TrackFindingCDC;
19 if (not ptrSegmentRelation)
return false;
41 const Vector2D hitPosGap = toFirstHitPos - fromLastHitPos;
42 const Vector2D longHitPosGap = toLastHitPos - fromFirstHitPos;
44 const double hitDistance = hitPosGap.
norm();
45 const double longHitDistance = longHitPosGap.
norm();
53 double fromLastHitAlpha = fromLastHit.
getAlpha();
54 double toFirstHitAlpha = toFirstHit.
getAlpha();
60 finitevar<
named(
"delta_hit_distance")>() = longHitDistance - hitDistance;
66 const Vector2D fromStretch = fromLastHitPos - fromFirstHitPos;
67 const Vector2D toStretch = toLastHitPos - toFirstHitPos;
69 const double fromLength = fromStretch.
norm();
70 const double toLength = toStretch.
norm();
72 const Vector2D firstPosGap = toFirstHitPos - fromFirstHitPos;
73 const Vector2D lastPosGap = toLastHitPos - fromLastHitPos;
75 const double firstOffset = firstPosGap.
norm();
76 const double lastOffset = lastPosGap.
norm();
79 firstOffset * lastOffset - longHitDistance * hitDistance - fromLength * toLength;
Class representing a two dimensional reconstructed hit in the central drift chamber.
double getAlpha() const
Getter for the direction of flight relative to the position.
Vector2D getFlightDirection2D() const
Getter for the direction of flight.
Vector2D getRecoPos2D() const
Getter for the position in the reference plane.
A reconstructed sequence of two dimensional hits in one super layer.
bool extract(const Relation< const CDCSegment2D > *ptrSegmentRelation) override
Generate and assign the contained variables.
Type for two related objects.
From * getFrom() const
Getter for the pointer to the from side object.
To * getTo() const
Getter for the pointer to the to side object.
AssignFinite< Float_t > finitevar()
Reference getter for the value of the ith variable. Transforms non-finite values to finite value.
static constexpr int named(const char *name)
Getter for the index from the name.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double dot(const Vector2D &rhs) const
Calculates the two dimensional dot product.
static Vector2D average(const Vector2D &one, const Vector2D &two)
Constructs the average of two vectors.
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
double norm() const
Calculates the length of the vector.
Abstract base class for different kinds of events.
static double normalised(const double angle)
Normalise an angle to lie in the range from [-pi, pi].