9#include <tracking/trackFindingCDC/collectors/matchers/MatcherInterface.h>
11#include <tracking/trackFindingCDC/numerics/WeightComperator.h>
13#include <gtest/gtest.h>
16using namespace TrackFindingCDC;
21 Weight
match(
int& a,
const double& b)
override
27 TEST(TrackFindingCDCTest, matcher_interface)
29 SimpleMatcher matcher;
31 std::vector<WeightedRelation<int, const double>> relations;
33 std::vector<int> collectorItems = {1, 2};
34 std::vector<double> collectionItems = {2.1, 2.2, 2.3};
36 matcher.apply(collectorItems, collectionItems, relations);
38 std::sort(relations.begin(), relations.end(),
GreaterWeight());
40 ASSERT_EQ(relations.size(), 6);
41 ASSERT_EQ(relations[5].getWeight(), 3.1);
42 ASSERT_EQ(relations[4].getWeight(), 3.2);
43 ASSERT_EQ(relations[3].getWeight(), 3.3);
44 ASSERT_EQ(relations[2].getWeight(), 4.1);
45 ASSERT_EQ(relations[1].getWeight(), 4.2);
46 ASSERT_EQ(relations[0].getWeight(), 4.3);
Base class for a findlet, which outputs a list of weighted relations between elements in a list of Co...
virtual void match(ACollectorItem &collectorItem, const std::vector< ACollectionItem > &collectionItems, std::vector< WeightedRelationItem > &relationsForCollector)
Override this function to implement your own matching algorithm between one collector and many collec...
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...