CMS 3D CMS Logo

MatchByDRDPt.h

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

Generated on Tue Jun 9 17:42:12 2009 for CMSSW by  doxygen 1.5.4