File indexing completed on 2024-04-06 12:28:51
0001 #ifndef rangeIntersection_H
0002 #define rangeIntersection_H
0003
0004 #include "TrackingTools/DetLayers/interface/rangesIntersect.h"
0005 #include <algorithm>
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 template <class Range>
0016 inline Range rangeIntersection(const Range& a, const Range& b) {
0017 return Range(std::max(a.first, b.first), std::min(a.second, b.second));
0018 }
0019
0020 template <class Range, class Less>
0021 inline Range rangeIntersection(const Range& a, const Range& b, const Less& less) {
0022 return Range(std::max(a.first, b.first, less), std::min(a.second, b.second, less));
0023 }
0024
0025 #endif