10#include <tracking/trackFindingCDC/findlets/base/Findlet.h>
12#include <tracking/trackFindingCDC/numerics/WeightComperator.h>
14#include <tracking/trackFindingCDC/utilities/WeightedRelation.h>
15#include <tracking/trackFindingCDC/utilities/Algorithms.h>
25 namespace TrackFindingCDC {
42 template <
class ACollectorItem,
class ACollectionItem>
44 public Findlet<WeightedRelation<ACollectorItem, const ACollectionItem>> {
53 void apply(std::vector<WeightedRelationItem>& weightedRelations)
override
55 std::vector<WeightedRelationItem> selectedWeightedRelations;
61 while (not weightedRelations.empty()) {
63 const auto maxElement = *(std::min_element(weightedRelations.begin(), weightedRelations.end(),
GreaterWeight()));
64 selectedWeightedRelations.push_back(maxElement);
67 return item.getFrom() == maxElement.getFrom() or item.getTo() == maxElement.getTo();
70 erase_remove_if(weightedRelations, itemSharesFromOrTo);
73 std::sort(selectedWeightedRelations.begin(), selectedWeightedRelations.end());
74 weightedRelations.swap(selectedWeightedRelations);
Selector to remove all relations in the list, which share the same collection item - except the one w...
void apply(std::vector< WeightedRelationItem > &weightedRelations) override
Main function of this class doing the relation selection.
Interface for a minimal algorithm part that wants to expose some parameters to a module.
Type for two related objects with a weight.
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...