CMS 3D CMS Logo

reco::MatchLessByDPt< C1, C2 > Struct Template Reference

#include <PhysicsTools/UtilAlgos/interface/MatchLessByDPt.h>

List of all members.

Public Member Functions

 MatchLessByDPt (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::MatchLessByDPt< C1, C2 >

Definition at line 11 of file MatchLessByDPt.h.


Constructor & Destructor Documentation

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

Definition at line 13 of file MatchLessByDPt.h.

00014                                                  :
00015 //       deltaR_(cfg), 
00016       c1_(c1), c2_(c2) {}
    bool operator() (const std::pair<size_t,size_t>& p1,


Member Function Documentation

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

Definition at line 17 of file MatchLessByDPt.h.

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

00018                                                              {
00019       typedef typename C1::value_type T1;
00020       typedef typename C2::value_type T2;
00021       const T1& p1_1 = c1_[p1.first];
00022       const T2& p1_2 = c2_[p1.second];
00023       const T1& p2_1 = c1_[p2.first];
00024       const T2& p2_2 = c2_[p2.second];
00025       if ( fabs(p1_1.pt()-p1_2.pt())/p1_2.pt() <
00026            fabs(p2_1.pt()-p2_2.pt())/p2_2.pt() )  return true;
00027       return false;
00028     }


Member Data Documentation

template<typename C1, typename C2>
const C1& reco::MatchLessByDPt< C1, C2 >::c1_ [private]

Definition at line 31 of file MatchLessByDPt.h.

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

template<typename C1, typename C2>
const C2& reco::MatchLessByDPt< C1, C2 >::c2_ [private]

Definition at line 32 of file MatchLessByDPt.h.

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


The documentation for this struct was generated from the following file:
Generated on Tue Jun 9 18:51:16 2009 for CMSSW by  doxygen 1.5.4