CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/CommonTools/UtilAlgos/interface/MatchByDEta.h

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