18 const std::string&
name,
30 m_use_mcLUT = use_mcLUT;
31 if ( alignmentBarrelLUTSvc ) m_alignmentBarrelLUT = alignmentBarrelLUTSvc->
alignmentBarrelLUT();
41 const int MAX_STATION = 4;
47 double a3,theta,
rad,phi,
one,phim=0,signZ;
49 double c0,
c1,
c2,
c3,c22,c33,
e2,
e3,c2q,c3q,
d,da,
db,
a,
b,
dx,
dy;
52 double x0 = 0., y0 = 0.,
x1 = 0.,
y1 = 0.,
x2 = 0.,
y2 = 0., x3 = 0., y3 = 0.;
55 const double eps = 0.005;
59 for (
int i_station=0; i_station<MAX_STATION; i_station++) {
66 superPoints[i_station] = &(trackPattern.
superPoints[chamberID]);
70 if ( i_station != 3 ){
71 phim = superPoints[i_station]->
Phim;
81 x2 = superPoints[1]->
Z;
82 y2 = superPoints[1]->
R;
83 x3 = superPoints[2]->
Z;
84 y3 = superPoints[2]->
R;
86 x2 = superPoints[0]->
Z;
87 y2 = superPoints[0]->
R;
88 x3 = superPoints[2]->
Z;
89 y3 = superPoints[2]->
R;
91 x2 = superPoints[0]->
Z;
92 y2 = superPoints[0]->
R;
93 x3 = superPoints[1]->
Z;
94 y3 = superPoints[1]->
R;
105 c0 = y0*
x2*x3*
dx + y0*
x2*(y3-y0)*(y3-y0) - y0*x3*(
y2-y0)*(
y2-y0);
110 while((nit++)<=nitmx&&std::abs(x0-xn)>=eps) {
120 rad = superPoints[0]->
R;
121 theta = std::atan2(
rad,(
double)std::abs(superPoints[0]->Z));
122 signZ = (std::abs(superPoints[0]->Z) >
ZERO_LIMIT)? superPoints[0]->Z/std::abs(superPoints[0]->Z): 1.;
125 theta = std::atan2(
rad,(
double)std::abs(
x1));
138 if(phim>=
M_PI+0.1) phim = phim - 2*
M_PI;
140 if(phim>=0) trackPattern.
phiMap = (phi>=0.)? phi - phim : phim -std::abs(phi);
141 else trackPattern.
phiMap = phi - phim;
143 trackPattern.
phiMS = phi;
152 da = -c2q*
e3 + c3q*
e2;
161 if(
a<=0.) trackPattern.
charge = 1;
163 }
else if (
count==3) {
165 rad = superPoints[0]->
R;
166 theta = std::atan2(
rad,(
double)std::abs(superPoints[0]->Z));
167 signZ = (std::abs(superPoints[0]->Z) >
ZERO_LIMIT)? superPoints[0]->Z/std::abs(superPoints[0]->Z): 1.;
178 if(phim>=
M_PI+0.1) phim = phim - 2*
M_PI;
180 if(phim>=0) trackPattern.
phiMap = (phi>=0.)? phi - phim : phim -std::abs(phi);
181 else trackPattern.
phiMap = phi - phim;
183 trackPattern.
phiMS = phi;
188 if ( !m_alignmentBarrelLUT ) {
189 ATH_MSG_ERROR(
"Alignment correction service is not prepared");
190 return StatusCode::FAILURE;
193 double dZ = (*m_alignmentBarrelLUT)->GetDeltaZ(trackPattern.
s_address,
198 superPoints[1]->
Z += 10*dZ;
201 a3 = ( superPoints[2]->
Z - superPoints[0]->
Z ) / ( superPoints[2]->R - superPoints[0]->R );
203 trackPattern.
barrelSagitta = superPoints[1]->
Z - superPoints[1]->
R*a3 - superPoints[0]->
Z + superPoints[0]->
R*a3;
207 x2 = superPoints[1]->
R - superPoints[0]->
R;
208 y2 = superPoints[1]->
Z - superPoints[0]->
Z;
209 x3 = superPoints[2]->
R - superPoints[0]->
R;
210 y3 = superPoints[2]->
Z - superPoints[0]->
Z;
217 x3 = ( x3 + y3*
m)*
cost;
218 y3 = (-tm*
m + y3 )*
cost;
228 if ( m_use_endcapInner ==
true &&
count == 1 && superPoints[3]->R >
ZERO_LIMIT ) {
232 x2 = superPoints[0]->
Z;
233 y2 = superPoints[0]->
R;
234 x3 = superPoints[3]->
Z;
235 y3 = superPoints[3]->
R;
237 x2 = superPoints[3]->
Z;
238 y2 = superPoints[3]->
R;
239 x3 = superPoints[1]->
Z;
240 y3 = superPoints[1]->
R;
242 x2 = superPoints[3]->
Z;
243 y2 = superPoints[3]->
R;
244 x3 = superPoints[2]->
Z;
245 y3 = superPoints[2]->
R;
256 c0 = y0*
x2*x3*
dx + y0*
x2*(y3-y0)*(y3-y0) - y0*x3*(
y2-y0)*(
y2-y0);
261 while((nit++)<=nitmx&&std::abs(x0-xn)>=eps) {
271 rad = superPoints[0]->
R;
272 theta = std::atan2(
rad,(
double)std::abs(superPoints[0]->Z));
273 signZ = (std::abs(superPoints[0]->Z) >
ZERO_LIMIT)? superPoints[0]->Z/std::abs(superPoints[0]->Z): 1.;
276 theta = std::atan2(
rad,(
double)std::abs(
x1));
289 if(phim>=
M_PI+0.1) phim = phim - 2*
M_PI;
291 if(phim>=0) trackPattern.
phiMap = (phi>=0.)? phi - phim : phim -std::abs(phi);
292 else trackPattern.
phiMap = phi - phim;
294 trackPattern.
phiMS = phi;
303 da = -c2q*
e3 + c3q*
e2;
313 if(
a<=0.) trackPattern.
charge = 1;
316 ATH_MSG_DEBUG(
"... count/trackPattern.barrelSagitta/barrelRadius/charge/s_address/phi="
319 << trackPattern.
phiMS);
321 return StatusCode::SUCCESS;