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 23 of file JetUtil.h.

Member Function Documentation

◆ dPhi()

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

Definition at line 41 of file JetUtil.h.

References Phi_0_2pi(), and Phi_mpi_pi().

41  {
42  phi1 = Phi_0_2pi(phi1);
43  phi2 = Phi_0_2pi(phi2);
44  return Phi_mpi_pi(phi1 - phi2);
45  }
static double Phi_mpi_pi(double x)
Definition: JetUtil.h:33
static double Phi_0_2pi(double x)
Definition: JetUtil.h:25

◆ Phi_0_2pi()

static double JetUtil::Phi_0_2pi ( double  x)
inlinestatic

Definition at line 25 of file JetUtil.h.

References M_PI, and x.

Referenced by dPhi(), and radius().

25  {
26  while (x >= 2 * M_PI)
27  x -= 2 * M_PI;
28  while (x < 0.)
29  x += 2 * M_PI;
30  return x;
31  }
#define M_PI

◆ Phi_mpi_pi()

static double JetUtil::Phi_mpi_pi ( double  x)
inlinestatic

Definition at line 33 of file JetUtil.h.

References M_PI, and x.

Referenced by dPhi().

33  {
34  while (x >= M_PI)
35  x -= 2 * M_PI;
36  while (x < -M_PI)
37  x += 2 * M_PI;
38  return x;
39  }
#define M_PI

◆ radius() [1/2]

static double JetUtil::radius ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
)
inlinestatic

Definition at line 47 of file JetUtil.h.

References HLT_2024v14_cff::eta1, HLT_2024v14_cff::eta2, M_PI, SiStripPI::min, Phi_0_2pi(), mathSSE::sqrt(), and TWOPI.

Referenced by radius().

47  {
48  const double TWOPI = 2.0 * M_PI;
49 
50  phi1 = Phi_0_2pi(phi1);
51  phi2 = Phi_0_2pi(phi2);
52 
53  double dphi = Phi_0_2pi(phi1 - phi2);
54  dphi = std::min(dphi, TWOPI - dphi);
55  double deta = eta1 - eta2;
56 
57  return sqrt(deta * deta + dphi * dphi);
58  }
T sqrt(T t)
Definition: SSEVec.h:19
#define TWOPI
#define M_PI
static double Phi_0_2pi(double x)
Definition: JetUtil.h:25

◆ radius() [2/2]

template<typename T1 , typename T2 >
static double JetUtil::radius ( const T1 &  t1,
const T2 &  t2 
)
inlinestatic

Definition at line 61 of file JetUtil.h.

References radius(), RandomServiceHelper::t1, and RandomServiceHelper::t2.

61  {
62  return radius(t1->eta(), t1->phi(), t2->eta(), t2->phi());
63  }
static double radius(double eta1, double phi1, double eta2, double phi2)
Definition: JetUtil.h:47