Belle II Software development
|
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. | |
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. | |
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 27 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 34 of file BestMatchContainer.h.
|
inline |
Add a new item with an estimator value.
item | item |
est | estimator |
estComparison | The default estimator will favor items with smaller estimates |
Definition at line 44 of file BestMatchContainer.h.
|
inline |
Definition at line 76 of file BestMatchContainer.h.
|
inline |
Definition at line 67 of file BestMatchContainer.h.
|
inlineprivate |
Set a new item as the best match.
Definition at line 86 of file BestMatchContainer.h.
|
private |
Stores the estimator value of the best match.
Definition at line 96 of file BestMatchContainer.h.
|
private |
Stores the best matched item.
Definition at line 93 of file BestMatchContainer.h.