10#include <tracking/trackFindingCDC/findlets/base/Findlet.h>
11#include <tracking/trackFindingCDC/utilities/WeightedRelation.h>
20 namespace TrackFindingCDC {
39 template <
class ACollectorItem,
class ACollectionItem>
42 const ACollectionItem,
43 WeightedRelation<ACollectorItem, const ACollectionItem>> {
52 void apply(std::vector<ACollectorItem>& collectorItems,
const std::vector<ACollectionItem>& collectionItems,
53 std::vector<WeightedRelationItem>& weightedRelations)
override
55 for (ACollectorItem& collectorItem : collectorItems) {
56 match(collectorItem, collectionItems, weightedRelations);
59 std::sort(weightedRelations.begin(), weightedRelations.end());
68 virtual void match(ACollectorItem& collectorItem,
const std::vector<ACollectionItem>& collectionItems,
69 std::vector<WeightedRelationItem>& relationsForCollector)
71 for (
const ACollectionItem& collectionItem : collectionItems) {
72 Weight weight =
match(collectorItem, collectionItem);
73 relationsForCollector.emplace_back(&collectorItem, weight, &collectionItem);
82 virtual Weight
match(ACollectorItem& collectorItem __attribute__((unused)),
83 const ACollectionItem& collectionItem __attribute__((unused)))
Interface for a minimal algorithm part that wants to expose some parameters to a module.
Base class for a findlet, which outputs a list of weighted relations between elements in a list of Co...
virtual Weight match(ACollectorItem &collectorItem, const ACollectionItem &collectionItem)
Override this function to implement your own matching algorithm between one collector and one collect...
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...
void apply(std::vector< ACollectorItem > &collectorItems, const std::vector< ACollectionItem > &collectionItems, std::vector< WeightedRelationItem > &weightedRelations) override
Main function: create weighted relations between collectors and collection items using the implemente...
Type for two related objects with a weight.
Abstract base class for different kinds of events.