File indexing completed on 2024-04-06 12:01:16
0001 #ifndef MatchByDR_h_
0002 #define MatchByDR_h_
0003
0004
0005
0006
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 #include "CommonTools/UtilAlgos/interface/DeltaR.h"
0009
0010 namespace reco {
0011 template <typename T1, typename T2>
0012 class MatchByDR {
0013 public:
0014 MatchByDR(const edm::ParameterSet& cfg) : maxDR_(cfg.getParameter<double>("maxDeltaR")) {}
0015 bool operator()(const T1& t1, const T2& t2) const { return deltaR_(t1, t2) < maxDR_; }
0016
0017 private:
0018 DeltaR<T1, T2> deltaR_;
0019 double maxDR_;
0020 };
0021 }
0022
0023 #endif