CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Ellipse.h
Go to the documentation of this file.
1 #ifndef Ellipse_h
2 #define Ellipse_h
3 
5 
6 namespace reco{
7 
8  inline double deltaEta2(double eta1, double eta2){
9  double deltaEta = eta1 - eta2;
10  return deltaEta*deltaEta;
11  }
12 
13  template <typename T1, typename T2>
14  inline double deltaEta2(const T1& t1, const T2& t2){
15  return deltaEta2(t1.eta(), t2.eta());
16  }
17 
18  template <typename T1, typename T2>
19  inline double ellipse (const T1& t1, const T2& t2, double rPhi, double rEta){
20  double dEta2 = deltaEta2(t1.eta(), t2.eta());
21  double dPhi = deltaPhi(t1.phi(), t2.phi());
22  double distance = dEta2/(rEta*rEta) + (dPhi*dPhi)/(rPhi*rPhi);
23  return distance;
24  }
25 
26 }
27 #endif
28 
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12
double ellipse(const T1 &t1, const T2 &t2, double rPhi, double rEta)
Definition: Ellipse.h:19
double deltaEta2(double eta1, double eta2)
Definition: Ellipse.h:8