8#include <tracking/trackFindingCDC/filters/axialSegmentPair/SimpleAxialSegmentPairFilter.h>
10#include <tracking/trackFindingCDC/eventdata/tracks/CDCAxialSegmentPair.h>
11#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
14using namespace TrackFindingCDC;
26 assert(ptrStartSegment);
27 assert(ptrEndSegment);
40 if (not endSegmentIsCoaligned or not startSegmentIsCoaligned) {
48 if (startFitGap < 0 or startFitGap > 100 or endFitGap < 0 or endFitGap > 100) {
55 if (startFitFrontOffset < 0 or endFitBackOffset < 0) {
59 Vector2D startBackRecoPos2D = startSegment.back().getRecoPos2D();
60 Vector2D endFrontRecoPos2D = endSegment.front().getRecoPos2D();
69 double momAngleAtStartBack = startMom2DAtStartBack.
angleWith(endMom2DAtStartBack);
70 double momAngleAtEndFront = endMom2DAtEndFront.
angleWith(startMom2DAtEndFront);
72 if (fabs(momAngleAtEndFront) > 2.0 or fabs(momAngleAtStartBack) > 2.0) {
77 double startFit_dist2DToFront_endSegment = startFit.
getDist2D(endFrontRecoPos2D);
78 double endFit_dist2DToBack_startSegment = endFit.
getDist2D(startBackRecoPos2D);
80 if (startFit_dist2DToFront_endSegment < 6 and endFit_dist2DToBack_startSegment < 6) {
81 return startSegment.size() + endSegment.size();
104 axialSegmentPair)
const
Class representing a pair of reconstructed axial segments in adjacent superlayer.
const CDCAxialSegment2D * getEndSegment() const
Getter for the end segment.
CDCTrajectory2D & getTrajectory2D() const
Getter for the trajectory of the two dimensional trajectory.
const CDCAxialSegment2D * getStartSegment() const
Getter for the start segment.
void update(CDCTrajectory2D &trajectory2D, const CDCObservations2D &observations2D) const
Update the trajectory with a fit to the observations.
void useOnlyOrientation()
Setup the fitter to use only reference position and the drift length with right left orientation.
A reconstructed sequence of two dimensional hits in one super layer.
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.
const CDCRiemannFitter & getRiemannFitter() const
Returns the xy fitter instance that is used by this filter.
SimpleAxialSegmentPairFilter()
Constructor.
const CDCTrajectory2D & getFittedTrajectory2D(const CDCAxialSegment2D &segment) const
Returns the trajectory of the axial segment. Also fits it if necessary.
Weight operator()(const CDCAxialSegmentPair &axialSegmentPair) final
Checks if a pair of axial segments is a good combination.
CDCRiemannFitter m_riemannFitter
Memory of the Riemann fitter for the circle fits.
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.