Go to the documentation of this file.00001 #ifndef RecoAlgos_RangeSelector_h
00002 #define RecoAlgos_RangeSelector_h
00003
00004
00005
00006
00007
00008
00009 #include <string>
00010
00011 template<typename T, double (T::*fun)() const>
00012 struct RangeSelector {
00013 RangeSelector( double min, double max ) :
00014 min_( min ), max_( max ) { }
00015 bool operator()( const T & t ) const {
00016 double x = (t.*fun)();
00017 return min_ <= x && x <= max_;
00018 }
00019 private:
00020 double min_, max_;
00021 };
00022
00023 #endif