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 xyz1[3], double xyz2[3])
double eta (float xyz1[3], float xyz2[3])
double eta (double th)
double eta (double x, double y, double z)
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

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 116 of file AnglesUtil.h.

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

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

{
   double deta = eta1-eta2;
   double dphi = kinem::delta_phi(phi1,phi2);
   return sqrt(deta*deta + dphi*dphi);
}
double kinem::eta ( double  xyz1[3],
double  xyz2[3] 
) [inline]

Definition at line 152 of file AnglesUtil.h.

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

{
  double x=xyz2[0]-xyz1[0];
  double y=xyz2[1]-xyz1[1];
  double z=xyz2[2]-xyz1[2];
  return eta(x, y, z);
}
double kinem::eta ( float  xyz1[3],
float  xyz2[3] 
) [inline]

Definition at line 161 of file AnglesUtil.h.

References eta().

                                             {
    double dxyz1[3]={xyz1[0],xyz1[1],xyz1[2]};
    double dxyz2[3]={xyz2[0],xyz2[1],xyz2[2]};
    return eta(dxyz1,dxyz2);
}
double kinem::eta ( double  th) [inline]

Definition at line 175 of file AnglesUtil.h.

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

{
  if(th == 0) return ETA_LIMIT;
  if(th >= PI-0.0001) return -ETA_LIMIT;
  return -log(tan(th/2.0));
}
double kinem::eta ( double  x,
double  y,
double  z 
) [inline]

Definition at line 168 of file AnglesUtil.h.

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

{
  return 0.5*log((sqrt(x*x + y*y + z*z) + z + EPSILON) / 
                 (sqrt(x*x + y*y + z*z) - z + EPSILON));
}
double kinem::phi ( double  x,
double  y 
) [inline]

Definition at line 69 of file AnglesUtil.h.

References PHI, and TWOPI.

{
  double PHI=atan2(y, x);
  return (PHI>=0)? PHI : kinem::TWOPI+PHI;
}
double kinem::phi ( double  xy1[2],
double  xy2[2] 
) [inline]

Definition at line 83 of file AnglesUtil.h.

References phi, x, and detailsBasic3DVector::y.

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

Definition at line 76 of file AnglesUtil.h.

References phi.

                                           {
    double dxy1[2]={xy1[0],xy1[1]};
    double dxy2[2]={xy2[0],xy2[1]};
    return phi(dxy1,dxy2);
  }
double kinem::signed_delta_phi ( double  ph11,
double  phi2 
) [inline]

Definition at line 104 of file AnglesUtil.h.

References PI, and TWOPI.

{
  double phia=phi1;
  if(phi1>PI) phia=phi1-kinem::TWOPI;
  double phib=phi2;
  if(phi2>PI) phib=phi2-kinem::TWOPI;
  double dphi=phia-phib;
  if(dphi>PI) dphi-=kinem::TWOPI;
  if(dphi<-PI) dphi+=kinem::TWOPI;
  return dphi;
}
double kinem::tanl_from_theta ( double  theta) [inline]

Definition at line 217 of file AnglesUtil.h.

References PI, and funct::tan().

                                         {
  return tan(PI/2.0 - theta);
}
double kinem::theta ( double  etap) [inline]

Definition at line 146 of file AnglesUtil.h.

References funct::exp().

{
  return 2.0*atan(exp(-etap));
}
double kinem::theta ( double  x,
double  y,
double  z 
) [inline]

Definition at line 140 of file AnglesUtil.h.

References mathSSE::sqrt().

{
  return atan2(sqrt(x*x + y*y), z);
}
double kinem::theta ( double  xyz1[3],
double  xyz2[3] 
) [inline]

Definition at line 124 of file AnglesUtil.h.

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

{
  double x=xyz2[0]-xyz1[0];
  double y=xyz2[1]-xyz1[1];
  double z=xyz2[2]-xyz1[2];
  return theta(x, y, z);
}
double kinem::theta ( float  xyz1[3],
float  xyz2[3] 
) [inline]

Definition at line 133 of file AnglesUtil.h.

References theta().

                                               {
    double dxyz1[3]={xyz1[0],xyz1[1],xyz1[2]};
    double dxyz2[3]={xyz2[0],xyz2[1],xyz2[2]};
    return theta(dxyz1,dxyz2);
}
double kinem::theta_from_tanl ( double  tanl) [inline]

Definition at line 222 of file AnglesUtil.h.

References PI.

                                        {
  return PI/2.0 - atan(tanl);
}
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().

                                                               {
  double xdiff=xyz2[0]-xyz1[0];
  double ydiff=xyz2[1]-xyz1[1];
  double zdiff=xyz2[2]-xyz1[2];
  double s=sqrt(xdiff*xdiff+ydiff*ydiff+zdiff*zdiff);
  if(s > 0) {
    u[0]=xdiff/s;
    u[1]=ydiff/s;
    u[2]=zdiff/s;
  }else{
    u[0]=0;
    u[1]=0;
    u[2]=0;
  }
}
void kinem::uvectors ( float  u[3],
float  xyz1[3],
float  xyz2[3] 
) [inline]

Definition at line 206 of file AnglesUtil.h.

References uvectors().

                                                            {
    double du[3];
    double dxyz1[3]={xyz1[0],xyz1[1],xyz1[2]};
    double dxyz2[3]={xyz2[0],xyz2[1],xyz2[2]};
    uvectors(du,dxyz1,dxyz2);
    u[0]=du[0];
    u[1]=du[1];
    u[2]=du[2];
}
double kinem::y ( double  E,
double  pz 
) [inline]

Definition at line 183 of file AnglesUtil.h.

References EPSILON, and funct::log().

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

Variable Documentation

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

Definition at line 23 of file AnglesUtil.h.

Referenced by 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.

const double kinem::TWOPI = 2.0*PI

Definition at line 21 of file AnglesUtil.h.

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