CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CommonTools/UtilAlgos/interface/MatchByDR.h

Go to the documentation of this file.
00001 #ifndef MatchByDR_h_
00002 #define MatchByDR_h_
00003 
00007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00008 #include "CommonTools/UtilAlgos/interface/DeltaR.h"
00009 
00010 namespace reco {
00011   template <typename T1, typename T2> class MatchByDR {
00012   public:
00013     MatchByDR (const edm::ParameterSet& cfg) :
00014       maxDR_(cfg.getParameter<double>("maxDeltaR")) {}
00015     bool operator() (const T1& t1, const T2& t2) const {
00016       return deltaR_(t1,t2)<maxDR_;
00017     }
00018   private:
00019     DeltaR<T1,T2> deltaR_;
00020     double maxDR_;
00021   };
00022 }
00023 
00024 
00025 #endif