CMS 3D CMS Logo

List of all members | Static Public Member Functions
JetUtil Class Reference

#include <JetUtil.h>

Static Public Member Functions

static double dPhi (double phi1, double phi2)
 
static double Phi_0_2pi (double x)
 
static double Phi_mpi_pi (double x)
 
static double radius (double eta1, double phi1, double eta2, double phi2)
 
template<typename T1 , typename T2 >
static double radius (const T1 &t1, const T2 &t2)
 

Detailed Description

Definition at line 21 of file JetUtil.h.

Member Function Documentation

static double JetUtil::dPhi ( double  phi1,
double  phi2 
)
inlinestatic

Definition at line 36 of file JetUtil.h.

36  {
37  phi1=Phi_0_2pi(phi1);
38  phi2=Phi_0_2pi(phi2);
39  return Phi_mpi_pi(phi1-phi2);
40 }
static double Phi_mpi_pi(double x)
Definition: JetUtil.h:30
static double Phi_0_2pi(double x)
Definition: JetUtil.h:24
static double JetUtil::Phi_0_2pi ( double  x)
inlinestatic

Definition at line 24 of file JetUtil.h.

References M_PI, and x.

24  {
25  while (x >= 2*M_PI) x -= 2*M_PI;
26  while (x < 0.) x += 2*M_PI;
27  return x;
28 }
#define M_PI
static double JetUtil::Phi_mpi_pi ( double  x)
inlinestatic

Definition at line 30 of file JetUtil.h.

References M_PI, and x.

30  {
31  while (x >= M_PI) x -= 2*M_PI;
32  while (x < -M_PI) x += 2*M_PI;
33  return x;
34 }
#define M_PI
static double JetUtil::radius ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
)
inlinestatic

Definition at line 42 of file JetUtil.h.

References M_PI, min(), mathSSE::sqrt(), and TWOPI.

42  {
43 
44  const double TWOPI= 2.0*M_PI;
45 
46  phi1=Phi_0_2pi(phi1);
47  phi2=Phi_0_2pi(phi2);
48 
49  double dphi=Phi_0_2pi(phi1-phi2);
50  dphi = std::min(dphi,TWOPI-dphi);
51  double deta = eta1-eta2;
52 
53  return sqrt(deta*deta+dphi*dphi);
54 }
T sqrt(T t)
Definition: SSEVec.h:18
#define TWOPI
EgammaCoreTools.
Definition: DQMSourcePi0.cc:40
T min(T a, T b)
Definition: MathUtil.h:58
#define M_PI
static double Phi_0_2pi(double x)
Definition: JetUtil.h:24
template<typename T1 , typename T2 >
static double JetUtil::radius ( const T1 &  t1,
const T2 &  t2 
)
inlinestatic

Definition at line 56 of file JetUtil.h.

References TCMET_cfi::radius.

56  {
57  return radius(t1->eta(),t1->phi(),t2->eta(),t2->phi());
58 }
static double radius(double eta1, double phi1, double eta2, double phi2)
Definition: JetUtil.h:42
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16