CMS 3D CMS Logo

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, Less const& less) {
20  return !(less(b.second, a.first) | less(a.second, b.first));
21 }
22 template <typename Range, typename T>
23 inline bool rangesIntersect(const Range& a, const Range& b, bool (*less)(T, T)) {
24  return !(less(b.second, a.first) | less(a.second, b.first));
25 }
26 #endif
PixelRecoRange< float > Range
bool rangesIntersect(const Range &a, const Range &b)
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
long double T