CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/RecoTauTag/TauTagTools/interface/Ellipse.h

Go to the documentation of this file.
00001 #ifndef Ellipse_h
00002 #define Ellipse_h
00003 
00004 #include "DataFormats/Math/interface/deltaPhi.h"
00005 
00006 namespace reco{
00007   
00008   inline double deltaEta2(double eta1, double eta2){
00009     double deltaEta = eta1 - eta2;
00010     return deltaEta*deltaEta;
00011   }
00012   
00013   template <typename T1, typename T2>
00014   inline double deltaEta2(const T1& t1, const T2& t2){
00015     return deltaEta2(t1.eta(), t2.eta());
00016   }
00017   
00018   template <typename T1, typename T2>
00019   inline double ellipse (const T1& t1, const T2& t2, double rPhi, double rEta){
00020     double dEta2 = deltaEta2(t1.eta(), t2.eta());
00021     double dPhi = deltaPhi(t1.phi(), t2.phi());
00022     double distance = dEta2/(rEta*rEta) + (dPhi*dPhi)/(rPhi*rPhi);
00023     return distance;
00024   }
00025 
00026 }
00027 #endif 
00028