CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RangeObjectPairSelector.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_RangeObjectPairSelector_h
2 #define RecoAlgos_RangeObjectPairSelector_h
3 /* \class RangeObjectPairSelector
4  *
5  * \author Luca Lista, INFN
6  *
7  * $Id: RangeObjectPairSelector.h,v 1.4 2007/06/18 18:33:54 llista Exp $
8  */
9 
10 template<typename F>
12  typedef F function;
13  RangeObjectPairSelector( double min, double max, const F & fun ) :
14  min_( min ), max_( max ), fun_( fun ) { }
15  RangeObjectPairSelector( double min, double max ) :
16  min_( min ), max_( max ), fun_() { }
17  template<typename T1, typename T2>
18  bool operator()( const T1 & t1, const T2 & t2 ) const {
19  double x = fun_( t1, t2 );
20  return ( min_ <= x && x <= max_ );
21  }
22 
23 private:
24  double min_, max_;
26 };
27 
28 #endif
RangeObjectPairSelector(double min, double max, const F &fun)
RangeObjectPairSelector(double min, double max)
T min(T a, T b)
Definition: MathUtil.h:58
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
bool operator()(const T1 &t1, const T2 &t2) const