File indexing completed on 2023-03-17 10:45:40
0001 #ifndef RecoAlgos_RangeSelector_h
0002 #define RecoAlgos_RangeSelector_h
0003
0004
0005
0006
0007
0008
0009 #include <string>
0010
0011 template <typename T, double (T::*fun)() const>
0012 struct RangeSelector {
0013 RangeSelector(double min, double max) : min_(min), max_(max) {}
0014 bool operator()(const T& t) const {
0015 double x = (t.*fun)();
0016 return min_ <= x && x <= max_;
0017 }
0018
0019 private:
0020 double min_, max_;
0021 };
0022
0023 #endif