Belle II Software development
TwoHitInBoxAlgorithm< AHitInBoxAlgorithm, AnotherHitInBoxAlgorithm > Class Template Reference

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

#include <TwoHitInBoxAlgorithms.h>

Public Types

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

Public Member Functions

template<class AObject >
Weight operator() (const AObject &object, const HoughBox *box)
 Returns the sum of the resulting weights of both algorithms (of not NAN).
 

Detailed Description

template<class AHitInBoxAlgorithm, class AnotherHitInBoxAlgorithm>
class Belle2::TrackFindingCDC::TwoHitInBoxAlgorithm< AHitInBoxAlgorithm, AnotherHitInBoxAlgorithm >

Predicate class to check for the containment of items in a hough space part with two algorithms.

The resulting weight is added. If one of the two algorithms gives NaN, this particular result is not used (only the other). If both give NaN, the result will also be NaN.

Definition at line 26 of file TwoHitInBoxAlgorithms.h.

Member Typedef Documentation

◆ HoughBox

using HoughBox = typename AHitInBoxAlgorithm::HoughBox

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

Definition at line 29 of file TwoHitInBoxAlgorithms.h.

Member Function Documentation

◆ operator()()

Weight operator() ( const AObject &  object,
const HoughBox box 
)
inline

Returns the sum of the resulting weights of both algorithms (of not NAN).

Definition at line 35 of file TwoHitInBoxAlgorithms.h.

37 {
38 AHitInBoxAlgorithm hitInBoxAlgorithm;
39 AnotherHitInBoxAlgorithm anotherHitInBoxAlgorithm;
40
41 const Weight& firstResult = hitInBoxAlgorithm(object, box);
42 const Weight& secondResult = anotherHitInBoxAlgorithm(object, box);
43
44 if (std::isnan(firstResult) and std::isnan(secondResult)) {
45 return NAN;
46 } else if (std::isnan(firstResult)) {
47 return secondResult;
48 } else if (std::isnan(secondResult)) {
49 return firstResult;
50 } else {
51 return firstResult + secondResult;
52 }
53 }

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