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

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

Definition at line 98 of file AnglesUtil.h.

99 {
100  return eta1 - eta2;
101 }
double kinem::delta_phi ( double  ph11,
double  phi2 
)
inline

Definition at line 91 of file AnglesUtil.h.

References PHI, PI, and TWOPI.

Referenced by delta_R().

92 {
93  double PHI=fabs(phi1-phi2);
94  return (PHI<=PI)? PHI : kinem::TWOPI-PHI;
95 }
const double PI
Definition: AnglesUtil.h:20
const double TWOPI
Definition: AnglesUtil.h:21
#define PHI
double kinem::delta_R ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
)
inline

Definition at line 116 of file AnglesUtil.h.

References delta_phi(), and mathSSE::sqrt().

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

117 {
118  double deta = eta1-eta2;
119  double dphi = kinem::delta_phi(phi1,phi2);
120  return sqrt(deta*deta + dphi*dphi);
121 }
T sqrt(T t)
Definition: SSEVec.h:18
double delta_phi(double ph11, double phi2)
Definition: AnglesUtil.h:91
double kinem::eta ( double  x,
double  y,
double  z 
)
inline

Definition at line 168 of file AnglesUtil.h.

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

Referenced by eta().

169 {
170  return 0.5*log((sqrt(x*x + y*y + z*z) + z + EPSILON) /
171  (sqrt(x*x + y*y + z*z) - z + EPSILON));
172 }
float float float z
T sqrt(T t)
Definition: SSEVec.h:18
const float EPSILON
Definition: AnglesUtil.h:23
double y(double E, double pz)
Definition: AnglesUtil.h:183
double kinem::eta ( double  xyz1[3],
double  xyz2[3] 
)
inline

Definition at line 152 of file AnglesUtil.h.

References eta(), and y().

153 {
154  double x=xyz2[0]-xyz1[0];
155  double y=xyz2[1]-xyz1[1];
156  double z=xyz2[2]-xyz1[2];
157  return eta(x, y, z);
158 }
float float float z
double eta(double th)
Definition: AnglesUtil.h:175
double y(double E, double pz)
Definition: AnglesUtil.h:183
double kinem::eta ( float  xyz1[3],
float  xyz2[3] 
)
inline

Definition at line 161 of file AnglesUtil.h.

References eta().

161  {
162  double dxyz1[3]={xyz1[0],xyz1[1],xyz1[2]};
163  double dxyz2[3]={xyz2[0],xyz2[1],xyz2[2]};
164  return eta(dxyz1,dxyz2);
165 }
double eta(double th)
Definition: AnglesUtil.h:175
double kinem::eta ( double  th)
inline

Definition at line 175 of file AnglesUtil.h.

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

176 {
177  if(th == 0) return ETA_LIMIT;
178  if(th >= PI-0.0001) return -ETA_LIMIT;
179  return -log(tan(th/2.0));
180 }
const double PI
Definition: AnglesUtil.h:20
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
const float ETA_LIMIT
Definition: AnglesUtil.h:22
double kinem::phi ( double  x,
double  y 
)
inline

Definition at line 69 of file AnglesUtil.h.

References PHI, and TWOPI.

Referenced by phi().

70 {
71  double PHI=atan2(y, x);
72  return (PHI>=0)? PHI : kinem::TWOPI+PHI;
73 }
const double TWOPI
Definition: AnglesUtil.h:21
#define PHI
double y(double E, double pz)
Definition: AnglesUtil.h:183
double kinem::phi ( double  xy1[2],
double  xy2[2] 
)
inline

Definition at line 83 of file AnglesUtil.h.

References phi(), and y().

84 {
85  double x=xy2[0]-xy1[0];
86  double y=xy2[1]-xy1[1];
87  return phi(x, y);
88 }
double phi(float xy1[2], float xy2[2])
Definition: AnglesUtil.h:76
double y(double E, double pz)
Definition: AnglesUtil.h:183
double kinem::phi ( float  xy1[2],
float  xy2[2] 
)
inline

Definition at line 76 of file AnglesUtil.h.

References phi().

76  {
77  double dxy1[2]={xy1[0],xy1[1]};
78  double dxy2[2]={xy2[0],xy2[1]};
79  return phi(dxy1,dxy2);
80  }
double phi(float xy1[2], float xy2[2])
Definition: AnglesUtil.h:76
double kinem::signed_delta_phi ( double  ph11,
double  phi2 
)
inline

Definition at line 104 of file AnglesUtil.h.

References PI, and TWOPI.

105 {
106  double phia=phi1;
107  if(phi1>PI) phia=phi1-kinem::TWOPI;
108  double phib=phi2;
109  if(phi2>PI) phib=phi2-kinem::TWOPI;
110  double dphi=phia-phib;
111  if(dphi>PI) dphi-=kinem::TWOPI;
112  if(dphi<-PI) dphi+=kinem::TWOPI;
113  return dphi;
114 }
const double PI
Definition: AnglesUtil.h:20
const double TWOPI
Definition: AnglesUtil.h:21
double kinem::tanl_from_theta ( double  theta)
inline

Definition at line 217 of file AnglesUtil.h.

References PI, and funct::tan().

217  {
218  return tan(PI/2.0 - theta);
219 }
double theta(double etap)
Definition: AnglesUtil.h:146
const double PI
Definition: AnglesUtil.h:20
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double kinem::theta ( double  x,
double  y,
double  z 
)
inline

Definition at line 140 of file AnglesUtil.h.

References mathSSE::sqrt().

Referenced by theta().

141 {
142  return atan2(sqrt(x*x + y*y), z);
143 }
float float float z
T sqrt(T t)
Definition: SSEVec.h:18
double y(double E, double pz)
Definition: AnglesUtil.h:183
double kinem::theta ( double  xyz1[3],
double  xyz2[3] 
)
inline

Definition at line 124 of file AnglesUtil.h.

References theta(), and y().

125 {
126  double x=xyz2[0]-xyz1[0];
127  double y=xyz2[1]-xyz1[1];
128  double z=xyz2[2]-xyz1[2];
129  return theta(x, y, z);
130 }
double theta(double etap)
Definition: AnglesUtil.h:146
float float float z
double y(double E, double pz)
Definition: AnglesUtil.h:183
double kinem::theta ( float  xyz1[3],
float  xyz2[3] 
)
inline

Definition at line 133 of file AnglesUtil.h.

References theta().

133  {
134  double dxyz1[3]={xyz1[0],xyz1[1],xyz1[2]};
135  double dxyz2[3]={xyz2[0],xyz2[1],xyz2[2]};
136  return theta(dxyz1,dxyz2);
137 }
double theta(double etap)
Definition: AnglesUtil.h:146
double kinem::theta ( double  etap)
inline

Definition at line 146 of file AnglesUtil.h.

References JetChargeProducer_cfi::exp.

147 {
148  return 2.0*atan(exp(-etap));
149 }
double kinem::theta_from_tanl ( double  tanl)
inline

Definition at line 222 of file AnglesUtil.h.

References PI.

222  {
223  return PI/2.0 - atan(tanl);
224 }
const double PI
Definition: AnglesUtil.h:20
void kinem::uvectors ( double  u[3],
double  xyz1[3],
double  xyz2[3] 
)
inline

Definition at line 189 of file AnglesUtil.h.

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

Referenced by uvectors().

189  {
190  double xdiff=xyz2[0]-xyz1[0];
191  double ydiff=xyz2[1]-xyz1[1];
192  double zdiff=xyz2[2]-xyz1[2];
193  double s=sqrt(xdiff*xdiff+ydiff*ydiff+zdiff*zdiff);
194  if(s > 0) {
195  u[0]=xdiff/s;
196  u[1]=ydiff/s;
197  u[2]=zdiff/s;
198  }else{
199  u[0]=0;
200  u[1]=0;
201  u[2]=0;
202  }
203 }
T sqrt(T t)
Definition: SSEVec.h:18
void kinem::uvectors ( float  u[3],
float  xyz1[3],
float  xyz2[3] 
)
inline

Definition at line 206 of file AnglesUtil.h.

References uvectors().

206  {
207  double du[3];
208  double dxyz1[3]={xyz1[0],xyz1[1],xyz1[2]};
209  double dxyz2[3]={xyz2[0],xyz2[1],xyz2[2]};
210  uvectors(du,dxyz1,dxyz2);
211  u[0]=du[0];
212  u[1]=du[1];
213  u[2]=du[2];
214 }
void uvectors(float u[3], float xyz1[3], float xyz2[3])
Definition: AnglesUtil.h:206
double kinem::y ( double  E,
double  pz 
)
inline

Definition at line 183 of file AnglesUtil.h.

References EPSILON, and cmsBatch::log.

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

184 {
185  return 0.5 * log ((E+pz+EPSILON)/(E-pz+EPSILON));
186 }
const float EPSILON
Definition: AnglesUtil.h:23

Variable Documentation

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

Definition at line 23 of file AnglesUtil.h.

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

const float kinem::ETA_LIMIT =15.0

Definition at line 22 of file AnglesUtil.h.

Referenced by eta().

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

Definition at line 20 of file AnglesUtil.h.

Referenced by delta_phi(), eta(), signed_delta_phi(), tanl_from_theta(), and theta_from_tanl().

const double kinem::TWOPI =2.0*PI

Definition at line 21 of file AnglesUtil.h.

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