8#include <tracking/trackFindingCDC/filters/segmentTriple/MCSegmentTripleFilter.h>
10#include <tracking/trackFindingCDC/mclookup/CDCMCSegment2DLookUp.h>
12#include <tracking/trackingUtilities/eventdata/tracks/CDCSegmentTriple.h>
13#include <tracking/trackingUtilities/eventdata/tracks/CDCAxialSegmentPair.h>
15#include <tracking/trackingUtilities/eventdata/segments/CDCSegment2D.h>
16#include <tracking/trackingUtilities/eventdata/trajectories/CDCTrajectory3D.h>
17#include <tracking/trackingUtilities/eventdata/trajectories/CDCTrajectorySZ.h>
19#include <tracking/trackFindingCDC/filters/base/MCSymmetricFilter.icc.h>
21#include <framework/logging/Logger.h>
24using namespace TrackFindingCDC;
25using namespace TrackingUtilities;
37 const std::string& prefix)
50 const CDCAxialSegment2D* ptrStartSegment = segmentTriple.
getStartSegment();
51 const CDCStereoSegment2D* ptrMiddleSegment = segmentTriple.
getMiddleSegment();
52 const CDCAxialSegment2D* ptrEndSegment = segmentTriple.
getEndSegment();
54 const CDCAxialSegment2D& startSegment = *ptrStartSegment;
55 const CDCAxialSegment2D& middleSegment = *ptrMiddleSegment;
56 const CDCAxialSegment2D& endSegment = *ptrEndSegment;
62 if (std::isnan(pairWeight))
return NAN;
67 EForwardBackward startToMiddleFBInfo = mcSegmentLookUp.
areAlignedInMCTrack(ptrStartSegment, ptrMiddleSegment);
68 if (startToMiddleFBInfo == EForwardBackward::c_Invalid)
return NAN;
70 EForwardBackward middleToEndFBInfo = mcSegmentLookUp.
areAlignedInMCTrack(ptrMiddleSegment, ptrEndSegment);
71 if (middleToEndFBInfo == EForwardBackward::c_Invalid)
return NAN;
74 if (startToMiddleFBInfo != middleToEndFBInfo)
return NAN;
77 if ((startToMiddleFBInfo == EForwardBackward::c_Forward and middleToEndFBInfo == EForwardBackward::c_Forward) or
78 (
getAllowReverse() and startToMiddleFBInfo == EForwardBackward::c_Backward and middleToEndFBInfo == EForwardBackward::c_Backward)) {
83 Weight cellWeight = startSegment.size() + middleSegment.size() + endSegment.size();
84 return startToMiddleFBInfo > 0 ? cellWeight : -cellWeight;
100 const CDCAxialSegment2D* ptrStartSegment = segmentTriple.
getStartSegment();
101 if (not ptrStartSegment) {
102 B2WARNING(
"Start segment of segmentTriple is nullptr. Could not set fits.");
The Module parameter list class.
TrackingUtilities::EForwardBackward areAlignedInMCTrack(const ACDCHitCollection *ptrFromHits, const ACDCHitCollection *ptrToHits) const
Returns if the second collection of hits follows the first collection of hits in their common Monte C...
TrackingUtilities::CDCTrajectory3D getTrajectory3D(const ACDCHitCollection *ptrHits) const
Returns the trajectory of the collection of hits.
Specialisation of the lookup for the truth values of two dimensional segments.
static const CDCMCSegment2DLookUp & getInstance()
Getter for the singletone instance.
MCSymmetric< BaseSegmentTripleFilter > Super
Type of the super class.
MCAxialSegmentPairFilter m_mcAxialSegmentPairFilter
Instance of the cell filter to reject neighborhoods of false cells.
void initialize() final
Initialize the before event processing.
TrackingUtilities::Weight operator()(const TrackingUtilities::CDCSegmentTriple &segmentTriple) final
Check if the segment triple is aligned in the Monte Carlo track. Signals NAN if not.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
void setAllowReverse(bool allowReverse) override
Setter for the allow reverse parameter.
void setTrajectoryOf(const TrackingUtilities::CDCSegmentTriple &segmentTriple) const
Sets the trajectories of the segment triple from Monte Carlo information. Is executed for good segmen...
MCSegmentTripleFilter(bool allowReverse=true)
Constructor initializing the symmetry flag.
Mixin for filters that use Monte Carlo information.
void initialize() override
bool getAllowReverse() const
Class representing a pair of reconstructed axial segments in adjacent superlayer.
Class representing a triple of reconstructed segments in adjacent superlayer.
const CDCStereoSegment2D * getMiddleSegment() const
Getter for the middle stereo segment.
const CDCAxialSegment2D * getEndSegment() const
Getter for the end axial segment.
void setTrajectory3D(const CDCTrajectory3D &trajectory3D) const
Setter for the three dimensional helix trajectory.
CDCTrajectorySZ getTrajectorySZ() const
Getter for the linear trajectory in the sz direction.
const CDCAxialSegment2D * getStartSegment() const
Getter for the start axial segment.
Particle full three dimensional trajectory.
bool isFitted() const
Indicates if the line has been fitted.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Abstract base class for different kinds of events.