135 for (
int i = 0; i < 6; i++)
136 ok = ok && !TMath::IsNaN(
fT[i]) && (
fT[i] < 1.e5);
138 const Double_t c_light = 0.000299792458;
141 Double_t z_in =
fT[5];
142 Double_t dz = z_out - z_in;
149 xx =
x *
x, xy =
x *
y, yy =
y *
y, xx31 = xx * 3 + 1, xx159 = xx * 15 + 9;
151 const Double_t Ax = xy, Ay = -xx - 1, Az =
y, Ayy =
x * (xx * 3 + 3), Ayz = -2 * xy,
152 Ayyy = -(15 * xx * xx + 18 * xx + 3), Bx = yy + 1, By = -xy, Bz = -
x, Byy =
y * xx31, Byz = 2 * xx + 1,
157 Double_t t2 = 1. + xx + yy;
158 if (t2 > 1.e4)
return 1;
159 Double_t t =
sqrt(t2),
h =
Qp() * c_light, ht =
h * t;
161 Double_t sx = 0, sy = 0, sz = 0, syy = 0, syz = 0, syyy = 0, Sx = 0, Sy = 0, Sz = 0, Syy = 0, Syz = 0, Syyy = 0;
166 Double_t r0[3], r1[3], r2[3];
174 r2[0] =
fT[0] +
fT[2] * dz;
175 r2[1] =
fT[1] +
fT[3] * dz;
178 r1[0] = 0.5 * (r0[0] + r2[0]);
179 r1[1] = 0.5 * (r0[1] + r2[1]);
180 r1[2] = 0.5 * (r0[2] + r2[2]);
182 fgField->GetFieldValue(r0, B[0]);
183 fgField->GetFieldValue(r1, B[1]);
184 fgField->GetFieldValue(r2, B[2]);
186 Sy = (7 * B[0][1] + 6 * B[1][1] - B[2][1]) * dz * dz / 96.;
187 r1[0] =
fT[0] +
x * dz / 2 + ht * Sy * Ay;
188 r1[1] =
fT[1] +
y * dz / 2 + ht * Sy * By;
190 Sy = (B[0][1] + 2 * B[1][1]) * dz * dz / 6.;
191 r2[0] =
fT[0] +
x * dz + ht * Sy * Ay;
192 r2[1] =
fT[1] +
y * dz + ht * Sy * By;
198 fgField->GetFieldValue(r0, B[0]);
199 fgField->GetFieldValue(r1, B[1]);
200 fgField->GetFieldValue(r2, B[2]);
202 sx = (B[0][0] + 4 * B[1][0] + B[2][0]) * dz / 6.;
203 sy = (B[0][1] + 4 * B[1][1] + B[2][1]) * dz / 6.;
204 sz = (B[0][2] + 4 * B[1][2] + B[2][2]) * dz / 6.;
206 Sx = (B[0][0] + 2 * B[1][0]) * dz * dz / 6.;
207 Sy = (B[0][1] + 2 * B[1][1]) * dz * dz / 6.;
208 Sz = (B[0][2] + 2 * B[1][2]) * dz * dz / 6.;
210 Double_t c2[3][3] = {{5, -4, -1}, {44, 80, -4}, {11, 44, 5}};
211 Double_t C2[3][3] = {{38, 8, -4}, {148, 208, -20}, {3, 36, 3}};
212 for (Int_t n = 0; n < 3; n++)
213 for (Int_t m = 0; m < 3; m++) {
214 syz += c2[n][m] * B[n][1] * B[m][2];
215 Syz += C2[n][m] * B[n][1] * B[m][2];
218 syz *= dz * dz / 360.;
219 Syz *= dz * dz * dz / 2520.;
221 syy = (B[0][1] + 4 * B[1][1] + B[2][1]) * dz;
222 syyy = syy * syy * syy / 1296;
223 syy = syy * syy / 72;
225 Syy = (B[0][1] * (38 * B[0][1] + 156 * B[1][1] - B[2][1]) + B[1][1] * (208 * B[1][1] + 16 * B[2][1])
226 + B[2][1] * (3 * B[2][1]))
227 * dz * dz * dz / 2520.;
229 * (B[0][1] * (85 * B[0][1] + 526 * B[1][1] - 7 * B[2][1]) + B[1][1] * (1376 * B[1][1] + 84 * B[2][1])
230 + B[2][1] * (19 * B[2][1]))
231 + B[1][1] * (B[1][1] * (1376 * B[1][1] + 256 * B[2][1]) + B[2][1] * (62 * B[2][1]))
232 + B[2][1] * B[2][1] * (3 * B[2][1]))
233 * dz * dz * dz * dz / 90720.;
238 sA1 = sx * Ax + sy * Ay + sz * Az,
240 sB1 = sx * Bx + sy * By + sz * Bz,
242 SA1 = Sx * Ax + Sy * Ay + Sz * Az,
244 SB1 = Sx * Bx + Sy * By + Sz * Bz,
246 sA2 = syy * Ayy + syz * Ayz, sB2 = syy * Byy + syz * Byz,
248 SA2 = Syy * Ayy + Syz * Ayz, SB2 = Syy * Byy + Syz * Byz,
250 sA3 = syyy * Ayyy, sB3 = syyy * Byyy,
252 SA3 = Syyy * Ayyy, SB3 = Syyy * Byyy;
253 fT[0] =
fT[0] +
x * dz + ht * (SA1 + ht * (SA2 + ht * SA3));
254 fT[1] =
fT[1] +
y * dz + ht * (SB1 + ht * (SB2 + ht * SB3));
255 fT[2] =
fT[2] + ht * (sA1 + ht * (sA2 + ht * sA3));
256 fT[3] =
fT[3] + ht * (sB1 + ht * (sB2 + ht * sB3));