Belle II Software development
RangeInBox< AHitInBoxAlgorithm > Class Template Reference

Predicate class to check for the containment of items in a rangeobject in a hough space part. More...

#include <RangeInBox.h>

Public Types

using HoughBox = typename AHitInBoxAlgorithm::HoughBox
 The type of the underlying HoughBox (copied from the udnerlaying hit algorithm)
 

Public Member Functions

template<class ARangeObject >
Weight operator() (const ARangeObject &rangeObject, const HoughBox *box)
 When called, it goes through all items in the range object (e.g.
 

Public Attributes

const double minimalRatio = 0.6
 The minimal percentage of items of a given range that must belong to the box the be called a hit.
 

Detailed Description

template<class AHitInBoxAlgorithm>
class Belle2::TrackFindingCDC::RangeInBox< AHitInBoxAlgorithm >

Predicate class to check for the containment of items in a rangeobject in a hough space part.

Note this part this code defines the performance of the search in the hough plain quite significantly and there is probably room for improvement.

Definition at line 25 of file RangeInBox.h.

Member Typedef Documentation

◆ HoughBox

using HoughBox = typename AHitInBoxAlgorithm::HoughBox

The type of the underlying HoughBox (copied from the udnerlaying hit algorithm)

Definition at line 28 of file RangeInBox.h.

Member Function Documentation

◆ operator()()

Weight operator() ( const ARangeObject &  rangeObject,
const HoughBox box 
)
inline

When called, it goes through all items in the range object (e.g.

a CDCSegment) and checks the HitInBox algorithm passed as a template argument. If there is a certain amount of items of the range in the box, it returns the number of items as a weight, otherwise it returns NAN;

Definition at line 35 of file RangeInBox.h.

37 {
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;
46 }
47 }
48
49 if (numberOfPassedItems > minimalRatio * static_cast<double>(rangeObject.size())) {
50 return sumOfWeights;
51 } else {
52 return NAN;
53 }
54 }
const double minimalRatio
The minimal percentage of items of a given range that must belong to the box the be called a hit.
Definition: RangeInBox.h:57

Member Data Documentation

◆ minimalRatio

const double minimalRatio = 0.6

The minimal percentage of items of a given range that must belong to the box the be called a hit.

Definition at line 57 of file RangeInBox.h.


The documentation for this class was generated from the following file: