1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#ifndef RecoAlgos_RangeObjectPairSelector_h
#define RecoAlgos_RangeObjectPairSelector_h
/* \class RangeObjectPairSelector
*
* \author Luca Lista, INFN
*
* $Id: RangeObjectPairSelector.h,v 1.4 2007/06/18 18:33:54 llista Exp $
*/
template <typename F>
struct RangeObjectPairSelector {
typedef F function;
RangeObjectPairSelector(double min, double max, const F& fun) : min_(min), max_(max), fun_(fun) {}
RangeObjectPairSelector(double min, double max) : min_(min), max_(max), fun_() {}
template <typename T1, typename T2>
bool operator()(const T1& t1, const T2& t2) const {
double x = fun_(t1, t2);
return (min_ <= x && x <= max_);
}
private:
double min_, max_;
F fun_;
};
#endif
|