File indexing completed on 2023-03-17 10:45:40
0001 #ifndef RecoAlgos_RangeObjectPairSelector_h
0002 #define RecoAlgos_RangeObjectPairSelector_h
0003
0004
0005
0006
0007
0008
0009
0010 template <typename F>
0011 struct RangeObjectPairSelector {
0012 typedef F function;
0013 RangeObjectPairSelector(double min, double max, const F& fun) : min_(min), max_(max), fun_(fun) {}
0014 RangeObjectPairSelector(double min, double max) : min_(min), max_(max), fun_() {}
0015 template <typename T1, typename T2>
0016 bool operator()(const T1& t1, const T2& t2) const {
0017 double x = fun_(t1, t2);
0018 return (min_ <= x && x <= max_);
0019 }
0020
0021 private:
0022 double min_, max_;
0023 F fun_;
0024 };
0025
0026 #endif