8#include <tracking/trackFindingCDC/filters/segmentPair/SimpleSegmentPairFilter.h>
10#include <tracking/trackFindingCDC/fitting/CDCAxialStereoFusion.h>
12#include <tracking/trackFindingCDC/eventdata/tracks/CDCSegmentPair.h>
13#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
14#include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory3D.h>
15#include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
17#include <tracking/trackFindingCDC/geometry/Vector2D.h>
20using namespace TrackFindingCDC;
27 assert(ptrFromSegment);
41 if (not toSegmentIsCoaligned or not fromSegmentIsCoaligned) {
49 if (fromFitGap < -5 or fromFitGap > 50 or toFitGap < -5 or toFitGap > 50) {
56 if (fromFitFrontOffset < 0 or
57 fromFitFrontOffset > 50 or
58 toFitBackOffset < 0 or
59 toFitBackOffset > 50) {
63 Vector2D fromBackRecoPos2D = fromSegment.back().getRecoPos2D();
64 Vector2D toFrontRecoPos2D = toSegment.front().getRecoPos2D();
73 double momAngleAtFromBack = fromMom2DAtFromBack.
angleWith(toMom2DAtFromBack);
74 double momAngleAtToFront = toMom2DAtToFront.
angleWith(fromMom2DAtToFront);
76 if (fabs(momAngleAtToFront) > 1.0 or fabs(momAngleAtFromBack) > 1.0) {
81 double fromFit_dist2DToFront_toSegment = fromFit.
getDist2D(toSegment.front().getRecoPos2D());
82 double toFit_dist2DToBack_fromSegment = toFit.
getDist2D(fromSegment.back().getRecoPos2D());
84 if (fromFit_dist2DToFront_toSegment < 10 and toFit_dist2DToBack_fromSegment < 10) {
86 return fromSegment.size() + toSegment.size();
Utility class implementing the Kalmanesk combination of to two dimensional trajectories to one three ...
void reconstructFuseTrajectories(const CDCSegmentPair &segmentPair)
Combine the two trajectories of the segments in the pair and assign the resulting three dimensional t...
void update(CDCTrajectory2D &trajectory2D, const CDCObservations2D &observations2D) const
Update the trajectory with a fit to the observations.
A reconstructed sequence of two dimensional hits in one super layer.
Class representing a pair of one reconstructed axial segment and one stereo segment in adjacent super...
const CDCSegment2D * getToSegment() const
Getter for the to segment.
CDCTrajectory3D & getTrajectory3D() const
Getter for the three dimensional trajectory.
const CDCSegment2D * getFromSegment() const
Getter for the from segment.
Particle trajectory as it is seen in xy projection represented as a circle.
double getTotalArcLength2D(const AHits &hits) const
Calculates the perpendicular travel distance from the first position of the hits to the last position...
bool isFitted() const
Checks if the circle is already set to a valid value.
double getArcLength2DGap(const AFromHits &fromHits, const AToHits &toHits) const
Calculates the perpendicular travel distance from the last position of the fromHits to the first posi...
double getArcLength2DBackOffset(const AFromHits &fromHits, const AToHits &toHits) const
Calculates the perpendicular travel distance from the last position of the fromHits to the last posit...
Vector2D getFlightDirection2D(const Vector2D &point) const
Get the unit direction of flight at the given point, where arcLength2D = 0.
double getArcLength2DFrontOffset(const AFromHits &fromHits, const AToHits &toHits) const
Calculates the perpendicular travel distance from the first position of the fromHits to the first pos...
double getDist2D(const Vector2D &point) const
Calculates the distance from the point to the trajectory as seen from the xy projection.
Particle full three dimensional trajectory.
const CDCRiemannFitter & getRiemannFitter() const
Returns the xy fitter instance that is used by this filter.
const CDCTrajectory2D & getFittedTrajectory2D(const CDCSegment2D &segment) const
Returns the trajectory of the segment. Also fits it if necessary.
Weight operator()(const CDCSegmentPair &segmentPair) final
Checks if a pair of segments is a good combination.
const CDCTrajectory3D & getFittedTrajectory3D(const CDCSegmentPair &segmentPair) const
Returns the three dimensional trajectory of the axial stereo segment pair.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
Abstract base class for different kinds of events.