CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
rangesIntersect.h
Go to the documentation of this file.
1 #ifndef TrackingTools_DetLayers_rangesIntersect_h
2 #define TrackingTools_DetLayers_rangesIntersect_h
3 
13 template <typename Range>
14 inline bool rangesIntersect( const Range& a, const Range& b) {
15  return !( a.first > b.second || b.first > a.second);
16 }
17 
18 template <typename Range, typename Less>
19 inline bool rangesIntersect( const Range& a, const Range& b,
20  Less const &less) {
21  return !( less(b.second,a.first) || less(a.second,b.first));
22 }
23 template <typename Range, typename T>
24 inline bool rangesIntersect( const Range& a, const Range& b,
25  bool (*less)(T,T)) {
26  return !( less(b.second,a.first) || less(a.second,b.first));
27 }
28 #endif
bool rangesIntersect(const Range &a, const Range &b)
PixelRecoRange< float > Range
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
long double T