CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

double kinem::delta_eta ( double  eta1,
double  eta2 
)
inline
double kinem::delta_phi ( double  ph11,
double  phi2 
)
inline
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_FULL_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
double kinem::eta ( double  x,
double  y,
double  z 
)
inline

Definition at line 142 of file AnglesUtil.h.

References EPSILON, log, and mathSSE::sqrt().

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 }
static std::vector< std::string > checklist log
float float float z
T sqrt(T t)
Definition: SSEVec.h:19
const float EPSILON
Definition: AnglesUtil.h:22
float x
double kinem::eta ( double  xyz1[3],
double  xyz2[3] 
)
inline

Definition at line 129 of file AnglesUtil.h.

References PVValHelper::eta, x, detailsBasic3DVector::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
float x
double kinem::eta ( float  xyz1[3],
float  xyz2[3] 
)
inline

Definition at line 136 of file AnglesUtil.h.

References PVValHelper::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 kinem::eta ( double  th)
inline

Definition at line 146 of file AnglesUtil.h.

References ETA_LIMIT, log, PI, and funct::tan().

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 }
static std::vector< std::string > checklist log
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
#define PI
Definition: QcdUeDQM.h:37
const float ETA_LIMIT
Definition: AnglesUtil.h:21
double kinem::phi ( double  x,
double  y 
)
inline

Definition at line 67 of file AnglesUtil.h.

References PHI, and TWOPI.

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
float x
double kinem::phi ( double  xy1[2],
double  xy2[2] 
)
inline

Definition at line 78 of file AnglesUtil.h.

References PVValHelper::phi, x, and detailsBasic3DVector::y.

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

Definition at line 72 of file AnglesUtil.h.

References PVValHelper::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 kinem::signed_delta_phi ( double  ph11,
double  phi2 
)
inline

Definition at line 91 of file AnglesUtil.h.

References PI, and 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 }
#define PI
Definition: QcdUeDQM.h:37
const double TWOPI
Definition: AnglesUtil.h:20
double kinem::tanl_from_theta ( double  theta)
inline

Definition at line 182 of file AnglesUtil.h.

References PI, and funct::tan().

182 { return tan(PI / 2.0 - theta); }
Geom::Theta< T > theta() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
#define PI
Definition: QcdUeDQM.h:37
double kinem::theta ( double  x,
double  y,
double  z 
)
inline

Definition at line 125 of file AnglesUtil.h.

References mathSSE::sqrt().

125 { return atan2(sqrt(x * x + y * y), z); }
float float float z
T sqrt(T t)
Definition: SSEVec.h:19
float x
double kinem::theta ( double  xyz1[3],
double  xyz2[3] 
)
inline

Definition at line 112 of file AnglesUtil.h.

References theta(), x, detailsBasic3DVector::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 }
Geom::Theta< T > theta() const
float float float z
float x
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 }
Geom::Theta< T > theta() const
double kinem::theta ( double  etap)
inline

Definition at line 127 of file AnglesUtil.h.

References funct::exp().

127 { return 2.0 * atan(exp(-etap)); }
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
double kinem::theta_from_tanl ( double  tanl)
inline

Definition at line 184 of file AnglesUtil.h.

References PI.

184 { return PI / 2.0 - atan(tanl); }
#define PI
Definition: QcdUeDQM.h:37
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().

Referenced by uvectors().

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
void kinem::uvectors ( float  u[3],
float  xyz1[3],
float  xyz2[3] 
)
inline

Definition at line 172 of file AnglesUtil.h.

References uvectors().

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(double u[3], double xyz1[3], double xyz2[3])
Definition: AnglesUtil.h:156
double kinem::y ( double  E,
double  pz 
)
inline

Definition at line 154 of file AnglesUtil.h.

References EPSILON, and log.

154 { return 0.5 * log((E + pz + EPSILON) / (E - pz + EPSILON)); }
static std::vector< std::string > checklist log
const float EPSILON
Definition: AnglesUtil.h:22

Variable Documentation

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

Definition at line 22 of file AnglesUtil.h.

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

const float kinem::ETA_LIMIT = 15.0

Definition at line 21 of file AnglesUtil.h.

Referenced by eta().

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

Definition at line 19 of file AnglesUtil.h.

const double kinem::TWOPI = 2.0 * PI

Definition at line 20 of file AnglesUtil.h.

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