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)
 
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 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.

41  {
42  phi1 = Phi_0_2pi(phi1);
43  phi2 = Phi_0_2pi(phi2);
44  return Phi_mpi_pi(phi1 - phi2);
45  }

References Phi_0_2pi(), and Phi_mpi_pi().

◆ Phi_0_2pi()

static double JetUtil::Phi_0_2pi ( double  x)
inlinestatic

Definition at line 25 of file JetUtil.h.

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  }

References M_PI, and x.

Referenced by dPhi(), and radius().

◆ Phi_mpi_pi()

static double JetUtil::Phi_mpi_pi ( double  x)
inlinestatic

Definition at line 33 of file JetUtil.h.

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  }

References M_PI, and x.

Referenced by dPhi().

◆ radius() [1/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.

61  {
62  return radius(t1->eta(), t1->phi(), t2->eta(), t2->phi());
63  }

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

◆ radius() [2/2]

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

Definition at line 47 of file JetUtil.h.

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  }

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

Referenced by radius().

RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
min
T min(T a, T b)
Definition: MathUtil.h:58
HLT_2018_cff.eta1
eta1
Definition: HLT_2018_cff.py:8220
DDAxes::x
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
JetUtil::Phi_mpi_pi
static double Phi_mpi_pi(double x)
Definition: JetUtil.h:33
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
JetUtil::radius
static double radius(double eta1, double phi1, double eta2, double phi2)
Definition: JetUtil.h:47
HLT_2018_cff.eta2
eta2
Definition: HLT_2018_cff.py:8221
TWOPI
#define TWOPI
Definition: DQMSourcePi0.cc:36
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
JetUtil::Phi_0_2pi
static double Phi_0_2pi(double x)
Definition: JetUtil.h:25