15 const Double_t C_in[],
21 Double_t dz = z_out - T_in[5];
24 T_out[0] = T_in[0] + dz * T_in[2];
25 T_out[1] = T_in[1] + dz * T_in[3];
33 const Double_t dzC_in8 = dz * C_in[8];
35 C_out[4] = C_in[4] + dzC_in8;
36 C_out[1] = C_in[1] + dz * (C_out[4] + C_in[6]);
38 const Double_t C_in3 = C_in[3];
40 C_out[3] = C_in3 + dz * C_in[5];
41 C_out[0] = C_in[0] + dz * (C_out[3] + C_in3);
43 const Double_t C_in7 = C_in[7];
45 C_out[7] = C_in7 + dz * C_in[9];
46 C_out[2] = C_in[2] + dz * (C_out[7] + C_in7);
48 C_out[6] = C_in[6] + dzC_in8;
62 const Double_t T_in[],
63 const Double_t C_in[],
94 const Double_t
c_light = 0.000299792458;
96 static Double_t a[4] = {0.0, 0.5, 0.5, 1.0};
97 static Double_t c[4] = {1.0 / 6.0, 1.0 / 3.0, 1.0 / 3.0, 1.0 / 6.0};
98 static Double_t b[4] = {0.0, 0.5, 0.5, 1.0};
101 Double_t k[16], x0[4],
x[4], k1[16];
102 Double_t Ax[4], Ay[4], Ax_tx[4], Ay_tx[4], Ax_ty[4], Ay_ty[4];
106 Double_t qp_in = T_in[4];
107 Double_t z_in = T_in[5];
108 Double_t
h = z_out - z_in;
121 for (step = 0; step < 4; ++step) {
122 for (
i = 0;
i < 4; ++
i) {
126 x[
i] = x0[
i] + b[step] * k[step * 4 - 4 +
i];
130 Double_t point[3] = {
x[0],
x[1], z_in + a[step] *
h};
133 MF->GetFieldValue(point, B);
135 B[0] = B[1] = B[2] = 0.;
140 Double_t tx2 = tx * tx;
141 Double_t ty2 = ty * ty;
142 Double_t txty = tx * ty;
143 Double_t tx2ty21 = 1.0 + tx2 + ty2;
144 if (tx2ty21 > 1.e4)
return 1;
145 Double_t I_tx2ty21 = 1.0 / tx2ty21 * qp0;
146 Double_t tx2ty2 =
sqrt(tx2ty21);
149 Double_t tx2ty2qp = tx2ty2 * qp0;
150 Ax[step] = (txty * B[0] + ty * B[2] - (1.0 + tx2) * B[1]) * tx2ty2;
151 Ay[step] = (-txty * B[1] - tx * B[2] + (1.0 + ty2) * B[0]) * tx2ty2;
154 Ax[step] * tx * I_tx2ty21 + (ty * B[0] - 2.0 * tx * B[1]) * tx2ty2qp;
155 Ax_ty[step] = Ax[step] * ty * I_tx2ty21 + (tx * B[0] + B[2]) * tx2ty2qp;
156 Ay_tx[step] = Ay[step] * tx * I_tx2ty21 + (-ty * B[1] - B[2]) * tx2ty2qp;
158 Ay[step] * ty * I_tx2ty21 + (-tx * B[1] + 2.0 * ty * B[0]) * tx2ty2qp;
162 k[step4 + 1] = ty *
h;
163 k[step4 + 2] = Ax[step] * qp0;
164 k[step4 + 3] = Ay[step] * qp0;
168 for (
i = 0;
i < 4; ++
i) {
169 T_out[
i] = x0[
i] + c[0] * k[
i] + c[1] * k[4 +
i] + c[2] * k[8 +
i]
186 for (step = 0; step < 4; ++step) {
187 for (
i = 0;
i < 4; ++
i) {
191 x[
i] = x0[
i] + b[step] * k1[step * 4 - 4 +
i];
195 k1[step4] =
x[2] *
h;
196 k1[step4 + 1] =
x[3] *
h;
197 k1[step4 + 2] = Ax[step] + Ax_tx[step] *
x[2] + Ax_ty[step] *
x[3];
198 k1[step4 + 3] = Ay[step] + Ay_tx[step] *
x[2] + Ay_ty[step] *
x[3];
204 for (
i = 0;
i < 4; ++
i) {
205 J[20 +
i] = x0[
i] + c[0] * k1[
i] + c[1] * k1[4 +
i] + c[2] * k1[8 +
i]
225 for (step = 0; step < 4; ++step) {
226 for (
i = 0;
i < 4; ++
i) {
230 x[
i] = x0[
i] + b[step] * k1[step * 4 - 4 +
i];
234 k1[step4] =
x[2] *
h;
235 k1[step4 + 1] =
x[3] *
h;
237 k1[step4 + 3] = Ay_tx[step] *
x[2] + Ay_ty[step] *
x[3];
241 for (
i = 0;
i < 4; ++
i) {
243 J[10 +
i] = x0[
i] + c[0] * k1[
i] + c[1] * k1[4 +
i] + c[2] * k1[8 +
i]
263 for (step = 0; step < 4; ++step) {
264 for (
i = 0;
i < 4; ++
i) {
268 x[
i] = x0[
i] + b[step] * k1[step * 4 - 4 +
i];
272 k1[step4] =
x[2] *
h;
273 k1[step4 + 1] =
x[3] *
h;
274 k1[step4 + 2] = Ax_tx[step] *
x[2] + Ax_ty[step] *
x[3];
279 for (
i = 0;
i < 3; ++
i) {
280 J[15 +
i] = x0[
i] + c[0] * k1[
i] + c[1] * k1[4 +
i] + c[2] * k1[8 +
i]
290 for (
i = 0;
i < 10; ++
i) {
300 Double_t dqp = qp_in - qp0;
303 for (Int_t ip = 0; ip < 4; ip++) {
304 T_out[ip] += J[5 * 4 + ip] * dqp;
321 void CbmKFFieldMath::IntegrateField(CbmMagField* MF,
329 Double_t siii[3][3][3],
330 Double_t Siii[3][3][3]) {
331 Double_t dz = r2[2] - r0[2];
336 MF->GetFieldValue(r0, B[0]);
337 MF->GetFieldValue(r1, B[1]);
338 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] =
341 B[2][1] = B[2][2] = 0;
345 Double_t c1[3] = {1, 4, 1}
347 c2[3][3] = {{5, -4, -1}, {44, 80, -4}, {11, 44, 5}}
349 c3[3][3][3] = {{{35, 20, -1}, {-124, -256, 20}, {-19, -52, -1}},
350 {{524, 176, -52}, {1760, 2240, -256}, {-52, 176, 20}},
355 Double_t C1[3] = {1, 2, 0}
357 C2[3][3] = {{38, 8, -4}, {148, 208, -20}, {3, 36, 3}}
360 {{85, 28, -5}, {4, -80, 4}, {-17, -20, 1}},
361 {{494, 200, -46}, {1256, 1376, -184}, {-94, 8, 14}},
362 {{15, -12, -3}, {252, 432, -36}, {21, 84, 3}}};
366 for (Int_t
x = 0;
x < 3;
x++) {
369 for (Int_t n = 0; n < 3; n++)
370 si[
x] += c1[n] * B[n][
x];
376 for (Int_t n = 0; n < 3; n++)
377 Si[
x] += C1[n] * B[n][
x];
378 Si[
x] *= dz * dz / 6.;
381 for (Int_t
y = 0;
y < 3;
y++) {
384 for (Int_t n = 0; n < 3; n++)
385 for (Int_t
m = 0;
m < 3;
m++)
386 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];
395 Sii[
x][
y] *= dz * dz * dz / 2520.;
398 for (Int_t z = 0; z < 3; z++) {
401 for (Int_t n = 0; n < 3; n++)
402 for (Int_t
m = 0;
m < 3;
m++)
403 for (Int_t k = 0; k < 3; k++)
404 siii[
x][
y][z] += c3[n][
m][k] * B[n][
x] * B[
m][
y] * B[k][z];
405 siii[
x][
y][z] *= dz * dz * dz / 45360.;
410 for (Int_t n = 0; n < 3; n++)
411 for (Int_t
m = 0;
m < 3;
m++)
412 for (Int_t k = 0; k < 3; k++)
413 Siii[
x][
y][z] += C3[n][
m][k] * B[n][
x] * B[
m][
y] * B[k][z];
414 Siii[
x][
y][z] *= dz * dz * dz * dz / 90720.;
428 void CbmKFFieldMath::GetCoefficients(
const Double_t
x,
432 Double_t Xii[3][3][3],
433 Double_t Yii[3][3][3],
434 Double_t Xiii[3][3][3][3],
435 Double_t Yiii[3][3][3][3]) {
439 xy =
x *
y, yy =
y *
y,
441 x2 =
x * 2, x4 =
x * 4, xx31 = xx * 3 + 1, xx33 = xx * 3 + 3,
442 xx82 = xx * 8 + 2, xx86 = xx * 8 + 6, xx153 = xx * 15 + 3,
445 y2 =
y * 2, y4 =
y * 4, yy31 = yy * 3 + 1, yy33 = yy * 3 + 3,
446 yy82 = yy * 8 + 2, yy86 = yy * 8 + 6, yy153 = yy * 15 + 3,
447 yy159 = yy * 15 + 9, xxyy2 = 2 * (xx - yy),
449 xx1053 =
y * (30 * xx + xx159), yy1053 =
x * (30 * yy + yy159);
452 Double_t X1[3] = {xy, -xx - 1,
y}
455 X2[3][3] = {{
x * yy31, -
y * xx31, 2 * yy + 1},
456 {-
y * xx31,
x * xx33, -2 * xy},
457 {yy - xx, -2 * xy, -
x}}
461 {{xy * yy159, -xx * yy153 - yy31,
y * yy86},
462 {-xx * yy153 - yy31, xy * xx159, -
x * yy82},
463 {y2 * (-xxyy2 + 1), -
x * yy82, -3 * xy}},
464 {{-xx * yy153 - yy31, xy * xx159, -
x * yy82},
465 {xy * xx159, -3 * (5 * xx * xx + 6 * xx + 1),
y * xx82},
466 {x2 * (xxyy2 + 1),
y * xx82, xx31}},
467 {{
y * (-6 * xx + yy31),
x * (xx31 - 6 * yy), -4 * xy},
468 {
x * (3 * xx - 6 * yy + 1), 3 *
y * xx31, xxyy2},
469 {-4 * xy, xxyy2, -
y}}};
470 Double_t X1x[3] = {
y, -x2, 0}
473 X2x[3][3] = {{yy31, -6 * xy, 0},
474 {-6 * xy, 3 * xx31, -y2},
478 X3x[3][3][3] = {{{
y * yy159, -x2 * yy153, 0},
479 {-x2 * yy153, xx1053, -yy82},
480 {-8 * xy, -yy82, -3 *
y}},
481 {{-x2 * yy153, xx1053, -yy82},
482 {xx1053, -x4 * xx159, 16 * xy},
483 {2 * (6 * xx - 2 * yy + 1), 16 * xy, 6 *
x}},
484 {{-12 * xy, 9 * xx - 6 * yy + 1, -y4},
485 {9 * xx - 6 * yy + 1, 18 * xy, x4},
488 Double_t X1y[3] = {
x, 0, 1}
491 X2y[3][3] = {{6 * xy, -xx31, y4}, {-xx31, 0, -x2}, {y2, -x2, 0}}
494 X3y[3][3][3] = {{{yy1053, -y2 * xx153, 16 * yy + yy86},
495 {-y2 * xx153,
x * xx159, -16 * xy},
496 {yy82 - 2 * xxyy2, -16 * xy, -3 *
x}},
497 {{-y2 * xx153,
x * xx159, -16 * xy},
498 {
x * xx159, 0, xx82},
500 {{-6 * xx + 9 * yy + 1, -12 * xy, -x4},
501 {-12 * xy, 3 * xx31, -y4},
505 Double_t Y1[3] = {yy + 1, -xy, -
x}
508 Y2[3][3] = {{
y * yy33, -
x * yy31, -2 * xy},
509 {-
x * yy31,
y * xx31, 2 * xx + 1},
510 {-2 * xy, xx - yy, -
y}}
514 {{3 * (5 * yy * yy + 6 * yy + 1), -xy * yy159, -
x * yy82},
515 {-xy * yy159, xx * yy153 + yy31,
y * xx82},
516 {-
x * yy82, -y2 * (-xxyy2 + 1), -yy31}},
517 {{-xy * yy159, xx * yy153 + yy31,
y * xx82},
518 {xx * yy153 + yy31, -xy * xx159, -
x * xx86},
519 {
y * xx82, -x2 * (xxyy2 + 1), 3 * xy}},
520 {{-3 *
x * yy31,
y * (6 * xx - yy31), xxyy2},
521 {
y * (6 * xx - yy31),
x * (6 * yy - xx31), 4 * xy},
522 {xxyy2, 4 * xy,
x}}};
523 Double_t Y1x[3] = {0, -
y, -1}
526 Y2x[3][3] = {{0, -yy31, -y2}, {-yy31, 6 * xy, x4}, {-y2, x2, 0}}
529 Y3x[3][3][3] = {{{0, -
y * yy159, -yy82},
530 {-
y * yy159, x2 * yy153, 16 * xy},
532 {{-
y * yy159, x2 * yy153, 16 * xy},
533 {x2 * yy153, -xx1053, -16 * xx - xx86},
534 {16 * xy, -2 * (6 * xx - 2 * yy + 1), 3 *
y}},
535 {{-3 * yy31, 12 * xy, x4},
536 {12 * xy, -9 * xx + 6 * yy - 1, y4},
538 Double_t Y1y[3] = {y2, -
x, 0}
541 Y2y[3][3] = {{3 * yy31, -6 * xy, -x2},
546 Y3y[3][3][3] = {{{y4 * yy159, -yy1053, -16 * xy},
547 {-yy1053, y2 * xx153, xx82},
548 {-16 * xy, 4 * xx - 12 * yy - 2, -6 *
y}},
549 {{-yy1053, y2 * xx153, xx82},
550 {y2 * xx153, -
x * xx159, 0},
551 {xx82, 8 * xy, 3 *
x}},
552 {{-18 * xy, 6 * xx - 9 * yy - 1, -y4},
553 {6 * xx - 9 * yy - 1, 12 * xy, x4},
557 for (Int_t
i = 0;
i < 3;
i++) {
564 for (Int_t
i = 0;
i < 3;
i++) {
571 for (Int_t
i = 0;
i < 3;
i++)
572 for (Int_t j = 0; j < 3; j++) {
573 Xii[0][
i][j] = X2[
i][j];
574 Xii[1][
i][j] = X2x[
i][j];
575 Xii[2][
i][j] = X2y[
i][j];
579 for (Int_t
i = 0;
i < 3;
i++)
580 for (Int_t j = 0; j < 3; j++) {
581 Yii[0][
i][j] = Y2[
i][j];
582 Yii[1][
i][j] = Y2x[
i][j];
583 Yii[2][
i][j] = Y2y[
i][j];
587 for (Int_t
i = 0;
i < 3;
i++)
588 for (Int_t j = 0; j < 3; j++)
589 for (Int_t k = 0; k < 3; k++) {
590 Xiii[0][
i][j][k] = X3[
i][j][k];
591 Xiii[1][
i][j][k] = X3x[
i][j][k];
592 Xiii[2][
i][j][k] = X3y[
i][j][k];
596 for (Int_t
i = 0;
i < 3;
i++)
597 for (Int_t j = 0; j < 3; j++)
598 for (Int_t k = 0; k < 3; k++) {
599 Yiii[0][
i][j][k] = Y3[
i][j][k];
600 Yiii[1][
i][j][k] = Y3x[
i][j][k];
601 Yiii[2][
i][j][k] = Y3y[
i][j][k];
613 void CbmKFFieldMath::ExtrapolateAnalytic(
614 const Double_t T_in[],
615 const Double_t C_in[],
628 const Double_t
c_light = 0.000299792458;
630 Double_t qp_in = T_in[4];
631 Double_t z_in = T_in[5];
632 Double_t dz = z_out - z_in;
636 Double_t tx = T_in[2], ty = T_in[3],
638 A1[3][3], B1[3][3], A2[3][3][3], B2[3][3][3], A3[3][3][3][3],
641 GetCoefficients(tx, ty, A1, B1, A2, B2, A3, B3);
643 Double_t t2 = 1. + tx * tx + ty * ty, t =
sqrt(t2),
h = qp0 *
c_light,
646 Double_t s1[3], s2[3][3], s3[3][3][3], S1[3], S2[3][3], S3[3][3][3];
649 Double_t r0[3], r1[3], r2[3];
655 r2[0] = T_in[0] + T_in[2] * dz;
656 r2[1] = T_in[1] + T_in[3] * dz;
659 r1[0] = 0.5 * (r0[0] + r2[0]);
660 r1[1] = 0.5 * (r0[1] + r2[1]);
661 r1[2] = 0.5 * (r0[2] + r2[2]);
667 MF->GetFieldValue(r0, B[0]);
668 MF->GetFieldValue(r1, B[1]);
669 MF->GetFieldValue(r2, B[2]);
671 B[0][0] = B[0][1] = B[0][2] = B[1][0] = B[1][1] = B[1][2] = B[2][0] =
672 B[2][1] = B[2][2] = 0;
674 Double_t Sy = (7 * B[0][1] + 6 * B[1][1] - B[2][1]) * dz * dz / 96.;
675 r1[0] = T_in[0] + tx * dz / 2 + ht * Sy * A1[0][1];
676 r1[1] = T_in[1] + ty * dz / 2 + ht * Sy * B1[0][1];
678 Sy = (B[0][1] + 2 * B[1][1]) * dz * dz / 6.;
679 r2[0] = T_in[0] + tx * dz + ht * Sy * A1[0][1];
680 r2[1] = T_in[1] + ty * dz + ht * Sy * B1[0][1];
682 IntegrateField(MF, r0, r1, r2, s1, S1, s2, S2, s3, S3);
685 Double_t sA1 = 0, sA2 = 0, sA3 = 0, sB1 = 0, sB2 = 0, sB3 = 0;
686 Double_t sA1x = 0, sA2x = 0, sA3x = 0, sB1x = 0, sB2x = 0, sB3x = 0;
687 Double_t sA1y = 0, sA2y = 0, sA3y = 0, sB1y = 0, sB2y = 0, sB3y = 0;
689 Double_t SA1 = 0, SA2 = 0, SA3 = 0, SB1 = 0, SB2 = 0, SB3 = 0;
690 Double_t SA1x = 0, SA2x = 0, SA3x = 0, SB1x = 0, SB2x = 0, SB3x = 0;
691 Double_t SA1y = 0, SA2y = 0, SA3y = 0, SB1y = 0, SB2y = 0, SB3y = 0;
694 for (Int_t n = 0; n < 3; n++) {
695 sA1 += s1[n] * A1[0][n];
696 sA1x += s1[n] * A1[1][n];
697 sA1y += s1[n] * A1[2][n];
698 sB1 += s1[n] * B1[0][n];
699 sB1x += s1[n] * B1[1][n];
700 sB1y += s1[n] * B1[2][n];
702 SA1 += S1[n] * A1[0][n];
703 SA1x += S1[n] * A1[1][n];
704 SA1y += S1[n] * A1[2][n];
705 SB1 += S1[n] * B1[0][n];
706 SB1x += S1[n] * B1[1][n];
707 SB1y += S1[n] * B1[2][n];
710 for (Int_t
m = 0;
m < 3;
m++) {
711 sA2 += s2[n][
m] * A2[0][n][
m];
712 sA2x += s2[n][
m] * A2[1][n][
m];
713 sA2y += s2[n][
m] * A2[2][n][
m];
714 sB2 += s2[n][
m] * B2[0][n][
m];
715 sB2x += s2[n][
m] * B2[1][n][
m];
716 sB2y += s2[n][
m] * B2[2][n][
m];
718 SA2 += S2[n][
m] * A2[0][n][
m];
719 SA2x += S2[n][
m] * A2[1][n][
m];
720 SA2y += S2[n][
m] * A2[2][n][
m];
721 SB2 += S2[n][
m] * B2[0][n][
m];
722 SB2x += S2[n][
m] * B2[1][n][
m];
723 SB2y += S2[n][
m] * B2[2][n][
m];
726 for (Int_t k = 0; k < 3; k++) {
727 sA3 += s3[n][
m][k] * A3[0][n][
m][k];
728 sA3x += s3[n][
m][k] * A3[1][n][
m][k];
729 sA3y += s3[n][
m][k] * A3[2][n][
m][k];
730 sB3 += s3[n][
m][k] * B3[0][n][
m][k];
731 sB3x += s3[n][
m][k] * B3[1][n][
m][k];
732 sB3y += s3[n][
m][k] * B3[2][n][
m][k];
734 SA3 += S3[n][
m][k] * A3[0][n][
m][k];
735 SA3x += S3[n][
m][k] * A3[1][n][
m][k];
736 SA3y += S3[n][
m][k] * A3[2][n][
m][k];
737 SB3 += S3[n][
m][k] * B3[0][n][
m][k];
738 SB3x += S3[n][
m][k] * B3[1][n][
m][k];
739 SB3y += S3[n][
m][k] * B3[2][n][
m][k];
746 T_out[0] = T_in[0] + tx * dz + ht * (SA1 + ht * (SA2 + ht * SA3));
747 T_out[1] = T_in[1] + ty * dz + ht * (SB1 + ht * (SB2 + ht * SB3));
748 T_out[2] = T_in[2] + ht * (sA1 + ht * (sA2 + ht * sA3));
749 T_out[3] = T_in[3] + ht * (sB1 + ht * (sB2 + ht * sB3));
774 J[10] = dz +
h * tx * (1. / t * SA1 +
h * (2 * SA2 + 3 * ht * SA3))
775 + ht * (SA1x + ht * (SA2x + ht * SA3x));
776 J[11] =
h * tx * (1. / t * SB1 +
h * (2 * SB2 + 3 * ht * SB3))
777 + ht * (SB1x + ht * (SB2x + ht * SB3x));
778 J[12] = 1 +
h * tx * (1. / t * sA1 +
h * (2 * sA2 + 3 * ht * sA3))
779 + ht * (sA1x + ht * (sA2x + ht * sA3x));
780 J[13] =
h * tx * (1. / t * sB1 +
h * (2 * sB2 + 3 * ht * sB3))
781 + ht * (sB1x + ht * (sB2x + ht * sB3x));
787 J[15] =
h * ty * (1. / t * SA1 +
h * (2 * SA2 + 3 * ht * SA3))
788 + ht * (SA1y + ht * (SA2y + ht * SA3y));
789 J[16] = dz +
h * ty * (1. / t * SB1 +
h * (2 * SB2 + 3 * ht * SB3))
790 + ht * (SB1y + ht * (SB2y + ht * SB3y));
791 J[17] =
h * ty * (1. / t * sA1 +
h * (2 * sA2 + 3 * ht * sA3))
792 + ht * (sA1y + ht * (sA2y + ht * sA3y));
793 J[18] = 1 +
h * ty * (1. / t * sB1 +
h * (2 * sB2 + 3 * ht * sB3))
794 + ht * (sB1y + ht * (sB2y + ht * sB3y));
800 J[20] =
c_light * t * (SA1 + ht * (2 * SA2 + 3 * ht * SA3));
801 J[21] =
c_light * t * (SB1 + ht * (2 * SB2 + 3 * ht * SB3));
802 J[22] =
c_light * t * (sA1 + ht * (2 * sA2 + 3 * ht * sA3));
803 J[23] =
c_light * t * (sB1 + ht * (2 * sB2 + 3 * ht * sB3));
810 Double_t dqp = qp_in - qp0;
813 for (Int_t
i = 0;
i < 4;
i++) {
814 T_out[
i] += J[5 * 4 +
i] * dqp;
831 void CbmKFFieldMath::ExtrapolateACentral(
832 const Double_t T_in[],
833 const Double_t C_in[],
846 const Double_t
c_light = 0.000299792458;
848 Double_t qp_in = T_in[4];
849 Double_t z_in = T_in[5];
850 Double_t dz = z_out - z_in;
852 Double_t i1[3], I1[3];
870 r[1][2] = 0.5 * (r[0][2] + r[2][2]);
872 IntegrateField(MF, r[0], r[1], r[2], i1, I1, 0, 0, 0, 0);
876 Double_t
x = T_in[2],
879 xx =
x *
x, xy =
x *
y, yy =
y *
y,
881 x2 =
x * 2, y2 =
y * 2;
884 Double_t X1[3] = {xy, -xx - 1,
y};
885 Double_t X1x[3] = {
y, -x2, 0};
886 Double_t X1y[3] = {
x, 0, 1};
889 Double_t Y1[3] = {yy + 1, -xy, -
x};
890 Double_t Y1x[3] = {0, -
y, -1};
891 Double_t Y1y[3] = {y2, -
x, 0};
894 Double_t iX1 = 0, iY1 = 0;
895 Double_t iX1x = 0, iY1x = 0;
896 Double_t iX1y = 0, iY1y = 0;
898 Double_t IX1 = 0, IY1 = 0;
899 Double_t IX1x = 0, IY1x = 0;
900 Double_t IX1y = 0, IY1y = 0;
903 for (Int_t n = 0; n < 3; n++) {
904 if (n != 1)
continue;
905 iX1 += i1[n] * X1[n];
906 iX1x += i1[n] * X1x[n];
907 iX1y += i1[n] * X1y[n];
908 iY1 += i1[n] * Y1[n];
909 iY1x += i1[n] * Y1x[n];
910 iY1y += i1[n] * Y1y[n];
912 IX1 += I1[n] * X1[n];
913 IX1x += I1[n] * X1x[n];
914 IX1y += I1[n] * X1y[n];
915 IY1 += I1[n] * Y1[n];
916 IY1x += I1[n] * Y1x[n];
917 IY1y += I1[n] * Y1y[n];
921 Double_t t2 = 1. + xx + yy, t =
sqrt(t2),
h = qp0 *
c_light, ht =
h * t;
923 T_out[0] = T_in[0] +
x * dz + ht * IX1;
924 T_out[1] = T_in[1] +
y * dz + ht * IY1;
925 T_out[2] = T_in[2] + ht * iX1;
926 T_out[3] = T_in[3] + ht * iY1;
951 J[10] = dz +
h *
x / t * IX1 + ht * IX1x;
952 J[11] =
h *
x / t * IY1 + ht * IY1x;
953 J[12] = 1 +
h *
x / t * iX1 + ht * iX1x;
954 J[13] =
h *
x / t * iY1 + ht * iY1x;
960 J[15] =
h *
y / t * IX1 + ht * IX1y;
961 J[16] = dz +
h *
y / t * IY1 + ht * IY1y;
962 J[17] =
h *
y / t * iX1 + ht * iX1y;
963 J[18] = 1 +
h *
y / t * iY1 + ht * iY1y;
979 Double_t dqp = qp_in - qp0;
982 for (Int_t
i = 0;
i < 4;
i++) {
983 T_out[
i] += J[5 * 4 +
i] * dqp;
1001 const Double_t T_in[],
1002 const Double_t C_in[],
1014 for (
int i = 0;
i < 6;
i++)
1015 ok = ok &&
finite(T_in[
i]) && (T_in[
i] < 1.e5);
1017 for (
int i = 0;
i < 15;
i++)
1020 for (
int i = 0;
i < 6;
i++)
1023 for (
int i = 0;
i < 15;
i++)
1025 C_out[0] = C_out[2] = C_out[5] = C_out[9] = C_out[14] = 100.;
1031 const Double_t
c_light = 0.000299792458;
1033 Double_t qp_in = T_in[4];
1034 Double_t z_in = T_in[5];
1035 Double_t dz = z_out - z_in;
1039 Double_t
x = T_in[2],
1042 xx =
x *
x, xy =
x *
y, yy =
y *
y, x2 =
x * 2, x4 =
x * 4,
1043 xx31 = xx * 3 + 1, xx159 = xx * 15 + 9, y2 =
y * 2;
1045 Double_t Ax = xy, Ay = -xx - 1, Az =
y, Ayy =
x * (xx * 3 + 3), Ayz = -2 * xy,
1046 Ayyy = -(15 * xx * xx + 18 * xx + 3),
1048 Ax_x =
y, Ay_x = -x2, Az_x = 0, Ayy_x = 3 * xx31, Ayz_x = -y2,
1049 Ayyy_x = -x4 * xx159,
1051 Ax_y =
x, Ay_y = 0, Az_y = 1, Ayy_y = 0, Ayz_y = -x2, Ayyy_y = 0,
1053 Bx = yy + 1, By = -xy, Bz = -
x, Byy =
y * xx31, Byz = 2 * xx + 1,
1056 Bx_x = 0, By_x = -
y, Bz_x = -1, Byy_x = 6 * xy, Byz_x = x4,
1057 Byyy_x = -
y * (45 * xx + 9),
1059 Bx_y = y2, By_y = -
x, Bz_y = 0, Byy_y = xx31, Byz_y = 0,
1060 Byyy_y = -
x * xx159;
1065 Double_t t2 = 1. + xx + yy;
1066 if (t2 > 1.e4)
return 1;
1069 Double_t sx = 0, sy = 0, sz = 0, syy = 0, syz = 0, syyy = 0, Sx = 0, Sy = 0,
1070 Sz = 0, Syy = 0, Syz = 0, Syyy = 0;
1075 Double_t r0[3], r1[3], r2[3];
1083 r2[0] = T_in[0] + T_in[2] * dz;
1084 r2[1] = T_in[1] + T_in[3] * dz;
1087 r1[0] = 0.5 * (r0[0] + r2[0]);
1088 r1[1] = 0.5 * (r0[1] + r2[1]);
1089 r1[2] = 0.5 * (r0[2] + r2[2]);
1091 MF->GetFieldValue(r0, B[0]);
1092 MF->GetFieldValue(r1, B[1]);
1093 MF->GetFieldValue(r2, B[2]);
1095 Sy = (7 * B[0][1] + 6 * B[1][1] - B[2][1]) * dz * dz / 96.;
1096 r1[0] = T_in[0] +
x * dz / 2 + ht * Sy * Ay;
1097 r1[1] = T_in[1] +
y * dz / 2 + ht * Sy * By;
1099 Sy = (B[0][1] + 2 * B[1][1]) * dz * dz / 6.;
1100 r2[0] = T_in[0] +
x * dz + ht * Sy * Ay;
1101 r2[1] = T_in[1] +
y * dz + ht * Sy * By;
1107 MF->GetFieldValue(r0, B[0]);
1108 MF->GetFieldValue(r1, B[1]);
1109 MF->GetFieldValue(r2, B[2]);
1111 sx = (B[0][0] + 4 * B[1][0] + B[2][0]) * dz / 6.;
1112 sy = (B[0][1] + 4 * B[1][1] + B[2][1]) * dz / 6.;
1113 sz = (B[0][2] + 4 * B[1][2] + B[2][2]) * dz / 6.;
1115 Sx = (B[0][0] + 2 * B[1][0]) * dz * dz / 6.;
1116 Sy = (B[0][1] + 2 * B[1][1]) * dz * dz / 6.;
1117 Sz = (B[0][2] + 2 * B[1][2]) * dz * dz / 6.;
1119 Double_t c2[3][3] = {{5, -4, -1}, {44, 80, -4}, {11, 44, 5}};
1120 Double_t C2[3][3] = {{38, 8, -4}, {148, 208, -20}, {3, 36, 3}};
1121 for (Int_t n = 0; n < 3; n++)
1122 for (Int_t
m = 0;
m < 3;
m++) {
1123 syz += c2[n][
m] * B[n][1] * B[
m][2];
1124 Syz += C2[n][
m] * B[n][1] * B[
m][2];
1127 syz *= dz * dz / 360.;
1128 Syz *= dz * dz * dz / 2520.;
1130 syy = (B[0][1] + 4 * B[1][1] + B[2][1]) * dz;
1131 syyy = syy * syy * syy / 1296;
1132 syy = syy * syy / 72;
1134 Syy = (B[0][1] * (38 * B[0][1] + 156 * B[1][1] - B[2][1])
1135 + B[1][1] * (208 * B[1][1] + 16 * B[2][1]) + B[2][1] * (3 * B[2][1]))
1136 * dz * dz * dz / 2520.;
1138 * (B[0][1] * (85 * B[0][1] + 526 * B[1][1] - 7 * B[2][1])
1139 + B[1][1] * (1376 * B[1][1] + 84 * B[2][1])
1140 + B[2][1] * (19 * B[2][1]))
1142 * (B[1][1] * (1376 * B[1][1] + 256 * B[2][1])
1143 + B[2][1] * (62 * B[2][1]))
1144 + B[2][1] * B[2][1] * (3 * B[2][1]))
1145 * dz * dz * dz * dz / 90720.;
1151 sA1 = sx * Ax + sy * Ay + sz * Az,
1152 sA1_x = sx * Ax_x + sy * Ay_x + sz * Az_x,
1153 sA1_y = sx * Ax_y + sy * Ay_y + sz * Az_y,
1155 sB1 = sx * Bx + sy * By + sz * Bz,
1156 sB1_x = sx * Bx_x + sy * By_x + sz * Bz_x,
1157 sB1_y = sx * Bx_y + sy * By_y + sz * Bz_y,
1159 SA1 = Sx * Ax + Sy * Ay + Sz * Az,
1160 SA1_x = Sx * Ax_x + Sy * Ay_x + Sz * Az_x,
1161 SA1_y = Sx * Ax_y + Sy * Ay_y + Sz * Az_y,
1163 SB1 = Sx * Bx + Sy * By + Sz * Bz,
1164 SB1_x = Sx * Bx_x + Sy * By_x + Sz * Bz_x,
1165 SB1_y = Sx * Bx_y + Sy * By_y + Sz * Bz_y,
1168 sA2 = syy * Ayy + syz * Ayz, sA2_x = syy * Ayy_x + syz * Ayz_x,
1169 sA2_y = syy * Ayy_y + syz * Ayz_y, sB2 = syy * Byy + syz * Byz,
1170 sB2_x = syy * Byy_x + syz * Byz_x, sB2_y = syy * Byy_y + syz * Byz_y,
1172 SA2 = Syy * Ayy + Syz * Ayz, SA2_x = Syy * Ayy_x + Syz * Ayz_x,
1173 SA2_y = Syy * Ayy_y + Syz * Ayz_y, SB2 = Syy * Byy + Syz * Byz,
1174 SB2_x = Syy * Byy_x + Syz * Byz_x, SB2_y = Syy * Byy_y + Syz * Byz_y,
1177 sA3 = syyy * Ayyy, sA3_x = syyy * Ayyy_x, sA3_y = syyy * Ayyy_y,
1178 sB3 = syyy * Byyy, sB3_x = syyy * Byyy_x, sB3_y = syyy * Byyy_y,
1180 SA3 = Syyy * Ayyy, SA3_x = Syyy * Ayyy_x, SA3_y = Syyy * Ayyy_y,
1181 SB3 = Syyy * Byyy, SB3_x = Syyy * Byyy_x, SB3_y = Syyy * Byyy_y;
1184 T_out[0] = T_in[0] +
x * dz + ht * (SA1 + ht * (SA2 + ht * SA3));
1185 T_out[1] = T_in[1] +
y * dz + ht * (SB1 + ht * (SB2 + ht * SB3));
1186 T_out[2] = T_in[2] + ht * (sA1 + ht * (sA2 + ht * sA3));
1187 T_out[3] = T_in[3] + ht * (sB1 + ht * (sB2 + ht * sB3));
1212 J[10] = dz +
h *
x * (1. / t * SA1 +
h * (2 * SA2 + 3 * ht * SA3))
1213 + ht * (SA1_x + ht * (SA2_x + ht * SA3_x));
1214 J[11] =
h *
x * (1. / t * SB1 +
h * (2 * SB2 + 3 * ht * SB3))
1215 + ht * (SB1_x + ht * (SB2_x + ht * SB3_x));
1216 J[12] = 1 +
h *
x * (1. / t * sA1 +
h * (2 * sA2 + 3 * ht * sA3))
1217 + ht * (sA1_x + ht * (sA2_x + ht * sA3_x));
1218 J[13] =
h *
x * (1. / t * sB1 +
h * (2 * sB2 + 3 * ht * sB3))
1219 + ht * (sB1_x + ht * (sB2_x + ht * sB3_x));
1225 J[15] =
h *
y * (1. / t * SA1 +
h * (2 * SA2 + 3 * ht * SA3))
1226 + ht * (SA1_y + ht * (SA2_y + ht * SA3_y));
1227 J[16] = dz +
h *
y * (1. / t * SB1 +
h * (2 * SB2 + 3 * ht * SB3))
1228 + ht * (SB1_y + ht * (SB2_y + ht * SB3_y));
1229 J[17] =
h *
y * (1. / t * sA1 +
h * (2 * sA2 + 3 * ht * sA3))
1230 + ht * (sA1_y + ht * (sA2_y + ht * sA3_y));
1231 J[18] = 1 +
h *
y * (1. / t * sB1 +
h * (2 * sB2 + 3 * ht * sB3))
1232 + ht * (sB1_y + ht * (sB2_y + ht * sB3_y));
1238 J[20] =
c_light * t * (SA1 + ht * (2 * SA2 + 3 * ht * SA3));
1239 J[21] =
c_light * t * (SB1 + ht * (2 * SB2 + 3 * ht * SB3));
1240 J[22] =
c_light * t * (sA1 + ht * (2 * sA2 + 3 * ht * sA3));
1241 J[23] =
c_light * t * (sB1 + ht * (2 * sB2 + 3 * ht * sB3));
1248 Double_t dqp = qp_in - qp0;
1251 for (Int_t
i = 0;
i < 4;
i++) {
1252 T_out[
i] += J[5 * 4 +
i] * dqp;