24 Double_t dz = z_out - T_in[5];
27 T_out[0] = T_in[0] + dz * T_in[2];
28 T_out[1] = T_in[1] + dz * T_in[3];
36 const Double_t dzC_in8 = dz * C_in[8];
38 C_out[4] = C_in[4] + dzC_in8;
39 C_out[1] = C_in[1] + dz * (C_out[4] + C_in[6]);
41 const Double_t C_in3 = C_in[3];
43 C_out[3] = C_in3 + dz * C_in[5];
44 C_out[0] = C_in[0] + dz * (C_out[3] + C_in3);
46 const Double_t C_in7 = C_in[7];
48 C_out[7] = C_in7 + dz * C_in[9];
49 C_out[2] = C_in[2] + dz * (C_out[7] + C_in7);
51 C_out[6] = C_in[6] + dzC_in8;
65 const Double_t C_in[],
97 const Double_t c_light = 0.000299792458;
99 static Double_t a[4] = {0.0, 0.5, 0.5, 1.0};
100 static Double_t c[4] = {1.0 / 6.0, 1.0 / 3.0, 1.0 / 3.0, 1.0 / 6.0};
101 static Double_t b[4] = {0.0, 0.5, 0.5, 1.0};
104 Double_t k[16], x0[4],
x[4], k1[16];
105 Double_t Ax[4], Ay[4], Ax_tx[4], Ay_tx[4], Ax_ty[4], Ay_ty[4];
109 Double_t qp_in = T_in[4];
110 Double_t z_in = T_in[5];
111 Double_t
h = z_out - z_in;
112 Double_t hC =
h * c_light;
124 for (step = 0; step < 4; ++step) {
125 for (i = 0; i < 4; ++i) {
130 x[i] = x0[i] + b[step] * k[step * 4 - 4 + i];
134 Double_t point[3] = {
x[0],
x[1], z_in + a[step] *
h};
137 MF->GetFieldValue(point, B);
140 B[0] = B[1] = B[2] = 0.;
145 Double_t tx2 = tx * tx;
146 Double_t ty2 = ty * ty;
147 Double_t txty = tx * ty;
148 Double_t tx2ty21 = 1.0 + tx2 + ty2;
149 if (tx2ty21 > 1.e4) {
152 Double_t I_tx2ty21 = 1.0 / tx2ty21 * qp0;
153 Double_t tx2ty2 =
sqrt(tx2ty21);
156 Double_t tx2ty2qp = tx2ty2 * qp0;
157 Ax[step] = (txty * B[0] + ty * B[2] - (1.0 + tx2) * B[1]) * tx2ty2;
158 Ay[step] = (-txty * B[1] - tx * B[2] + (1.0 + ty2) * B[0]) * tx2ty2;
160 Ax_tx[step] = Ax[step] * tx * I_tx2ty21 + (ty * B[0] - 2.0 * tx * B[1]) * tx2ty2qp;
161 Ax_ty[step] = Ax[step] * ty * I_tx2ty21 + (tx * B[0] + B[2]) * tx2ty2qp;
162 Ay_tx[step] = Ay[step] * tx * I_tx2ty21 + (-ty * B[1] - B[2]) * tx2ty2qp;
163 Ay_ty[step] = Ay[step] * ty * I_tx2ty21 + (-tx * B[1] + 2.0 * ty * B[0]) * tx2ty2qp;
167 k[step4 + 1] = ty *
h;
168 k[step4 + 2] = Ax[step] * qp0;
169 k[step4 + 3] = Ay[step] * qp0;
173 for (i = 0; i < 4; ++i) {
174 T_out[i] = x0[i] + c[0] * k[i] + c[1] * k[4 + i] + c[2] * k[8 + i] + c[3] * k[12 + i];
190 for (step = 0; step < 4; ++step) {
191 for (i = 0; i < 4; ++i) {
196 x[i] = x0[i] + b[step] * k1[step * 4 - 4 + i];
200 k1[step4] =
x[2] *
h;
201 k1[step4 + 1] =
x[3] *
h;
202 k1[step4 + 2] = Ax[step] + Ax_tx[step] *
x[2] + Ax_ty[step] *
x[3];
203 k1[step4 + 3] = Ay[step] + Ay_tx[step] *
x[2] + Ay_ty[step] *
x[3];
209 for (i = 0; i < 4; ++i) {
210 J[20 + i] = x0[i] + c[0] * k1[i] + c[1] * k1[4 + i] + c[2] * k1[8 + i] + c[3] * k1[12 + i];
229 for (step = 0; step < 4; ++step) {
230 for (i = 0; i < 4; ++i) {
235 x[i] = x0[i] + b[step] * k1[step * 4 - 4 + i];
239 k1[step4] =
x[2] *
h;
240 k1[step4 + 1] =
x[3] *
h;
242 k1[step4 + 3] = Ay_tx[step] *
x[2] + Ay_ty[step] *
x[3];
246 for (i = 0; i < 4; ++i) {
248 J[10 + i] = x0[i] + c[0] * k1[i] + c[1] * k1[4 + i] + c[2] * k1[8 + i] + c[3] * k1[12 + i];
267 for (step = 0; step < 4; ++step) {
268 for (i = 0; i < 4; ++i) {
273 x[i] = x0[i] + b[step] * k1[step * 4 - 4 + i];
277 k1[step4] =
x[2] *
h;
278 k1[step4 + 1] =
x[3] *
h;
279 k1[step4 + 2] = Ax_tx[step] *
x[2] + Ax_ty[step] *
x[3];
284 for (i = 0; i < 3; ++i) {
285 J[15 + i] = x0[i] + c[0] * k1[i] + c[1] * k1[4 + i] + c[2] * k1[8 + i] + c[3] * k1[12 + i];
294 for (i = 0; i < 10; ++i) {
304 Double_t dqp = qp_in - qp0;
306 for (Int_t ip = 0; ip < 4; ip++) {
307 T_out[ip] += J[5 * 4 + ip] * dqp;
326void CbmKFFieldMath::IntegrateField(CbmMagField* MF, Double_t r0[], Double_t r1[], Double_t r2[], Double_t si[3],
327 Double_t Si[3], Double_t sii[3][3], Double_t Sii[3][3], Double_t siii[3][3][3],
328 Double_t Siii[3][3][3])
330 Double_t dz = r2[2] - r0[2];
335 MF->GetFieldValue(r0, B[0]);
336 MF->GetFieldValue(r1, B[1]);
337 MF->GetFieldValue(r2, B[2]);
340 B[0][0] = B[0][1] = B[0][2] = B[1][0] = B[1][1] = B[1][2] = B[2][0] = B[2][1] = B[2][2] = 0;
344 Double_t c1[3] = {1, 4, 1}
346 c2[3][3] = {{5, -4, -1}, {44, 80, -4}, {11, 44, 5}}
348 c3[3][3][3] = {{{35, 20, -1}, {-124, -256, 20}, {-19, -52, -1}},
349 {{524, 176, -52}, {1760, 2240, -256}, {-52, 176, 20}},
350 {{125, -52, -19}, {1028, 1760, -124}, {125, 524, 35}}};
352 Double_t C1[3] = {1, 2, 0}
354 C2[3][3] = {{38, 8, -4}, {148, 208, -20}, {3, 36, 3}}
356 C3[3][3][3] = {{{85, 28, -5}, {4, -80, 4}, {-17, -20, 1}},
357 {{494, 200, -46}, {1256, 1376, -184}, {-94, 8, 14}},
358 {{15, -12, -3}, {252, 432, -36}, {21, 84, 3}}};
362 for (Int_t
x = 0;
x < 3;
x++) {
365 for (Int_t n = 0; n < 3; n++) {
366 si[
x] += c1[n] * B[n][
x];
373 for (Int_t n = 0; n < 3; n++) {
374 Si[
x] += C1[n] * B[n][
x];
376 Si[
x] *= dz * dz / 6.;
379 for (Int_t
y = 0;
y < 3;
y++) {
382 for (Int_t n = 0; n < 3; n++) {
383 for (Int_t m = 0;
m < 3;
m++) {
384 sii[
x][
y] += c2[n][
m] * B[n][
x] * B[
m][
y];
387 sii[
x][
y] *= dz * dz / 360.;
392 for (Int_t n = 0; n < 3; n++) {
393 for (Int_t m = 0;
m < 3;
m++) {
394 Sii[
x][
y] += C2[n][
m] * B[n][
x] * B[
m][
y];
397 Sii[
x][
y] *= dz * dz * dz / 2520.;
400 for (Int_t z = 0; z < 3; z++) {
403 for (Int_t n = 0; n < 3; n++) {
404 for (Int_t m = 0;
m < 3;
m++) {
405 for (Int_t k = 0; k < 3; k++) {
406 siii[
x][
y][z] += c3[n][
m][k] * B[n][
x] * B[
m][
y] * B[k][z];
410 siii[
x][
y][z] *= dz * dz * dz / 45360.;
415 for (Int_t n = 0; n < 3; n++) {
416 for (Int_t m = 0;
m < 3;
m++) {
417 for (Int_t k = 0; k < 3; k++) {
418 Siii[
x][
y][z] += C3[n][
m][k] * B[n][
x] * B[
m][
y] * B[k][z];
422 Siii[
x][
y][z] *= dz * dz * dz * dz / 90720.;
436void CbmKFFieldMath::GetCoefficients(
const Double_t
x,
const Double_t
y, Double_t Xi[3][3], Double_t Yi[3][3],
437 Double_t Xii[3][3][3], Double_t Yii[3][3][3], Double_t Xiii[3][3][3][3],
438 Double_t Yiii[3][3][3][3])
443 xy =
x *
y, yy =
y *
y,
445 x2 =
x * 2, x4 =
x * 4, xx31 = xx * 3 + 1, xx33 = xx * 3 + 3, xx82 = xx * 8 + 2, xx86 = xx * 8 + 6,
446 xx153 = xx * 15 + 3, xx159 = xx * 15 + 9,
448 y2 =
y * 2, y4 =
y * 4, yy31 = yy * 3 + 1, yy33 = yy * 3 + 3, yy82 = yy * 8 + 2, yy86 = yy * 8 + 6,
449 yy153 = yy * 15 + 3, yy159 = yy * 15 + 9, xxyy2 = 2 * (xx - yy),
451 xx1053 =
y * (30 * xx + xx159), yy1053 =
x * (30 * yy + yy159);
454 Double_t X1[3] = {xy, -xx - 1,
y}
457 X2[3][3] = {{
x * yy31, -
y * xx31, 2 * yy + 1}, {-
y * xx31,
x * xx33, -2 * xy}, {yy - xx, -2 * xy, -
x}}
460 X3[3][3][3] = {{{xy * yy159, -xx * yy153 - yy31,
y * yy86},
461 {-xx * yy153 - yy31, xy * xx159, -
x * yy82},
462 {y2 * (-xxyy2 + 1), -
x * yy82, -3 * xy}},
463 {{-xx * yy153 - yy31, xy * xx159, -
x * yy82},
464 {xy * xx159, -3 * (5 * xx * xx + 6 * xx + 1),
y * xx82},
465 {x2 * (xxyy2 + 1),
y * xx82, xx31}},
466 {{
y * (-6 * xx + yy31),
x * (xx31 - 6 * yy), -4 * xy},
467 {
x * (3 * xx - 6 * yy + 1), 3 *
y * xx31, xxyy2},
468 {-4 * xy, xxyy2, -
y}}};
469 Double_t X1x[3] = {
y, -x2, 0}
472 X2x[3][3] = {{yy31, -6 * xy, 0}, {-6 * xy, 3 * xx31, -y2}, {-x2, -y2, -1}}
475 X3x[3][3][3] = {{{
y * yy159, -x2 * yy153, 0}, {-x2 * yy153, xx1053, -yy82}, {-8 * xy, -yy82, -3 *
y}},
476 {{-x2 * yy153, xx1053, -yy82},
477 {xx1053, -x4 * xx159, 16 * xy},
478 {2 * (6 * xx - 2 * yy + 1), 16 * xy, 6 *
x}},
479 {{-12 * xy, 9 * xx - 6 * yy + 1, -y4}, {9 * xx - 6 * yy + 1, 18 * xy, x4}, {-y4, x4, 0}}};
481 Double_t X1y[3] = {
x, 0, 1}
484 X2y[3][3] = {{6 * xy, -xx31, y4}, {-xx31, 0, -x2}, {y2, -x2, 0}}
487 X3y[3][3][3] = {{{yy1053, -y2 * xx153, 16 * yy + yy86},
488 {-y2 * xx153,
x * xx159, -16 * xy},
489 {yy82 - 2 * xxyy2, -16 * xy, -3 *
x}},
490 {{-y2 * xx153,
x * xx159, -16 * xy}, {
x * xx159, 0, xx82}, {-8 * xy, xx82, 0}},
491 {{-6 * xx + 9 * yy + 1, -12 * xy, -x4}, {-12 * xy, 3 * xx31, -y4}, {-x4, -y4, -1}}};
494 Double_t Y1[3] = {yy + 1, -xy, -
x}
497 Y2[3][3] = {{
y * yy33, -
x * yy31, -2 * xy}, {-
x * yy31,
y * xx31, 2 * xx + 1}, {-2 * xy, xx - yy, -
y}}
500 Y3[3][3][3] = {{{3 * (5 * yy * yy + 6 * yy + 1), -xy * yy159, -
x * yy82},
501 {-xy * yy159, xx * yy153 + yy31,
y * xx82},
502 {-
x * yy82, -y2 * (-xxyy2 + 1), -yy31}},
503 {{-xy * yy159, xx * yy153 + yy31,
y * xx82},
504 {xx * yy153 + yy31, -xy * xx159, -
x * xx86},
505 {
y * xx82, -x2 * (xxyy2 + 1), 3 * xy}},
506 {{-3 *
x * yy31,
y * (6 * xx - yy31), xxyy2},
507 {
y * (6 * xx - yy31),
x * (6 * yy - xx31), 4 * xy},
508 {xxyy2, 4 * xy,
x}}};
509 Double_t Y1x[3] = {0, -
y, -1}
512 Y2x[3][3] = {{0, -yy31, -y2}, {-yy31, 6 * xy, x4}, {-y2, x2, 0}}
515 Y3x[3][3][3] = {{{0, -
y * yy159, -yy82}, {-
y * yy159, x2 * yy153, 16 * xy}, {-yy82, 8 * xy, 0}},
516 {{-
y * yy159, x2 * yy153, 16 * xy},
517 {x2 * yy153, -xx1053, -16 * xx - xx86},
518 {16 * xy, -2 * (6 * xx - 2 * yy + 1), 3 *
y}},
519 {{-3 * yy31, 12 * xy, x4}, {12 * xy, -9 * xx + 6 * yy - 1, y4}, {x4, y4, 1}}};
520 Double_t Y1y[3] = {y2, -
x, 0}
523 Y2y[3][3] = {{3 * yy31, -6 * xy, -x2}, {-6 * xy, xx31, 0}, {-x2, -y2, -1}}
527 {{y4 * yy159, -yy1053, -16 * xy}, {-yy1053, y2 * xx153, xx82}, {-16 * xy, 4 * xx - 12 * yy - 2, -6 *
y}},
528 {{-yy1053, y2 * xx153, xx82}, {y2 * xx153, -
x * xx159, 0}, {xx82, 8 * xy, 3 *
x}},
529 {{-18 * xy, 6 * xx - 9 * yy - 1, -y4}, {6 * xx - 9 * yy - 1, 12 * xy, x4}, {-y4, x4, 0}}};
532 for (Int_t i = 0; i < 3; i++) {
539 for (Int_t i = 0; i < 3; i++) {
546 for (Int_t i = 0; i < 3; i++) {
547 for (Int_t j = 0; j < 3; j++) {
548 Xii[0][i][j] = X2[i][j];
549 Xii[1][i][j] = X2x[i][j];
550 Xii[2][i][j] = X2y[i][j];
555 for (Int_t i = 0; i < 3; i++) {
556 for (Int_t j = 0; j < 3; j++) {
557 Yii[0][i][j] = Y2[i][j];
558 Yii[1][i][j] = Y2x[i][j];
559 Yii[2][i][j] = Y2y[i][j];
564 for (Int_t i = 0; i < 3; i++) {
565 for (Int_t j = 0; j < 3; j++) {
566 for (Int_t k = 0; k < 3; k++) {
567 Xiii[0][i][j][k] = X3[i][j][k];
568 Xiii[1][i][j][k] = X3x[i][j][k];
569 Xiii[2][i][j][k] = X3y[i][j][k];
575 for (Int_t i = 0; i < 3; i++) {
576 for (Int_t j = 0; j < 3; j++) {
577 for (Int_t k = 0; k < 3; k++) {
578 Yiii[0][i][j][k] = Y3[i][j][k];
579 Yiii[1][i][j][k] = Y3x[i][j][k];
580 Yiii[2][i][j][k] = Y3y[i][j][k];
594void CbmKFFieldMath::ExtrapolateAnalytic(
const Double_t T_in[],
595 const Double_t C_in[],
609 const Double_t
c_light = 0.000299792458;
611 Double_t qp_in = T_in[4];
612 Double_t z_in = T_in[5];
613 Double_t dz = z_out - z_in;
617 Double_t tx = T_in[2], ty = T_in[3],
619 A1[3][3], B1[3][3], A2[3][3][3], B2[3][3][3], A3[3][3][3][3], B3[3][3][3][3];
621 GetCoefficients(tx, ty, A1, B1, A2, B2, A3, B3);
623 Double_t t2 = 1. + tx * tx + ty * ty, t =
sqrt(t2),
h = qp0 *
c_light, ht =
h * t;
625 Double_t s1[3], s2[3][3], s3[3][3][3], S1[3], S2[3][3], S3[3][3][3];
628 Double_t r0[3], r1[3], r2[3];
634 r2[0] = T_in[0] + T_in[2] * dz;
635 r2[1] = T_in[1] + T_in[3] * dz;
638 r1[0] = 0.5 * (r0[0] + r2[0]);
639 r1[1] = 0.5 * (r0[1] + r2[1]);
640 r1[2] = 0.5 * (r0[2] + r2[2]);
646 MF->GetFieldValue(r0, B[0]);
647 MF->GetFieldValue(r1, B[1]);
648 MF->GetFieldValue(r2, B[2]);
651 B[0][0] = B[0][1] = B[0][2] = B[1][0] = B[1][1] = B[1][2] = B[2][0] = B[2][1] = B[2][2] = 0;
653 Double_t Sy = (7 * B[0][1] + 6 * B[1][1] - B[2][1]) * dz * dz / 96.;
654 r1[0] = T_in[0] + tx * dz / 2 + ht * Sy * A1[0][1];
655 r1[1] = T_in[1] + ty * dz / 2 + ht * Sy * B1[0][1];
657 Sy = (B[0][1] + 2 * B[1][1]) * dz * dz / 6.;
658 r2[0] = T_in[0] + tx * dz + ht * Sy * A1[0][1];
659 r2[1] = T_in[1] + ty * dz + ht * Sy * B1[0][1];
661 IntegrateField(MF, r0, r1, r2, s1, S1, s2, S2, s3, S3);
664 Double_t sA1 = 0, sA2 = 0, sA3 = 0, sB1 = 0, sB2 = 0, sB3 = 0;
665 Double_t sA1x = 0, sA2x = 0, sA3x = 0, sB1x = 0, sB2x = 0, sB3x = 0;
666 Double_t sA1y = 0, sA2y = 0, sA3y = 0, sB1y = 0, sB2y = 0, sB3y = 0;
668 Double_t SA1 = 0, SA2 = 0, SA3 = 0, SB1 = 0, SB2 = 0, SB3 = 0;
669 Double_t SA1x = 0, SA2x = 0, SA3x = 0, SB1x = 0, SB2x = 0, SB3x = 0;
670 Double_t SA1y = 0, SA2y = 0, SA3y = 0, SB1y = 0, SB2y = 0, SB3y = 0;
673 for (Int_t n = 0; n < 3; n++) {
674 sA1 += s1[n] * A1[0][n];
675 sA1x += s1[n] * A1[1][n];
676 sA1y += s1[n] * A1[2][n];
677 sB1 += s1[n] * B1[0][n];
678 sB1x += s1[n] * B1[1][n];
679 sB1y += s1[n] * B1[2][n];
681 SA1 += S1[n] * A1[0][n];
682 SA1x += S1[n] * A1[1][n];
683 SA1y += S1[n] * A1[2][n];
684 SB1 += S1[n] * B1[0][n];
685 SB1x += S1[n] * B1[1][n];
686 SB1y += S1[n] * B1[2][n];
689 for (Int_t m = 0;
m < 3;
m++) {
690 sA2 += s2[n][
m] * A2[0][n][
m];
691 sA2x += s2[n][
m] * A2[1][n][
m];
692 sA2y += s2[n][
m] * A2[2][n][
m];
693 sB2 += s2[n][
m] * B2[0][n][
m];
694 sB2x += s2[n][
m] * B2[1][n][
m];
695 sB2y += s2[n][
m] * B2[2][n][
m];
697 SA2 += S2[n][
m] * A2[0][n][
m];
698 SA2x += S2[n][
m] * A2[1][n][
m];
699 SA2y += S2[n][
m] * A2[2][n][
m];
700 SB2 += S2[n][
m] * B2[0][n][
m];
701 SB2x += S2[n][
m] * B2[1][n][
m];
702 SB2y += S2[n][
m] * B2[2][n][
m];
705 for (Int_t k = 0; k < 3; k++) {
706 sA3 += s3[n][
m][k] * A3[0][n][
m][k];
707 sA3x += s3[n][
m][k] * A3[1][n][
m][k];
708 sA3y += s3[n][
m][k] * A3[2][n][
m][k];
709 sB3 += s3[n][
m][k] * B3[0][n][
m][k];
710 sB3x += s3[n][
m][k] * B3[1][n][
m][k];
711 sB3y += s3[n][
m][k] * B3[2][n][
m][k];
713 SA3 += S3[n][
m][k] * A3[0][n][
m][k];
714 SA3x += S3[n][
m][k] * A3[1][n][
m][k];
715 SA3y += S3[n][
m][k] * A3[2][n][
m][k];
716 SB3 += S3[n][
m][k] * B3[0][n][
m][k];
717 SB3x += S3[n][
m][k] * B3[1][n][
m][k];
718 SB3y += S3[n][
m][k] * B3[2][n][
m][k];
727 T_out[0] = T_in[0] + tx * dz + ht * (SA1 + ht * (SA2 + ht * SA3));
728 T_out[1] = T_in[1] + ty * dz + ht * (SB1 + ht * (SB2 + ht * SB3));
729 T_out[2] = T_in[2] + ht * (sA1 + ht * (sA2 + ht * sA3));
730 T_out[3] = T_in[3] + ht * (sB1 + ht * (sB2 + ht * sB3));
755 J[10] = dz +
h * tx * (1. / t * SA1 +
h * (2 * SA2 + 3 * ht * SA3)) + ht * (SA1x + ht * (SA2x + ht * SA3x));
756 J[11] =
h * tx * (1. / t * SB1 +
h * (2 * SB2 + 3 * ht * SB3)) + ht * (SB1x + ht * (SB2x + ht * SB3x));
757 J[12] = 1 +
h * tx * (1. / t * sA1 +
h * (2 * sA2 + 3 * ht * sA3)) + ht * (sA1x + ht * (sA2x + ht * sA3x));
758 J[13] =
h * tx * (1. / t * sB1 +
h * (2 * sB2 + 3 * ht * sB3)) + ht * (sB1x + ht * (sB2x + ht * sB3x));
764 J[15] =
h * ty * (1. / t * SA1 +
h * (2 * SA2 + 3 * ht * SA3)) + ht * (SA1y + ht * (SA2y + ht * SA3y));
765 J[16] = dz +
h * ty * (1. / t * SB1 +
h * (2 * SB2 + 3 * ht * SB3)) + ht * (SB1y + ht * (SB2y + ht * SB3y));
766 J[17] =
h * ty * (1. / t * sA1 +
h * (2 * sA2 + 3 * ht * sA3)) + ht * (sA1y + ht * (sA2y + ht * sA3y));
767 J[18] = 1 +
h * ty * (1. / t * sB1 +
h * (2 * sB2 + 3 * ht * sB3)) + ht * (sB1y + ht * (sB2y + ht * sB3y));
773 J[20] =
c_light * t * (SA1 + ht * (2 * SA2 + 3 * ht * SA3));
774 J[21] =
c_light * t * (SB1 + ht * (2 * SB2 + 3 * ht * SB3));
775 J[22] =
c_light * t * (sA1 + ht * (2 * sA2 + 3 * ht * sA3));
776 J[23] =
c_light * t * (sB1 + ht * (2 * sB2 + 3 * ht * sB3));
783 Double_t dqp = qp_in - qp0;
785 for (Int_t i = 0; i < 4; i++) {
786 T_out[i] += J[5 * 4 + i] * dqp;
804void CbmKFFieldMath::ExtrapolateACentral(
const Double_t T_in[],
805 const Double_t C_in[],
819 const Double_t
c_light = 0.000299792458;
821 Double_t qp_in = T_in[4];
822 Double_t z_in = T_in[5];
823 Double_t dz = z_out - z_in;
825 Double_t i1[3], I1[3];
843 r[1][2] = 0.5 * (r[0][2] + r[2][2]);
845 IntegrateField(MF, r[0], r[1], r[2], i1, I1, 0, 0, 0, 0);
849 Double_t
x = T_in[2],
852 xx =
x *
x, xy =
x *
y, yy =
y *
y,
854 x2 =
x * 2, y2 =
y * 2;
857 Double_t X1[3] = {xy, -xx - 1,
y};
858 Double_t X1x[3] = {
y, -x2, 0};
859 Double_t X1y[3] = {
x, 0, 1};
862 Double_t Y1[3] = {yy + 1, -xy, -
x};
863 Double_t Y1x[3] = {0, -
y, -1};
864 Double_t Y1y[3] = {y2, -
x, 0};
867 Double_t iX1 = 0, iY1 = 0;
868 Double_t iX1x = 0, iY1x = 0;
869 Double_t iX1y = 0, iY1y = 0;
871 Double_t IX1 = 0, IY1 = 0;
872 Double_t IX1x = 0, IY1x = 0;
873 Double_t IX1y = 0, IY1y = 0;
875 for (Int_t n = 0; n < 3; n++) {
879 iX1 += i1[n] * X1[n];
880 iX1x += i1[n] * X1x[n];
881 iX1y += i1[n] * X1y[n];
882 iY1 += i1[n] * Y1[n];
883 iY1x += i1[n] * Y1x[n];
884 iY1y += i1[n] * Y1y[n];
886 IX1 += I1[n] * X1[n];
887 IX1x += I1[n] * X1x[n];
888 IX1y += I1[n] * X1y[n];
889 IY1 += I1[n] * Y1[n];
890 IY1x += I1[n] * Y1x[n];
891 IY1y += I1[n] * Y1y[n];
894 Double_t t2 = 1. + xx + yy, t =
sqrt(t2),
h = qp0 *
c_light, ht =
h * t;
896 T_out[0] = T_in[0] +
x * dz + ht * IX1;
897 T_out[1] = T_in[1] +
y * dz + ht * IY1;
898 T_out[2] = T_in[2] + ht * iX1;
899 T_out[3] = T_in[3] + ht * iY1;
924 J[10] = dz +
h *
x / t * IX1 + ht * IX1x;
925 J[11] =
h *
x / t * IY1 + ht * IY1x;
926 J[12] = 1 +
h *
x / t * iX1 + ht * iX1x;
927 J[13] =
h *
x / t * iY1 + ht * iY1x;
933 J[15] =
h *
y / t * IX1 + ht * IX1y;
934 J[16] = dz +
h *
y / t * IY1 + ht * IY1y;
935 J[17] =
h *
y / t * iX1 + ht * iX1y;
936 J[18] = 1 +
h *
y / t * iY1 + ht * iY1y;
952 Double_t dqp = qp_in - qp0;
954 for (Int_t i = 0; i < 4; i++) {
955 T_out[i] += J[5 * 4 + i] * dqp;
974 const Double_t C_in[],
987 for (
int i = 0; i < 6; i++) {
988 ok = ok && std::isfinite(T_in[i]) && (T_in[i] < 1.e5);
991 for (
int i = 0; i < 15; i++) {
992 ok = ok && std::isfinite(C_in[i]);
996 for (
int i = 0; i < 6; i++) {
1000 for (
int i = 0; i < 15; i++) {
1003 C_out[0] = C_out[2] = C_out[5] = C_out[9] = C_out[14] = 100.;
1009 const Double_t c_light = 0.000299792458;
1011 Double_t qp_in = T_in[4];
1012 Double_t z_in = T_in[5];
1013 Double_t dz = z_out - z_in;
1017 Double_t
x = T_in[2],
1020 xx =
x *
x, xy =
x *
y, yy =
y *
y, x2 =
x * 2, x4 =
x * 4, xx31 = xx * 3 + 1, xx159 = xx * 15 + 9, y2 =
y * 2;
1022 Double_t Ax = xy, Ay = -xx - 1, Az =
y, Ayy =
x * (xx * 3 + 3), Ayz = -2 * xy, Ayyy = -(15 * xx * xx + 18 * xx + 3),
1024 Ax_x =
y, Ay_x = -x2, Az_x = 0, Ayy_x = 3 * xx31, Ayz_x = -y2, Ayyy_x = -x4 * xx159,
1026 Ax_y =
x, Ay_y = 0, Az_y = 1, Ayy_y = 0, Ayz_y = -x2, Ayyy_y = 0,
1028 Bx = yy + 1, By = -xy, Bz = -
x, Byy =
y * xx31, Byz = 2 * xx + 1, Byyy = -xy * xx159,
1030 Bx_x = 0, By_x = -
y, Bz_x = -1, Byy_x = 6 * xy, Byz_x = x4, Byyy_x = -
y * (45 * xx + 9),
1032 Bx_y = y2, By_y = -
x, Bz_y = 0, Byy_y = xx31, Byz_y = 0, Byyy_y = -
x * xx159;
1037 Double_t t2 = 1. + xx + yy;
1041 Double_t t =
sqrt(t2),
h = qp0 * c_light, ht =
h * t;
1043 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;
1048 Double_t r0[3], r1[3], r2[3];
1056 r2[0] = T_in[0] + T_in[2] * dz;
1057 r2[1] = T_in[1] + T_in[3] * dz;
1060 r1[0] = 0.5 * (r0[0] + r2[0]);
1061 r1[1] = 0.5 * (r0[1] + r2[1]);
1062 r1[2] = 0.5 * (r0[2] + r2[2]);
1064 MF->GetFieldValue(r0, B[0]);
1065 MF->GetFieldValue(r1, B[1]);
1066 MF->GetFieldValue(r2, B[2]);
1068 Sy = (7 * B[0][1] + 6 * B[1][1] - B[2][1]) * dz * dz / 96.;
1069 r1[0] = T_in[0] +
x * dz / 2 + ht * Sy * Ay;
1070 r1[1] = T_in[1] +
y * dz / 2 + ht * Sy * By;
1072 Sy = (B[0][1] + 2 * B[1][1]) * dz * dz / 6.;
1073 r2[0] = T_in[0] +
x * dz + ht * Sy * Ay;
1074 r2[1] = T_in[1] +
y * dz + ht * Sy * By;
1080 MF->GetFieldValue(r0, B[0]);
1081 MF->GetFieldValue(r1, B[1]);
1082 MF->GetFieldValue(r2, B[2]);
1084 sx = (B[0][0] + 4 * B[1][0] + B[2][0]) * dz / 6.;
1085 sy = (B[0][1] + 4 * B[1][1] + B[2][1]) * dz / 6.;
1086 sz = (B[0][2] + 4 * B[1][2] + B[2][2]) * dz / 6.;
1088 Sx = (B[0][0] + 2 * B[1][0]) * dz * dz / 6.;
1089 Sy = (B[0][1] + 2 * B[1][1]) * dz * dz / 6.;
1090 Sz = (B[0][2] + 2 * B[1][2]) * dz * dz / 6.;
1092 Double_t c2[3][3] = {{5, -4, -1}, {44, 80, -4}, {11, 44, 5}};
1093 Double_t C2[3][3] = {{38, 8, -4}, {148, 208, -20}, {3, 36, 3}};
1094 for (Int_t n = 0; n < 3; n++) {
1095 for (Int_t m = 0; m < 3; m++) {
1096 syz += c2[n][m] * B[n][1] * B[m][2];
1097 Syz += C2[n][m] * B[n][1] * B[m][2];
1101 syz *= dz * dz / 360.;
1102 Syz *= dz * dz * dz / 2520.;
1104 syy = (B[0][1] + 4 * B[1][1] + B[2][1]) * dz;
1105 syyy = syy * syy * syy / 1296;
1106 syy = syy * syy / 72;
1108 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])
1109 + B[2][1] * (3 * B[2][1]))
1110 * dz * dz * dz / 2520.;
1112 * (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])
1113 + B[2][1] * (19 * B[2][1]))
1114 + B[1][1] * (B[1][1] * (1376 * B[1][1] + 256 * B[2][1]) + B[2][1] * (62 * B[2][1]))
1115 + B[2][1] * B[2][1] * (3 * B[2][1]))
1116 * dz * dz * dz * dz / 90720.;
1122 sA1 = sx * Ax + sy * Ay + sz * Az,
1123 sA1_x = sx * Ax_x + sy * Ay_x + sz * Az_x, sA1_y = sx * Ax_y + sy * Ay_y + sz * Az_y,
1125 sB1 = sx * Bx + sy * By + sz * Bz, sB1_x = sx * Bx_x + sy * By_x + sz * Bz_x,
1126 sB1_y = sx * Bx_y + sy * By_y + sz * Bz_y,
1128 SA1 = Sx * Ax + Sy * Ay + Sz * Az, SA1_x = Sx * Ax_x + Sy * Ay_x + Sz * Az_x,
1129 SA1_y = Sx * Ax_y + Sy * Ay_y + Sz * Az_y,
1131 SB1 = Sx * Bx + Sy * By + Sz * Bz, SB1_x = Sx * Bx_x + Sy * By_x + Sz * Bz_x,
1132 SB1_y = Sx * Bx_y + Sy * By_y + Sz * Bz_y,
1135 sA2 = syy * Ayy + syz * Ayz, sA2_x = syy * Ayy_x + syz * Ayz_x, sA2_y = syy * Ayy_y + syz * Ayz_y,
1136 sB2 = syy * Byy + syz * Byz, sB2_x = syy * Byy_x + syz * Byz_x, sB2_y = syy * Byy_y + syz * Byz_y,
1138 SA2 = Syy * Ayy + Syz * Ayz, SA2_x = Syy * Ayy_x + Syz * Ayz_x, SA2_y = Syy * Ayy_y + Syz * Ayz_y,
1139 SB2 = Syy * Byy + Syz * Byz, SB2_x = Syy * Byy_x + Syz * Byz_x, SB2_y = Syy * Byy_y + Syz * Byz_y,
1142 sA3 = syyy * Ayyy, sA3_x = syyy * Ayyy_x, sA3_y = syyy * Ayyy_y, sB3 = syyy * Byyy, sB3_x = syyy * Byyy_x,
1143 sB3_y = syyy * Byyy_y,
1145 SA3 = Syyy * Ayyy, SA3_x = Syyy * Ayyy_x, SA3_y = Syyy * Ayyy_y, SB3 = Syyy * Byyy, SB3_x = Syyy * Byyy_x,
1146 SB3_y = Syyy * Byyy_y;
1149 T_out[0] = T_in[0] +
x * dz + ht * (SA1 + ht * (SA2 + ht * SA3));
1150 T_out[1] = T_in[1] +
y * dz + ht * (SB1 + ht * (SB2 + ht * SB3));
1151 T_out[2] = T_in[2] + ht * (sA1 + ht * (sA2 + ht * sA3));
1152 T_out[3] = T_in[3] + ht * (sB1 + ht * (sB2 + ht * sB3));
1177 J[10] = dz +
h *
x * (1. / t * SA1 +
h * (2 * SA2 + 3 * ht * SA3)) + ht * (SA1_x + ht * (SA2_x + ht * SA3_x));
1178 J[11] =
h *
x * (1. / t * SB1 +
h * (2 * SB2 + 3 * ht * SB3)) + ht * (SB1_x + ht * (SB2_x + ht * SB3_x));
1179 J[12] = 1 +
h *
x * (1. / t * sA1 +
h * (2 * sA2 + 3 * ht * sA3)) + ht * (sA1_x + ht * (sA2_x + ht * sA3_x));
1180 J[13] =
h *
x * (1. / t * sB1 +
h * (2 * sB2 + 3 * ht * sB3)) + ht * (sB1_x + ht * (sB2_x + ht * sB3_x));
1186 J[15] =
h *
y * (1. / t * SA1 +
h * (2 * SA2 + 3 * ht * SA3)) + ht * (SA1_y + ht * (SA2_y + ht * SA3_y));
1187 J[16] = dz +
h *
y * (1. / t * SB1 +
h * (2 * SB2 + 3 * ht * SB3)) + ht * (SB1_y + ht * (SB2_y + ht * SB3_y));
1188 J[17] =
h *
y * (1. / t * sA1 +
h * (2 * sA2 + 3 * ht * sA3)) + ht * (sA1_y + ht * (sA2_y + ht * sA3_y));
1189 J[18] = 1 +
h *
y * (1. / t * sB1 +
h * (2 * sB2 + 3 * ht * sB3)) + ht * (sB1_y + ht * (sB2_y + ht * sB3_y));
1195 J[20] = c_light * t * (SA1 + ht * (2 * SA2 + 3 * ht * SA3));
1196 J[21] = c_light * t * (SB1 + ht * (2 * SB2 + 3 * ht * SB3));
1197 J[22] = c_light * t * (sA1 + ht * (2 * sA2 + 3 * ht * sA3));
1198 J[23] = c_light * t * (sB1 + ht * (2 * sB2 + 3 * ht * sB3));
1205 Double_t dqp = qp_in - qp0;
1207 for (Int_t i = 0; i < 4; i++) {
1208 T_out[i] += J[5 * 4 + i] * dqp;
1213 if (C_in && C_out) {
ClassImp(CbmKFFieldMath) void CbmKFFieldMath
friend fvec sqrt(const fvec &a)
static void ExtrapolateLine(const Double_t T_in[], const Double_t C_in[], Double_t T_out[], Double_t C_out[], Double_t z_out)
static Int_t ExtrapolateRK4(const Double_t T_in[], const Double_t C_in[], Double_t T_out[], Double_t C_out[], Double_t z_out, Double_t qp0, FairField *MF)
static Int_t ExtrapolateALight(const Double_t T_in[], const Double_t C_in[], Double_t T_out[], Double_t C_out[], Double_t z_out, Double_t qp0, FairField *MF)
static void multQtSQ(Int_t N, const Double_t Q[], const Double_t S[], Double_t S_out[])
Data class with information on a STS local track.
const fvec c_light(0.000299792458)