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 th)
 
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 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 etap)
 
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_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.

89 { return eta1 - eta2; }

References HLT_FULL_cff::eta1, and HLT_FULL_cff::eta2.

◆ delta_phi()

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

Definition at line 84 of file AnglesUtil.h.

84  {
85  double PHI = fabs(phi1 - phi2);
86  return (PHI <= PI) ? PHI : kinem::TWOPI - PHI;
87 }

References PHI, and TWOPI.

Referenced by delta_R().

◆ delta_R()

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

Definition at line 106 of file AnglesUtil.h.

106  {
107  double deta = eta1 - eta2;
108  double dphi = kinem::delta_phi(phi1, phi2);
109  return sqrt(deta * deta + dphi * dphi);
110 }

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

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

◆ eta() [1/4]

double kinem::eta ( double  th)
inline

Definition at line 146 of file AnglesUtil.h.

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 }

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

Referenced by eta().

◆ eta() [2/4]

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

Definition at line 142 of file AnglesUtil.h.

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 }

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

◆ eta() [3/4]

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

Definition at line 129 of file AnglesUtil.h.

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 }

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

◆ eta() [4/4]

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

Definition at line 136 of file AnglesUtil.h.

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 }

References eta().

◆ phi() [1/3]

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

Definition at line 67 of file AnglesUtil.h.

67  {
68  double PHI = atan2(y, x);
69  return (PHI >= 0) ? PHI : kinem::TWOPI + PHI;
70 }

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

◆ phi() [2/3]

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

Definition at line 78 of file AnglesUtil.h.

78  {
79  double x = xy2[0] - xy1[0];
80  double y = xy2[1] - xy1[1];
81  return phi(x, y);
82 }

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

◆ phi() [3/3]

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

Definition at line 72 of file AnglesUtil.h.

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

Referenced by phi().

◆ signed_delta_phi()

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

Definition at line 91 of file AnglesUtil.h.

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 }

References TWOPI.

◆ tanl_from_theta()

double kinem::tanl_from_theta ( double  theta)
inline

Definition at line 182 of file AnglesUtil.h.

182 { return tan(PI / 2.0 - theta); }

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

◆ theta() [1/4]

double kinem::theta ( double  etap)
inline

Definition at line 127 of file AnglesUtil.h.

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

References JetChargeProducer_cfi::exp.

Referenced by tanl_from_theta(), and theta().

◆ theta() [2/4]

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

Definition at line 125 of file AnglesUtil.h.

125 { return atan2(sqrt(x * x + y * y), z); }

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

◆ theta() [3/4]

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

Definition at line 112 of file AnglesUtil.h.

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 }

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

◆ theta() [4/4]

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

Definition at line 119 of file AnglesUtil.h.

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 }

References theta().

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

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 }

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

◆ 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 }

◆ y()

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

Definition at line 154 of file AnglesUtil.h.

154 { return 0.5 * log((E + pz + EPSILON) / (E - pz + EPSILON)); }

References EPSILON, and dqm-mbProfile::log.

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

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

PI
Definition: PayloadInspector.h:20
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
kinem::ETA_LIMIT
const float ETA_LIMIT
Definition: AnglesUtil.h:21
kinem::phi
double phi(float xy1[2], float xy2[2])
Definition: AnglesUtil.h:72
kinem::eta
double eta(double th)
Definition: AnglesUtil.h:146
kinem::TWOPI
const double TWOPI
Definition: AnglesUtil.h:20
alignCSCRings.s
s
Definition: alignCSCRings.py:92
kinem::theta
double theta(double etap)
Definition: AnglesUtil.h:127
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HLT_FULL_cff.eta2
eta2
Definition: HLT_FULL_cff.py:9542
HLT_FULL_cff.eta1
eta1
Definition: HLT_FULL_cff.py:9541
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
genVertex_cff.x
x
Definition: genVertex_cff.py:12
kinem::y
double y(double E, double pz)
Definition: AnglesUtil.h:154
kinem::EPSILON
const float EPSILON
Definition: AnglesUtil.h:22
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
PHI
#define PHI
Definition: GenericBenchmark.cc:29
kinem::delta_phi
double delta_phi(double ph11, double phi2)
Definition: AnglesUtil.h:84
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
kinem::uvectors
void uvectors(float u[3], float xyz1[3], float xyz2[3])
Definition: AnglesUtil.h:172