CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CommonTools/Utils/interface/RangeSelector.h

Go to the documentation of this file.
00001 #ifndef RecoAlgos_RangeSelector_h
00002 #define RecoAlgos_RangeSelector_h
00003 /* \class RangeSelector
00004  *
00005  * \author Luca Lista, INFN
00006  *
00007  * $Id: RangeSelector.h,v 1.1 2009/02/24 14:40:26 llista Exp $
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