57 if(x>0 && y>=0) phi = atan(y/x);
58 else if(x>0 && y<0) phi = 2.*
Pi+atan(y/x);
59 else if(x<0) phi =
Pi+atan(y/x);
60 else if(x==0 && y>0) phi =
Pi/2.;
61 else if(x==0 && y<0) phi = 3.*
Pi/2.;
70 if(theta_tmp>2.*
Pi) theta_tmp = theta_tmp - 2.*
Pi;
71 if(theta_tmp<0) theta_tmp = theta_tmp + 2.*
Pi;
72 if(fabs(phi-theta_tmp)<
Pi/Nsector || fabs(2.*
Pi-fabs(phi-theta_tmp))<
Pi/Nsector) ti=t;
78 ClosestStrip = (int) (floor( (-
DZ+x*(cos(thetaij)*tan(
alpha)+sin(thetaij))+y*(sin(thetaij)*tan(
alpha)-cos(thetaij)))/
pitch) +
79 floor(2.0*((-
DZ+x*(cos(thetaij)*tan(
alpha)+sin(thetaij)) + y*(sin(thetaij)*tan(
alpha)-cos(thetaij)))/
pitch -
80 floor((-
DZ+x*(cos(thetaij)*tan(
alpha)+sin(thetaij)) + y*(sin(thetaij)*tan(
alpha)-cos(thetaij)))/
pitch))));
83 ClosestStrip = (int) (floor( (-
DZ+x*(cos(thetaij)*tan(
alpha)-sin(thetaij))+y*(sin(thetaij)*tan(
alpha)+cos(thetaij)))/
pitch) +
84 floor(2.0*((-
DZ+x*(cos(thetaij)*tan(
alpha)-sin(thetaij))+y*(sin(thetaij)*tan(
alpha)+cos(thetaij)))/
pitch -
85 floor((-
DZ+x*(cos(thetaij)*tan(
alpha)-sin(thetaij))+y*(sin(thetaij)*tan(
alpha)+cos(thetaij)))/
pitch))));
90 if(ClosestStrip<0 || ClosestStrip>
Nstrips) IsOK = 0;
91 if(x*cos(thetaij)+y*sin(thetaij)<
Rmin || x*cos(thetaij)+y*sin(thetaij)>
Rmax)
96 if(x*cos(thetaij)+y*sin(thetaij)<(
Rint+
DZ) && x*cos(thetaij)+y*sin(thetaij)>(
Rint-
DZ)) IsOK = 0;
97 if(IsOK)
return ClosestStrip;
int FindStrip(int layer, int sector, double x, double y, double z)