CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
reco::MatchLessByDEta< C1, C2 > Struct Template Reference

#include <MatchLessByDEta.h>

Public Member Functions

 MatchLessByDEta (const edm::ParameterSet &cfg, const C1 &c1, const C2 &c2)
 
bool operator() (const std::pair< size_t, size_t > &p1, const std::pair< size_t, size_t > &p2) const
 

Private Attributes

const C1 & c1_
 
const C2 & c2_
 

Detailed Description

template<typename C1, typename C2>
struct reco::MatchLessByDEta< C1, C2 >

Definition at line 11 of file MatchLessByDEta.h.

Constructor & Destructor Documentation

template<typename C1 , typename C2 >
reco::MatchLessByDEta< C1, C2 >::MatchLessByDEta ( const edm::ParameterSet cfg,
const C1 &  c1,
const C2 &  c2 
)
inline

Definition at line 13 of file MatchLessByDEta.h.

13 : c1_(c1), c2_(c2) {}

Member Function Documentation

template<typename C1 , typename C2 >
bool reco::MatchLessByDEta< C1, C2 >::operator() ( const std::pair< size_t, size_t > &  p1,
const std::pair< size_t, size_t > &  p2 
) const
inline

Definition at line 14 of file MatchLessByDEta.h.

References reco::MatchLessByDEta< C1, C2 >::c1_, and reco::MatchLessByDEta< C1, C2 >::c2_.

14  {
15  typedef typename C1::value_type T1;
16  typedef typename C2::value_type T2;
17  const T1& p1_1 = c1_[p1.first];
18  const T2& p1_2 = c2_[p1.second];
19  const T1& p2_1 = c1_[p2.first];
20  const T2& p2_2 = c2_[p2.second];
21  if (fabs(p1_1.eta() - p1_2.eta()) < fabs(p2_1.eta() - p2_2.eta()))
22  return true;
23  return false;
24  }
const TString p2
Definition: fwPaths.cc:13
const TString p1
Definition: fwPaths.cc:12

Member Data Documentation

template<typename C1 , typename C2 >
const C1& reco::MatchLessByDEta< C1, C2 >::c1_
private

Definition at line 27 of file MatchLessByDEta.h.

Referenced by reco::MatchLessByDEta< C1, C2 >::operator()().

template<typename C1 , typename C2 >
const C2& reco::MatchLessByDEta< C1, C2 >::c2_
private

Definition at line 28 of file MatchLessByDEta.h.

Referenced by reco::MatchLessByDEta< C1, C2 >::operator()().