CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RangeSelector.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_RangeSelector_h
2 #define RecoAlgos_RangeSelector_h
3 /* \class RangeSelector
4  *
5  * \author Luca Lista, INFN
6  *
7  * $Id: RangeSelector.h,v 1.2 2012/06/26 21:13:12 wmtan Exp $
8  */
9 #include <string>
10 
11 template<typename T, double (T::*fun)() const>
12 struct RangeSelector {
13  RangeSelector( double min, double max ) :
14  min_( min ), max_( max ) { }
15  bool operator()( const T & t ) const {
16  double x = (t.*fun)();
17  return min_ <= x && x <= max_;
18  }
19 private:
20  double min_, max_;
21 };
22 
23 #endif
#define min(a, b)
Definition: mlp_lapack.h:161
const T & max(const T &a, const T &b)
bool operator()(const T &t) const
Definition: RangeSelector.h:15
RangeSelector(double min, double max)
Definition: RangeSelector.h:13
Definition: DDAxes.h:10
long double T