Belle II Software development
AdderInterface.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <tracking/trackFindingCDC/findlets/base/Findlet.h>
11#include <tracking/trackFindingCDC/utilities/WeightedRelation.h>
12
13namespace Belle2 {
18 namespace TrackFindingCDC {
37 template <class ACollectorItem, class ACollectionItem>
39 public Findlet<WeightedRelation<ACollectorItem, const ACollectionItem>&> {
40 public:
43
45 void apply(std::vector<WeightedRelationItem>& weightedRelations) override
46 {
47 for (const WeightedRelationItem& relationItem : weightedRelations) {
48 ACollectorItem& collectorItem = *relationItem.getFrom();
49 const ACollectionItem& collectionItem = *relationItem.getTo();
50 Weight weight = relationItem.getWeight();
51 add(collectorItem, collectionItem, weight);
52 }
53 }
54
55 protected:
57 virtual void add(ACollectorItem& collectorItem __attribute__((unused)),
58 const ACollectionItem& collectionItem __attribute__((unused)),
59 Weight weight __attribute__((unused)))
60 {
61 }
62 };
63 }
65}
Base class for a findlet, which uses a reduced/thinned list of weighted relations between collector a...
void apply(std::vector< WeightedRelationItem > &weightedRelations) override
Main function to do the adding. Override the add function below in your derived class.
virtual void add(ACollectorItem &collectorItem, const ACollectionItem &collectionItem, Weight weight)
Override this function to implement how a collection item should be matched to a collector item.
Interface for a minimal algorithm part that wants to expose some parameters to a module.
Definition: Findlet.h:26
Type for two related objects with a weight.
Abstract base class for different kinds of events.