CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/RecoTracker/TkMSParametrization/interface/rangeIntersection.h

Go to the documentation of this file.
00001 #ifndef rangeIntersection_H
00002 #define rangeIntersection_H
00003 
00004 #include "TrackingTools/DetLayers/interface/rangesIntersect.h"
00005 #include <algorithm>
00006 
00015 template <class Range>
00016 inline Range rangeIntersection( const Range& a, const Range& b) {
00017 
00018   return Range( std::max(a.first,b.first),
00019                 std::min(a.second,b.second));
00020 }
00021 
00022 template <class Range, class Less>
00023 inline Range rangeIntersection( const Range& a, const Range& b, 
00024                                 const Less& less) {
00025 
00026   return Range( std::max( a.first, b.first, less),
00027                 std::min( a.second, b.second, less));
00028 }
00029 
00030 #endif
00031