CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
rangeIntersection.h
Go to the documentation of this file.
1 #ifndef rangeIntersection_H
2 #define rangeIntersection_H
3 
5 #include <algorithm>
6 
15 template <class Range>
16 inline Range rangeIntersection( const Range& a, const Range& b) {
17 
18  return Range( std::max(a.first,b.first),
19  std::min(a.second,b.second));
20 }
21 
22 template <class Range, class Less>
23 inline Range rangeIntersection( const Range& a, const Range& b,
24  const Less& less) {
25 
26  return Range( std::max( a.first, b.first, less),
27  std::min( a.second, b.second, less));
28 }
29 
30 #endif
31 
T min(T a, T b)
Definition: MathUtil.h:58
PixelRecoRange< float > Range
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
Range rangeIntersection(const Range &a, const Range &b)