6 #include "StSvtAngles.hh"
7 #include "StSvtClassLibrary/StSvtGeometry.hh"
8 #include "StSvtClassLibrary/StSvtWaferGeometry.hh"
12 StSvtAngles::StSvtAngles():mTheta(-1956),mPhi(-1956)
17 StSvtAngles::~StSvtAngles()
27 thetaZ = (V.x()*uz.x() + V.y()*uz.y() + V.z()*uz.z())/V.mag();
28 mTheta = acos(thetaZ);
32 void StSvtAngles::svtTheta(
double Vx,
double Vy,
double Vz,
double ux,
double uy,
double uz)
36 thetaZ = (Vx*ux + Vy*uy + Vz*uz)/::sqrt(Vx*Vx + Vy*Vy + Vz*Vz);
37 mTheta = acos(thetaZ);
43 double csPhi = 0, Vx = 0, Vy = 0;
51 Vx = V.x()*ux.x() + V.y()*ux.y() + V.z()*ux.z();
52 Vy = V.x()*uy.x() + V.y()*uy.y() + V.z()*uy.z();
54 csPhi = Vx/::sqrt(Vx*Vx + Vy*Vy);
59 void StSvtAngles::calcAngles(
StSvtGeometry *geom,
double x,
double y,
double z,
int mLayer,
int mLadder,
int mWafer )
80 int index = geom->getWaferIndex(geom->getBarrelID(mLayer,mLadder),mLadder,mWafer);
84 if (!waferGeom)
return;
104 uVecN.setX(waferGeom->n(0));
105 uVecN.setY(waferGeom->n(1));
106 uVecN.setZ(waferGeom->n(2));
108 uVecD.setX(waferGeom->d(0));
109 uVecD.setY(waferGeom->d(1));
110 uVecD.setZ(waferGeom->d(2));
112 uVecT.setX(waferGeom->t(0));
113 uVecT.setY(waferGeom->t(1));
114 uVecT.setZ(waferGeom->t(2));
117 svtPhi(mom,uVecD,uVecT);