CMS 3D CMS Logo

Static Public Member Functions

JetUtil Class Reference

#include <JetUtil.h>

List of all members.

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)
template<typename T1 , typename T2 >
static double radius (const T1 &t1, const T2 &t2)
static double radius (double eta1, double phi1, double eta2, double phi2)

Detailed Description

Definition at line 20 of file JetUtil.h.


Member Function Documentation

static double JetUtil::dPhi ( double  phi1,
double  phi2 
) [inline, static]

Definition at line 35 of file JetUtil.h.

References Phi_0_2pi(), and Phi_mpi_pi().

                                           {
   phi1=Phi_0_2pi(phi1);
   phi2=Phi_0_2pi(phi2);
   return Phi_mpi_pi(phi1-phi2);
}
static double JetUtil::Phi_0_2pi ( double  x) [inline, static]

Definition at line 23 of file JetUtil.h.

References M_PI, and x.

Referenced by dPhi(), and radius().

                                  {
  while (x >= 2*M_PI) x -= 2*M_PI;
  while (x <     0.)  x += 2*M_PI;
  return x;
}
static double JetUtil::Phi_mpi_pi ( double  x) [inline, static]

Definition at line 29 of file JetUtil.h.

References M_PI, and x.

Referenced by dPhi().

                                   {
   while (x >= M_PI) x -= 2*M_PI;
   while (x < -M_PI) x += 2*M_PI;
   return x;
}
template<typename T1 , typename T2 >
static double JetUtil::radius ( const T1 &  t1,
const T2 &  t2 
) [inline, static]

Definition at line 55 of file JetUtil.h.

References radius().

                                                                                   {
  return radius(t1->eta(),t1->phi(),t2->eta(),t2->phi());
}
static double JetUtil::radius ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
) [inline, static]

Definition at line 41 of file JetUtil.h.

References M_PI, siStripFEDMonitor_P5_cff::Min, Phi_0_2pi(), mathSSE::sqrt(), and TWOPI.

Referenced by radius().

                                                                       {
 
  const double TWOPI= 2.0*M_PI;
 
  phi1=Phi_0_2pi(phi1);
  phi2=Phi_0_2pi(phi2);
 
  double dphi=Phi_0_2pi(phi1-phi2);
  dphi = TMath::Min(dphi,TWOPI-dphi);
  double deta = eta1-eta2;
 
  return sqrt(deta*deta+dphi*dphi);
}