CMS 3D CMS Logo

Functions | Variables
kinem Namespace Reference

Functions

double delta_eta (double eta1, double eta2)
 
double delta_phi (double ph11, double phi2)
 
double delta_R (double eta1, double phi1, double eta2, double phi2)
 
double eta (double x, double y, double z)
 
double eta (double xyz1[3], double xyz2[3])
 
double eta (float xyz1[3], float xyz2[3])
 
double eta (double th)
 
double phi (double x, double y)
 
double phi (double xy1[2], double xy2[2])
 
double phi (float xy1[2], float xy2[2])
 
double signed_delta_phi (double ph11, double phi2)
 
double tanl_from_theta (double theta)
 
double theta (double x, double y, double z)
 
double theta (double xyz1[3], double xyz2[3])
 
double theta (float xyz1[3], float xyz2[3])
 
double theta (double etap)
 
double theta_from_tanl (double tanl)
 
void uvectors (double u[3], double xyz1[3], double xyz2[3])
 
void uvectors (float u[3], float xyz1[3], float xyz2[3])
 
double y (double E, double pz)
 

Variables

const float EPSILON = 1.E-10
 
const float ETA_LIMIT = 15.0
 
const double PI = 2.0 * acos(0.)
 
const double TWOPI = 2.0 * PI
 

Function Documentation

◆ delta_eta()

double kinem::delta_eta ( double  eta1,
double  eta2 
)
inline

Definition at line 89 of file AnglesUtil.h.

References HLT_2024v12_cff::eta1, and HLT_2024v12_cff::eta2.

◆ delta_phi()

double kinem::delta_phi ( double  ph11,
double  phi2 
)
inline

Definition at line 84 of file AnglesUtil.h.

References PHI, and TWOPI.

Referenced by delta_R().

84  {
85  double PHI = fabs(phi1 - phi2);
86  return (PHI <= PI) ? PHI : kinem::TWOPI - PHI;
87 }
const double TWOPI
Definition: AnglesUtil.h:20
#define PHI

◆ delta_R()

double kinem::delta_R ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
)
inline

Definition at line 106 of file AnglesUtil.h.

References delta_phi(), HLT_2024v12_cff::eta1, HLT_2024v12_cff::eta2, and mathSSE::sqrt().

Referenced by EnergyScaleAnalyzer::analyze(), external::HEPTopTaggerV2_fixed_R::djademod(), EnergyScaleAnalyzer::fillTree(), and CosmicRegionalSeedGenerator::regions().

106  {
107  double deta = eta1 - eta2;
108  double dphi = kinem::delta_phi(phi1, phi2);
109  return sqrt(deta * deta + dphi * dphi);
110 }
T sqrt(T t)
Definition: SSEVec.h:19
double delta_phi(double ph11, double phi2)
Definition: AnglesUtil.h:84

◆ eta() [1/4]

double kinem::eta ( double  x,
double  y,
double  z 
)
inline

Definition at line 142 of file AnglesUtil.h.

References EPSILON, dqm-mbProfile::log, mathSSE::sqrt(), x, y(), and detailsBasic3DVector::z.

142  {
143  return 0.5 * log((sqrt(x * x + y * y + z * z) + z + EPSILON) / (sqrt(x * x + y * y + z * z) - z + EPSILON));
144 }
float float float z
T sqrt(T t)
Definition: SSEVec.h:19
const float EPSILON
Definition: AnglesUtil.h:22
double y(double E, double pz)
Definition: AnglesUtil.h:154
float x

◆ eta() [2/4]

double kinem::eta ( double  xyz1[3],
double  xyz2[3] 
)
inline

Definition at line 129 of file AnglesUtil.h.

References eta(), x, y(), and detailsBasic3DVector::z.

129  {
130  double x = xyz2[0] - xyz1[0];
131  double y = xyz2[1] - xyz1[1];
132  double z = xyz2[2] - xyz1[2];
133  return eta(x, y, z);
134 }
float float float z
double eta(double th)
Definition: AnglesUtil.h:146
double y(double E, double pz)
Definition: AnglesUtil.h:154
float x

◆ eta() [3/4]

double kinem::eta ( float  xyz1[3],
float  xyz2[3] 
)
inline

Definition at line 136 of file AnglesUtil.h.

References eta().

136  {
137  double dxyz1[3] = {xyz1[0], xyz1[1], xyz1[2]};
138  double dxyz2[3] = {xyz2[0], xyz2[1], xyz2[2]};
139  return eta(dxyz1, dxyz2);
140 }
double eta(double th)
Definition: AnglesUtil.h:146

◆ eta() [4/4]

double kinem::eta ( double  th)
inline

Definition at line 146 of file AnglesUtil.h.

References ETA_LIMIT, dqm-mbProfile::log, and funct::tan().

Referenced by eta().

146  {
147  if (th == 0)
148  return ETA_LIMIT;
149  if (th >= PI - 0.0001)
150  return -ETA_LIMIT;
151  return -log(tan(th / 2.0));
152 }
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
const float ETA_LIMIT
Definition: AnglesUtil.h:21

◆ phi() [1/3]

double kinem::phi ( double  x,
double  y 
)
inline

Definition at line 67 of file AnglesUtil.h.

References PHI, TWOPI, x, and y().

67  {
68  double PHI = atan2(y, x);
69  return (PHI >= 0) ? PHI : kinem::TWOPI + PHI;
70 }
const double TWOPI
Definition: AnglesUtil.h:20
#define PHI
double y(double E, double pz)
Definition: AnglesUtil.h:154
float x

◆ phi() [2/3]

double kinem::phi ( double  xy1[2],
double  xy2[2] 
)
inline

Definition at line 78 of file AnglesUtil.h.

References phi(), x, and y().

78  {
79  double x = xy2[0] - xy1[0];
80  double y = xy2[1] - xy1[1];
81  return phi(x, y);
82 }
double phi(float xy1[2], float xy2[2])
Definition: AnglesUtil.h:72
double y(double E, double pz)
Definition: AnglesUtil.h:154
float x

◆ phi() [3/3]

double kinem::phi ( float  xy1[2],
float  xy2[2] 
)
inline

Definition at line 72 of file AnglesUtil.h.

Referenced by phi().

72  {
73  double dxy1[2] = {xy1[0], xy1[1]};
74  double dxy2[2] = {xy2[0], xy2[1]};
75  return phi(dxy1, dxy2);
76 }
double phi(float xy1[2], float xy2[2])
Definition: AnglesUtil.h:72

◆ signed_delta_phi()

double kinem::signed_delta_phi ( double  ph11,
double  phi2 
)
inline

Definition at line 91 of file AnglesUtil.h.

References TWOPI.

91  {
92  double phia = phi1;
93  if (phi1 > PI)
94  phia = phi1 - kinem::TWOPI;
95  double phib = phi2;
96  if (phi2 > PI)
97  phib = phi2 - kinem::TWOPI;
98  double dphi = phia - phib;
99  if (dphi > PI)
100  dphi -= kinem::TWOPI;
101  if (dphi < -PI)
102  dphi += kinem::TWOPI;
103  return dphi;
104 }
const double TWOPI
Definition: AnglesUtil.h:20

◆ tanl_from_theta()

double kinem::tanl_from_theta ( double  theta)
inline

Definition at line 182 of file AnglesUtil.h.

References funct::tan(), and theta().

182 { return tan(PI / 2.0 - theta); }
double theta(double etap)
Definition: AnglesUtil.h:127
Tan< T >::type tan(const T &t)
Definition: Tan.h:22

◆ theta() [1/4]

double kinem::theta ( double  x,
double  y,
double  z 
)
inline

Definition at line 125 of file AnglesUtil.h.

References mathSSE::sqrt(), x, y(), and detailsBasic3DVector::z.

125 { return atan2(sqrt(x * x + y * y), z); }
float float float z
T sqrt(T t)
Definition: SSEVec.h:19
double y(double E, double pz)
Definition: AnglesUtil.h:154
float x

◆ theta() [2/4]

double kinem::theta ( double  xyz1[3],
double  xyz2[3] 
)
inline

Definition at line 112 of file AnglesUtil.h.

References theta(), x, y(), and detailsBasic3DVector::z.

112  {
113  double x = xyz2[0] - xyz1[0];
114  double y = xyz2[1] - xyz1[1];
115  double z = xyz2[2] - xyz1[2];
116  return theta(x, y, z);
117 }
double theta(double etap)
Definition: AnglesUtil.h:127
float float float z
double y(double E, double pz)
Definition: AnglesUtil.h:154
float x

◆ theta() [3/4]

double kinem::theta ( float  xyz1[3],
float  xyz2[3] 
)
inline

Definition at line 119 of file AnglesUtil.h.

References theta().

119  {
120  double dxyz1[3] = {xyz1[0], xyz1[1], xyz1[2]};
121  double dxyz2[3] = {xyz2[0], xyz2[1], xyz2[2]};
122  return theta(dxyz1, dxyz2);
123 }
double theta(double etap)
Definition: AnglesUtil.h:127

◆ theta() [4/4]

double kinem::theta ( double  etap)
inline

Definition at line 127 of file AnglesUtil.h.

References JetChargeProducer_cfi::exp.

Referenced by tanl_from_theta(), and theta().

127 { return 2.0 * atan(exp(-etap)); }

◆ theta_from_tanl()

double kinem::theta_from_tanl ( double  tanl)
inline

Definition at line 184 of file AnglesUtil.h.

184 { return PI / 2.0 - atan(tanl); }

◆ uvectors() [1/2]

void kinem::uvectors ( double  u[3],
double  xyz1[3],
double  xyz2[3] 
)
inline

Definition at line 156 of file AnglesUtil.h.

References alignCSCRings::s, and mathSSE::sqrt().

156  {
157  double xdiff = xyz2[0] - xyz1[0];
158  double ydiff = xyz2[1] - xyz1[1];
159  double zdiff = xyz2[2] - xyz1[2];
160  double s = sqrt(xdiff * xdiff + ydiff * ydiff + zdiff * zdiff);
161  if (s > 0) {
162  u[0] = xdiff / s;
163  u[1] = ydiff / s;
164  u[2] = zdiff / s;
165  } else {
166  u[0] = 0;
167  u[1] = 0;
168  u[2] = 0;
169  }
170 }
T sqrt(T t)
Definition: SSEVec.h:19

◆ uvectors() [2/2]

void kinem::uvectors ( float  u[3],
float  xyz1[3],
float  xyz2[3] 
)
inline

Definition at line 172 of file AnglesUtil.h.

172  {
173  double du[3];
174  double dxyz1[3] = {xyz1[0], xyz1[1], xyz1[2]};
175  double dxyz2[3] = {xyz2[0], xyz2[1], xyz2[2]};
176  uvectors(du, dxyz1, dxyz2);
177  u[0] = du[0];
178  u[1] = du[1];
179  u[2] = du[2];
180 }
void uvectors(float u[3], float xyz1[3], float xyz2[3])
Definition: AnglesUtil.h:172

◆ y()

double kinem::y ( double  E,
double  pz 
)
inline

Definition at line 154 of file AnglesUtil.h.

References EPSILON, and dqm-mbProfile::log.

Referenced by eta(), phi(), and theta().

154 { return 0.5 * log((E + pz + EPSILON) / (E - pz + EPSILON)); }
const float EPSILON
Definition: AnglesUtil.h:22

Variable Documentation

◆ EPSILON

const float kinem::EPSILON = 1.E-10

Definition at line 22 of file AnglesUtil.h.

Referenced by HcalSiPM::BorelCDF(), eta(), MSLayersAtAngle::findLayer(), and y().

◆ ETA_LIMIT

const float kinem::ETA_LIMIT = 15.0

Definition at line 21 of file AnglesUtil.h.

Referenced by eta().

◆ PI

const double kinem::PI = 2.0 * acos(0.)

Definition at line 19 of file AnglesUtil.h.

◆ TWOPI

const double kinem::TWOPI = 2.0 * PI

Definition at line 20 of file AnglesUtil.h.

Referenced by delta_phi(), phi(), and signed_delta_phi().