10#include <tracking/trackFindingCDC/numerics/Weight.h>
18 namespace TrackFindingCDC {
24 template<
class AHitInBoxAlgorithm>
28 using HoughBox =
typename AHitInBoxAlgorithm::HoughBox;
34 template<
class ARangeObject>
38 AHitInBoxAlgorithm hitInBoxAlgorithm;
39 double sumOfWeights = 0;
40 double numberOfPassedItems = 0;
41 for (
const auto& item : rangeObject) {
42 const double hitWeight = hitInBoxAlgorithm(item, box);
43 if (not std::isnan(hitWeight)) {
44 numberOfPassedItems++;
45 sumOfWeights += hitWeight;
49 if (numberOfPassedItems >
minimalRatio *
static_cast<double>(rangeObject.size())) {
Predicate class to check for the containment of items in a rangeobject in a hough space part.
Weight operator()(const ARangeObject &rangeObject, const HoughBox *box)
When called, it goes through all items in the range object (e.g.
typename AHitInBoxAlgorithm::HoughBox HoughBox
The type of the underlying HoughBox (copied from the udnerlaying hit algorithm)
const double minimalRatio
The minimal percentage of items of a given range that must belong to the box the be called a hit.
Abstract base class for different kinds of events.