![]() |
Belle II Software
release-06-01-15
|
Multiple entries can be added, but only the one will be kept, which has the best quality estimator. More...
#include <BestMatchContainer.h>
Public Types | |
typedef std::function< bool(TEstimator, TEstimator)> | EstimatorComparison |
Lambda typedef for the function comparing estimators. More... | |
Public Member Functions | |
bool | add (TItem item, TEstimator est, EstimatorComparison estComparison=[](TEstimator currentBest, TEstimator newEst) {return newEst< currentBest;}) |
Add a new item with an estimator value. More... | |
bool | hasMatch () const |
TItem const & | getBestMatch () const |
Private Member Functions | |
void | setBestMatch (TItem item, TEstimator est) |
Set a new item as the best match. | |
Private Attributes | |
std::optional< TItem > | m_bestMatch |
Stores the best matched item. | |
TEstimator | m_bestEstimator = TEstimator() |
Stores the estimator value of the best match. | |
Multiple entries can be added, but only the one will be kept, which has the best quality estimator.
This class can be used in cases where the best-match candidate is searched
Definition at line 25 of file BestMatchContainer.h.
typedef std::function< bool(TEstimator, TEstimator)> EstimatorComparison |
Lambda typedef for the function comparing estimators.
Returns true if the second parameter is a better estimation than the first one.
Definition at line 32 of file BestMatchContainer.h.
|
inline |
Add a new item with an estimator value.
estComparison | The default estimator will favor items with smaller estimates |
Definition at line 40 of file BestMatchContainer.h.
|
inline |
Definition at line 72 of file BestMatchContainer.h.
|
inline |
Definition at line 63 of file BestMatchContainer.h.