43 {
45
49
50
51
57
58 double A[3]={AT.x(),AT.y(),AT.z()};
59
60 P[ 0] = sqrt(x0*x0+y0*y0);
63 P[ 3] =
A[0]*x0+
A[1]*y0+
A[2]*z0;
64 if(
P[3]<0.) {
P[3]*=-1.;
A[0]*=-1.;
A[1]*=-1.;
A[2]*=-1.;}
65 P[ 7] = sqrt(
A[0]*
A[0]+
A[1]*
A[1]);
66
67 if(
P[7] >.000001)
P[4]=atan2(
A[1],
A[0]);
else P[4]=
P[2];
68 sincos(
P[4],&
P[5],&
P[6]);
70
71 if( fabs(
P[7]) <= .000001) {
72
74 if(
P[8] > 0.)
P[8] = 1.;
else P[8] = -1.;
76 }
77
78 double x[4],
y[4],
z[4];
79
80 x[0] = x0+
AF.x()*Swmax+AE.x()*Sl;
81 y[0] = y0+
AF.y()*Swmax+AE.y()*Sl;
82 z[0] =
z0+
AF.z()*Swmax+AE.z()*Sl;
83
84 x[1] = x0+
AF.x()*Swmin-AE.x()*Sl;
85 y[1] = y0+
AF.y()*Swmin-AE.y()*Sl;
86 z[1] =
z0+
AF.z()*Swmin-AE.z()*Sl;
87
88 x[2] = x0-
AF.x()*Swmin-AE.x()*Sl;
89 y[2] = y0-
AF.y()*Swmin-AE.y()*Sl;
90 z[2] =
z0-
AF.z()*Swmin-AE.z()*Sl;
91
92 x[3] = x0-
AF.x()*Swmax+AE.x()*Sl;
93 y[3] = y0-
AF.y()*Swmax+AE.y()*Sl;
94 z[3] =
z0-
AF.z()*Swmax+AE.z()*Sl;
95
96 double rmin= 10000., rmax=-10000.;
98 double fmin= 10000., fmax=-10000.;
99 for(
int i=0;
i!=4; ++
i) {
100 double r = sqrt(
x[i]*
x[i]+
y[i]*
y[i]);
109 }
117 P[16] =
A[0]*x0+
A[1]*y0;
118 P[17] = atan2(AE.y(),AE.x());
120
121
122
123 P[18] = y0*
P[6]-x0*
P[5];
124 P[19] =
P[8]*(x0*
P[6]+y0*
P[5])-
P[7]*z0;
133
134 for(
int i=0;
i!=4; ++
i) {
135
137 int k2 =
i+1;
if(k2>3) k2=0;
138 double x1 =
y[k1]*
P[6]-
x[k1]*
P[5] -
P[18];
139 double y1 =
P[8]*(
x[k1]*
P[6]+
y[k1]*
P[5])-
P[7]*
z[k1]-
P[19];
140 double x2 =
y[k2]*
P[6]-
x[k2]*
P[5] -
P[18];
141 double y2 =
P[8]*(
x[k2]*
P[6]+
y[k2]*
P[5])-
P[7]*
z[k2]-
P[19];
142 double d = (
x2-
x1)*(x2-x1)+(
y2-
y1)*(y2-y1);
143 double ax =-(
y2-
y1)*(y1*x2-x1*y2)/
d;
144 double ay = (
x2-
x1)*(y1*x2-x1*y2)/
d;
145 if(ax<
P[20]) {
P[20]=
ax;
P[21]=
ay;}
146 if(ax>
P[24]) {
P[24]=
ax;
P[25]=
ay;}
147 if(ay<
P[27]) {
P[26]=
ax;
P[27]=
ay;}
148 if(ay>
P[23]) {
P[22]=
ax;
P[23]=
ay;}
149 }
150
151
152
153 P[29] =
AF.y()*
P[6]-
AF.x()*
P[5];
154 P[30] =
P[8]*(
AF.x()*
P[6]+
AF.y()*
P[5])-
P[7]*
AF.z();
155 P[31] = AE.y()*
P[6]-AE.x()*
P[5];
156 P[32] =
P[8]*(AE.x()*
P[6]+AE.y()*
P[5])-
P[7]*AE.z();
157 }
double thickness() const
Method which returns thickness of the silicon wafer.
virtual double maxWidth() const =0
Method to calculate maximum width of a module.
virtual double minWidth() const =0
Method to calculate minimum width of a module.
virtual double length() const =0
Method to calculate length of a module.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
const Amg::Vector3D & etaAxis() const
virtual const Amg::Vector3D & normal() const override final
Get reconstruction local normal axes in global frame.
virtual const Amg::Vector3D & center() const override final
Center in global coordinates.
const Amg::Vector3D & phiAxis() const
Eigen::Matrix< double, 3, 1 > Vector3D
hold the test vectors and ease the comparison