8#include <tracking/trackFindingCDC/filters/segmentRelation/BaseSegmentRelationFilter.h>
10#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
11#include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit2D.h>
12#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
14#include <tracking/trackFindingCDC/filters/base/RelationFilter.icc.h>
16#include <tracking/trackFindingCDC/numerics/Weight.h>
18#include <tracking/trackFindingCDC/utilities/Relation.h>
19#include <tracking/trackFindingCDC/utilities/VectorRange.h>
21#include <tracking/trackFindingCDC/utilities/Functional.h>
28using namespace TrackFindingCDC;
38 const std::vector<const CDCSegment2D*>& segments)
const
40 assert(std::is_sorted(segments.begin(), segments.end(),
LessOf<Deref>()) &&
41 "Expected segments to be sorted");
44 std::equal_range(segments.begin(), segments.end(), from,
LessOf<Deref>())};
46 return {tos.
begin(), tos.end()};
53 if (from == to)
return NAN;
54 if ((from ==
nullptr) or (to ==
nullptr))
return NAN;
57 std::vector<const CDCWireHit*> fromWireHits;
58 fromWireHits.reserve(from->size());
60 fromWireHits.push_back(&recoHit2D.getWireHit());
62 std::sort(fromWireHits.begin(), fromWireHits.end());
65 if (std::binary_search(fromWireHits.begin(), fromWireHits.end(), &recoHit2D.getWireHit())) {
70 if (1.0 * nOverlap / from->size() > 0.8) {
virtual ~BaseSegmentRelationFilter()
Default destructor.
Weight operator()(const Relation< const CDCSegment2D > &relation) override
Main filter method overriding the filter interface method.
std::vector< const CDCSegment2D * > getPossibleTos(const CDCSegment2D *from, const std::vector< const CDCSegment2D * > &segments) const final
Returns all equivalent segment in the range.
BaseSegmentRelationFilter()
Default constructor.
Class representing a two dimensional reconstructed hit in the central drift chamber.
A reconstructed sequence of two dimensional hits in one super layer.
A pair of iterators usable with the range base for loop.
Iterator begin() const
Begin of the range for range based for.
Base class for filtering the neighborhood of objects.
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.
Abstract base class for different kinds of events.
Functor factory turning a binary functor and two functors into a new functor which executes the binar...