CMS 3D CMS Logo

MatchByDEta.h
Go to the documentation of this file.
1 #ifndef MatchByDEta_h_
2 #define MatchByDEta_h_
3 
8 
9 #include <cmath>
10 
11 namespace reco {
12  template <typename T1, typename T2>
13  class MatchByDEta {
14  public:
15  MatchByDEta(const edm::ParameterSet& cfg) : maxDEta_(cfg.getParameter<double>("maxDeltaEta")) {}
16  bool operator()(const T1& t1, const T2& t2) const { return std::abs(t1.eta() - t2.eta()) < maxDEta_; }
17 
18  private:
19  double maxDEta_;
20  };
21 } // namespace reco
22 
23 #endif
bool operator()(const T1 &t1, const T2 &t2) const
Definition: MatchByDEta.h:16
MatchByDEta(const edm::ParameterSet &cfg)
Definition: MatchByDEta.h:15
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
fixed size matrix