44 for (
unsigned int itrack = 0; itrack < NTracksIsecAll; itrack++) {
48 std::vector<unsigned short int>
52 for (
int i = 0;
i < nHits;
i++) {
53 hits.push_back(vRecoHits[start_hit++]);
60 for (
int iter = 0; iter < 3; iter++) {
67 int ista0 = (*vSFlag)[hit0.
f] / 4;
68 int ista1 = (*vSFlag)[hit1.
f] / 4;
69 int ista2 = (*vSFlag)[hit2.
f] / 4;
76 fvec u0 =
static_cast<fscal>((*vStsStrips)[hit0.
f]);
77 fvec v0 =
static_cast<fscal>((*vStsStripsB)[hit0.
b]);
79 StripsToCoor(u0, v0, x0, y0, sta0);
80 fvec z0 = (*vStsZPos)[hit0.
iz];
82 fvec u1 =
static_cast<fscal>((*vStsStrips)[hit1.
f]);
83 fvec v1 =
static_cast<fscal>((*vStsStripsB)[hit1.
b]);
85 StripsToCoor(u1, v1, x1, y1, sta1);
88 fvec u2 =
static_cast<fscal>((*vStsStrips)[hit2.
f]);
89 fvec v2 =
static_cast<fscal>((*vStsStripsB)[hit2.
b]);
91 StripsToCoor(u2, v2, x2, y2, sta2);
100 T.
tx = (x1 - x0) * dzi;
101 T.
ty = (y1 - y0) * dzi;
131 fld.Set(fB2, fz2, fB1, fz1, fB0, fz0);
135 for (
int i = nHits - 2;
i >= 0;
i--) {
138 ista = (*vSFlag)[hit.
f] / 4;
154 fvec u =
static_cast<fscal>((*vStsStrips)[hit.
f]);
155 fvec v =
static_cast<fscal>((*vStsStripsB)[hit.
b]);
163 StripsToCoor(u,
v,
x,
y, sta);
167 fld.Set(fB2, fz2, fB1, fz1, fB0, fz0);
195 t.
NDF =
static_cast<int>(T.
NDF[0]);
207 int ista0 = GetFStation((*vSFlag)[hit0.
f]);
208 int ista1 = GetFStation((*vSFlag)[hit1.
f]);
209 int ista2 = GetFStation((*vSFlag)[hit2.
f]);
215 fvec u0 =
static_cast<fscal>((*vStsStrips)[hit0.
f]);
216 fvec v0 =
static_cast<fscal>((*vStsStripsB)[hit0.
b]);
218 StripsToCoor(u0, v0, x0, y0, sta0);
219 fvec z0 = (*vStsZPos)[hit0.
iz];
221 fvec u1 =
static_cast<fscal>((*vStsStrips)[hit1.
f]);
222 fvec v1 =
static_cast<fscal>((*vStsStripsB)[hit1.
b]);
224 StripsToCoor(u1, v1, x1, y1, sta1);
227 fvec u2 =
static_cast<fscal>((*vStsStrips)[hit2.
f]);
228 fvec v2 =
static_cast<fscal>((*vStsStripsB)[hit2.
b]);
230 StripsToCoor(u2, v2, x2, y2, sta2);
268 fld.Set(fB2, fz2, fB1, fz1, fB0, fz0);
271 for (
int i = 1;
i < nHits;
i++) {
273 ista = (*vSFlag)[hit.
f] / 4;
275 fvec u =
static_cast<fscal>((*vStsStrips)[hit.
f]);
276 fvec v =
static_cast<fscal>((*vStsStripsB)[hit.
b]);
297 StripsToCoor(u,
v,
x,
y, sta);
300 fld.Set(fB2, fz2, fB1, fz1, fB0, fz0);
328 t.
NDF +=
static_cast<int>(T.
NDF[0]);
363 fvec x_first, y_first, time_first, x_last, y_last, time_last, time_er_first,
364 time_er_last, d_x_fst, d_y_fst, d_xy_fst, time_er_lst, d_x_lst, d_y_lst,
368 fvec fz0, fz1, fz2, z_start, z_end;
372 for (
int iHit = 0; iHit < nHits; iHit++) {
373 ZSta[iHit] = sta[iHit].
z;
376 unsigned short N_vTracks = NTracksIsecAll;
377 const fvec mass2 = 0.1395679f * 0.1395679f;
379 for (
unsigned short itrack = 0; itrack < N_vTracks; itrack +=
fvecLen) {
380 if (N_vTracks - itrack <
static_cast<unsigned short>(
fvecLen))
381 nTracks_SIMD = N_vTracks - itrack;
383 for (
i = 0;
i < nTracks_SIMD;
i++)
384 t[
i] = &vTracks[itrack +
i];
387 for (
i = 0;
i < nHits;
i++) {
393 for (iVec = 0; iVec < nTracks_SIMD; iVec++) {
394 int nHitsTrack = t[iVec]->
NHits;
396 for (
i = 0;
i < nHitsTrack;
i++) {
397 const L1StsHit& hit = (*vStsHits)[vRecoHits[start_hit++]];
398 const int ista = (*vSFlag)[hit.
f] / 4;
401 if (ista > NMvdStations) w_time[ista][iVec] = 1.;
403 u[ista][iVec] = (*vStsStrips)[hit.
f];
404 v[ista][iVec] = (*vStsStripsB)[hit.
b];
405 d_u[ista][iVec] = hit.
du;
406 d_v[ista][iVec] = hit.
dv;
407 StripsToCoor(u[ista],
v[ista], x_temp, y_temp, sta[ista]);
408 x[ista][iVec] = x_temp[iVec];
409 y[ista][iVec] = y_temp[iVec];
410 time[ista][iVec] = hit.
t_reco;
411 timeEr[ista][iVec] = hit.
t_er;
412 z[ista][iVec] = (*vStsZPos)[hit.
iz];
414 dUdV_to_dX(d_u[ista], d_v[ista], d_x[ista], sta[ista]);
415 dUdV_to_dY(d_u[ista], d_v[ista], d_y[ista], sta[ista]);
416 dUdV_to_dXdY(d_u[ista], d_v[ista], d_xy[ista], sta[ista]);
417 fB[ista].
x[iVec] = fB_temp.x[iVec];
418 fB[ista].
y[iVec] = fB_temp.y[iVec];
419 fB[ista].
z[iVec] = fB_temp.z[iVec];
421 z_start[iVec] = z[ista][iVec];
422 x_first[iVec] =
x[ista][iVec];
423 y_first[iVec] =
y[ista][iVec];
424 time_first[iVec] = time[ista][iVec];
425 time_er_first[iVec] = timeEr[ista][iVec];
426 d_x_fst[iVec] = d_x[ista][iVec];
427 d_y_fst[iVec] = d_y[ista][iVec];
428 d_xy_fst[iVec] = d_xy[ista][iVec];
432 }
else if (
i == nHitsTrack - 1) {
433 z_end[iVec] = z[ista][iVec];
434 x_last[iVec] =
x[ista][iVec];
435 y_last[iVec] =
y[ista][iVec];
436 d_x_lst[iVec] = d_x[ista][iVec];
437 d_y_lst[iVec] = d_y[ista][iVec];
438 d_xy_lst[iVec] = d_xy[ista][iVec];
439 time_last[iVec] = time[ista][iVec];
440 time_er_last[iVec] = timeEr[ista][iVec];
447 fscal prevZ = z_end[iVec];
448 fscal cursy = 0., curSy = 0.;
449 for (
i = nHitsTrack - 1;
i >= 0;
i--) {
450 const int ista = iSta[
i];
452 const fscal curZ = z[ista][iVec];
453 fscal dZ = curZ - prevZ;
455 curSy += dZ * cursy + dZ * dZ * By / 2.;
457 Sy[ista][iVec] = curSy;
465 GuessVec(T,
x,
y, z, Sy, w, nHits, &z_end);
466 GuessVec(T1,
x,
y, z, Sy, w, nHits, &z_end, time, w_time);
468 for (
int iter = 0; iter < 2; iter++) {
476 FilterFirst(T, x_last, y_last, staLast);
489 T1.
Filter(time[
i], timeEr[
i], w_time[
i]);
503 fB2.Combine(fB[
i - 2], w[
i - 2]);
504 fld.Set(fB2, fz2, fB1, fz1, fB0, fz0);
505 for (--
i;
i >= 0;
i--) {
511 fld.Set(fB0, fz0, fB1, fz1, fB2, fz2);
514 fvec w1 = (w[
i] & (initialised));
515 fvec w1_time = (w_time[
i] & (initialised));
516 fvec wIn = (
ONE & (initialised));
526 if (
i == NMvdStations - 1) {
538 T, mass2, fRadThick[
i].GetRadThick(T.
x, T.
y), qp0,
fvec(1.
f), wIn);
542 mass2, fRadThick[
i].GetRadThick(T1.
fx, T1.
fy), qp01,
fvec(1.
f), wIn);
559 T1.
Filter(time[
i], timeEr[
i], w1_time);
569 for (iVec = 0; iVec < nTracks_SIMD; iVec++) {
601 t[iVec]->
NDF = (int) T1.
NDF[iVec];
610 for (iVec = 0; iVec < nTracks_SIMD; iVec++) {
611 t[iVec]->
Tpv[0] = T1PV.
fx[iVec];
612 t[iVec]->
Tpv[1] = T1PV.
fy[iVec];
613 t[iVec]->
Tpv[2] = T1PV.
ftx[iVec];
614 t[iVec]->
Tpv[3] = T1PV.
fty[iVec];
615 t[iVec]->
Tpv[4] = T1PV.
fqp[iVec];
616 t[iVec]->
Tpv[5] = T1PV.
fz[iVec];
617 t[iVec]->
Tpv[6] = T1PV.
ft[iVec];
619 t[iVec]->
Cpv[0] = T1PV.
C00[iVec];
620 t[iVec]->
Cpv[1] = T1PV.
C10[iVec];
621 t[iVec]->
Cpv[2] = T1PV.
C11[iVec];
622 t[iVec]->
Cpv[3] = T1PV.
C20[iVec];
623 t[iVec]->
Cpv[4] = T1PV.
C21[iVec];
624 t[iVec]->
Cpv[5] = T1PV.
C22[iVec];
625 t[iVec]->
Cpv[6] = T1PV.
C30[iVec];
626 t[iVec]->
Cpv[7] = T1PV.
C31[iVec];
627 t[iVec]->
Cpv[8] = T1PV.
C32[iVec];
628 t[iVec]->
Cpv[9] = T1PV.
C33[iVec];
629 t[iVec]->
Cpv[10] = T1PV.
C40[iVec];
630 t[iVec]->
Cpv[11] = T1PV.
C41[iVec];
631 t[iVec]->
Cpv[12] = T1PV.
C42[iVec];
632 t[iVec]->
Cpv[13] = T1PV.
C43[iVec];
633 t[iVec]->
Cpv[14] = T1PV.
C44[iVec];
634 t[iVec]->
Cpv[15] = T1PV.
C50[iVec];
635 t[iVec]->
Cpv[16] = T1PV.
C51[iVec];
636 t[iVec]->
Cpv[17] = T1PV.
C52[iVec];
637 t[iVec]->
Cpv[18] = T1PV.
C53[iVec];
638 t[iVec]->
Cpv[19] = T1PV.
C54[iVec];
639 t[iVec]->
Cpv[20] = T1PV.
C55[iVec];
643 if (iter == 1)
continue;
648 FilterFirst(T, x_first, y_first, staFirst);
661 T1.
Filter(time[
i], timeEr[
i], w_time[
i]);
674 fB2.Combine(fB[
i + 2], w[
i + 2]);
675 fld.Set(fB2, fz2, fB1, fz1, fB0, fz0);
677 for (++
i;
i < nHits;
i++) {
682 fld.Set(fB0, fz0, fB1, fz1, fB2, fz2);
685 fvec w1 = (w[
i] & (initialised));
686 fvec wIn = (
ONE & (initialised));
687 fvec w1_time = (w_time[
i] & (initialised));
697 if (
i == NMvdStations) {
707 T, mass2, fRadThick[
i].GetRadThick(T.
x, T.
y), qp0,
fvec(-1.
f), wIn);
711 mass2, fRadThick[
i].GetRadThick(T1.
fx, T1.
fy), qp01,
fvec(-1.
f), wIn);
728 T1.
Filter(time[
i], timeEr[
i], w1_time);
737 for (iVec = 0; iVec < nTracks_SIMD; iVec++) {
738 t[iVec]->
TLast[0] = T1.
fx[iVec];
739 t[iVec]->
TLast[1] = T1.
fy[iVec];
743 t[iVec]->
TLast[5] = T1.
fz[iVec];
744 t[iVec]->
TLast[6] = T1.
ft[iVec];
769 t[iVec]->
NDF = (int) T1.
NDF[iVec];
803 fvec x_first, y_first, time_first, x_last, y_last, time_last, time_er_fst,
804 d_x_fst, d_y_fst, d_xy_fst, time_er_lst, d_x_lst, d_y_lst, d_xy_lst, dz;
808 fvec fz0, fz1, fz2, z_start, z_end;
812 for (
int iHit = 0; iHit < nHits; iHit++) {
813 ZSta[iHit] = sta[iHit].
z;
816 unsigned short N_vTracks = NTracksIsecAll;
817 const fvec mass2 = 0.10565f * 0.10565f;
819 for (
unsigned short itrack = 0; itrack < N_vTracks; itrack +=
fvecLen) {
820 if (N_vTracks - itrack <
static_cast<unsigned short>(
fvecLen))
821 nTracks_SIMD = N_vTracks - itrack;
823 for (
i = 0;
i < nTracks_SIMD;
i++)
824 t[
i] = &vTracks[itrack +
i];
827 for (
i = 0;
i < nHits;
i++) {
832 for (iVec = 0; iVec < nTracks_SIMD; iVec++) {
840 for (iVec = 0; iVec < nTracks_SIMD; iVec++) {
841 int nHitsTrack = t[iVec]->
NHits;
842 int nHitsTrackSts = 0;
843 for (
i = 0;
i < nHitsTrack;
i++) {
844 const L1StsHit& hit = (*vStsHits)[vRecoHits[start_hit++]];
845 const int ista = (*vSFlag)[hit.
f] / 4;
846 if (ista < 8) nHitsTrackSts++;
853 u[ista][iVec] = (*vStsStrips)[hit.
f];
854 v[ista][iVec] = (*vStsStripsB)[hit.
b];
855 StripsToCoor(u[ista],
v[ista], x_temp, y_temp, sta[ista]);
856 x[ista][iVec] = x_temp[iVec];
857 y[ista][iVec] = y_temp[iVec];
858 time[ista][iVec] = hit.
t_reco;
859 timeEr[ista][iVec] = hit.
t_er;
860 d_u[ista][iVec] = hit.
du;
861 d_v[ista][iVec] = hit.
dv;
862 dUdV_to_dX(d_u[ista], d_v[ista], d_x[ista], sta[ista]);
863 dUdV_to_dY(d_u[ista], d_v[ista], d_y[ista], sta[ista]);
864 dUdV_to_dXdY(d_u[ista], d_v[ista], d_xy[ista], sta[ista]);
866 z[ista][iVec] = (*vStsZPos)[hit.
iz];
868 fB[ista].
x[iVec] = fB_temp.x[iVec];
869 fB[ista].
y[iVec] = fB_temp.y[iVec];
870 fB[ista].
z[iVec] = fB_temp.z[iVec];
872 z_start[iVec] = z[ista][iVec];
873 x_first[iVec] =
x[ista][iVec];
874 y_first[iVec] =
y[ista][iVec];
875 time_first[iVec] = time[ista][iVec];
876 time_er_fst[iVec] = timeEr[ista][iVec];
877 d_x_fst[iVec] = d_x[ista][iVec];
878 d_y_fst[iVec] = d_y[ista][iVec];
879 d_xy_fst[iVec] = d_xy[ista][iVec];
883 }
else if (
i == nHitsTrack - 1) {
884 z_end[iVec] = z[ista][iVec];
885 x_last[iVec] =
x[ista][iVec];
886 y_last[iVec] =
y[ista][iVec];
887 time_last[iVec] = time[ista][iVec];
888 time_er_lst[iVec] = timeEr[ista][iVec];
889 d_x_lst[iVec] = d_x[ista][iVec];
890 d_y_lst[iVec] = d_y[ista][iVec];
891 d_xy_lst[iVec] = d_xy[ista][iVec];
899 fscal prevZ = z_start[iVec];
900 fscal cursy = 0., curSy = 0.;
902 for (
i = 0;
i < nHitsTrackSts;
i++) {
903 const int ista = iSta[
i];
905 const fscal curZ = z[ista][iVec];
906 fscal dZ = curZ - prevZ;
908 curSy += dZ * cursy + dZ * dZ * By / 2.;
910 Sy[ista][iVec] = curSy;
919 for (
i = 0;
i < nHits;
i++)
920 if (iSta[
i] < 8) nHitsSts++;
922 GuessVec(T,
x,
y, z, Sy, w, nHitsSts, &z_start);
925 GuessVec(T1,
x,
y, z, Sy, w, nHitsSts, &z_start);
928 for (
int iter = 0; iter < 2; iter++) {
936 FilterFirst(T, x_first, y_first, staFirst);
957 fB2.Combine(fB[
i + 2], w[
i + 2]);
959 fld.Set(fB2, fz2, fB1, fz1, fB0, fz0);
961 for (++
i;
i < nHits;
i++) {
963 fvec w1 = (w[
i] & (initialised));
964 fvec wIn = (
ONE & (initialised));
973 T.
x - T.
tx * dz, T.
y - T.
ty * dz, fB0);
975 fld.Set(fB0, fz0, fB1, fz1, fB2, fz2);
981 if (
i == NMvdStations) {
995 fRadThick[
i].GetRadThick(T1.
fx, T1.
fy),
1031 fvec d_z = T1.
fz - z_last;
1039 for (
int j = 0; j < 4; j++) {
1040 nofSteps[j] = int(
fabs(d_z[j]) / 10);
1041 if (max_steps < nofSteps[j]) max_steps = nofSteps[j];
1050 fvec stepSize = (((mask) *d_z) + ((one - mask) * st)) * w1;
1057 for (
int iStep = 0; iStep < max_steps + 1; iStep++) {
1059 const fvec mask1 = (nofSteps == nofSteps1) &
fvec(1);
1061 z_cur = (one - mask1) * (stepSize + T1.
fz) + mask1 * z_last;
1068 nofSteps1 = nofSteps1 + (one - mask1);
1070 w2 = w2 & (one - mask1);
1075 if (
i == 11 ||
i == 14 ||
i == 17)
1077 fRadThick[
i].GetRadThick(T1.
fx, T1.
fy)
1085 fRadThick[
i].GetRadThick(T1.
fx, T1.
fy) / (nofSteps + 1),
1089 if (
i == 9 ||
i == 10 ||
i == 12 ||
i == 13 ||
i == 15 ||
i == 16
1090 ||
i == 18 ||
i == 19)
1092 fRadThick[
i].GetRadThick(T1.
fx, T1.
fy)
1099 fRadThick[
i].GetRadThick(T1.
fx, T1.
fy) / (nofSteps +
fvec(1)),
1102 sta[
i].materialInfo.thick / (nofSteps +
fvec(1)),
1105 wIn = wIn & (one - mask1);
1129 for (iVec = 0; iVec < nTracks_SIMD; iVec++) {
1131 t[iVec]->
TLast[0] = T1.
fx[iVec];
1132 t[iVec]->
TLast[1] = T1.
fy[iVec];
1136 t[iVec]->
TLast[5] = T1.
fz[iVec];
1137 t[iVec]->
TLast[6] = T1.
ft[iVec];
1163 t[iVec]->
NDF = (int) T1.
NDF[iVec];
1166 if (iter == 1)
continue;
1171 FilterFirst(T, x_last, y_last, staLast);
1194 for (--
i;
i >= 0;
i--) {
1197 fvec w1 = (w[
i] & (initialised));
1199 fvec wIn = (
ONE & (initialised));
1210 fvec d_z = T1.
fz - z_last;
1216 for (
int j = 0; j < 4; j++) {
1217 nofSteps[j] = int(
fabs(d_z[j]) / 10);
1218 if (max_steps < nofSteps[j]) max_steps = nofSteps[j];
1224 fvec stepSize = (((mask) *d_z) + ((one - mask) * st)) * wIn;
1228 for (
int iStep = 0; iStep < max_steps + 1; iStep++) {
1230 const fvec mask1 = (nofSteps == nofSteps1) &
fvec(1);
1232 z_cur = (one - mask1) * (T1.
fz - stepSize) + mask1 * z_last;
1238 nofSteps1 = nofSteps1 + (one - mask1);
1242 if (
i == 11 ||
i == 14 ||
i == 17)
1244 fRadThick[
i].GetRadThick(T1.
fx, T1.
fy)
1252 fRadThick[
i].GetRadThick(T1.
fx, T1.
fy) / (nofSteps + 1),
1256 if (
i == 9 ||
i == 10 ||
i == 12 ||
i == 13 ||
i == 15 ||
i == 16
1259 fRadThick[
i].GetRadThick(T1.
fx, T1.
fy)
1266 fRadThick[
i].GetRadThick(T1.
fx, T1.
fy) / (nofSteps +
fvec(1)),
1269 sta[
i].materialInfo.thick / (nofSteps +
fvec(1)),
1272 w2 = w2 & (one - mask1);
1310 fB1.
Combine(fB[i_sts], w[i_sts]);
1316 T1.
fx + T1.
ftx * dz, T1.
fy + T1.
fty * dz, fB2);
1317 fB2.Combine(fB[i_sts - 2], w[i_sts - 2]);
1324 T1.
fx - T1.
ftx * dz, T1.
fy - T1.
fty * dz, fB0);
1327 fld.Set(fB0, fz0, fB1, fz1, fB2, fz2);
1337 fRadThick[
i].GetRadThick(T1.
fx, T1.
fy),
1371 for (iVec = 0; iVec < nTracks_SIMD; iVec++) {
1404 t[iVec]->
NDF = (int) T1.
NDF[iVec];
1411 for (iVec = 0; iVec < nTracks_SIMD; iVec++) {
1412 t[iVec]->
Tpv[0] = T1PV.
fx[iVec];
1413 t[iVec]->
Tpv[1] = T1PV.
fy[iVec];
1414 t[iVec]->
Tpv[2] = T1PV.
ftx[iVec];
1415 t[iVec]->
Tpv[3] = T1PV.
fty[iVec];
1416 t[iVec]->
Tpv[4] = T1PV.
fqp[iVec];
1417 t[iVec]->
Tpv[5] = T1PV.
fz[iVec];
1418 t[iVec]->
Tpv[6] = T1PV.
ft[iVec];
1420 t[iVec]->
Cpv[0] = T1PV.
C00[iVec];
1421 t[iVec]->
Cpv[1] = T1PV.
C10[iVec];
1422 t[iVec]->
Cpv[2] = T1PV.
C11[iVec];
1423 t[iVec]->
Cpv[3] = T1PV.
C20[iVec];
1424 t[iVec]->
Cpv[4] = T1PV.
C21[iVec];
1425 t[iVec]->
Cpv[5] = T1PV.
C22[iVec];
1426 t[iVec]->
Cpv[6] = T1PV.
C30[iVec];
1427 t[iVec]->
Cpv[7] = T1PV.
C31[iVec];
1428 t[iVec]->
Cpv[8] = T1PV.
C32[iVec];
1429 t[iVec]->
Cpv[9] = T1PV.
C33[iVec];
1430 t[iVec]->
Cpv[10] = T1PV.
C40[iVec];
1431 t[iVec]->
Cpv[11] = T1PV.
C41[iVec];
1432 t[iVec]->
Cpv[12] = T1PV.
C42[iVec];
1433 t[iVec]->
Cpv[13] = T1PV.
C43[iVec];
1434 t[iVec]->
Cpv[14] = T1PV.
C44[iVec];
1435 t[iVec]->
Cpv[15] = T1PV.
C50[iVec];
1436 t[iVec]->
Cpv[16] = T1PV.
C51[iVec];
1437 t[iVec]->
Cpv[17] = T1PV.
C52[iVec];
1438 t[iVec]->
Cpv[18] = T1PV.
C53[iVec];
1439 t[iVec]->
Cpv[19] = T1PV.
C54[iVec];
1440 t[iVec]->
Cpv[20] = T1PV.
C55[iVec];
1459 fvec z0,
x,
y, z, S, w, wz, wS;
1470 for (
i = 0;
i < NHits;
i++) {
1492 fvec A3A3 = A3 * A3;
1493 fvec A3A4 = A3 * A4;
1494 fvec A1A5 = A1 * A5;
1495 fvec A2A5 = A2 * A5;
1496 fvec A4A4 = A4 * A4;
1498 fvec det =
rcp(-A2 * A3A3 + A1 * (A3A4 + A3A4 - A1A5) + A0 * (A2A5 - A4A4));
1499 fvec Ai0 = (-A4A4 + A2A5);
1500 fvec Ai1 = (A3A4 - A1A5);
1501 fvec Ai2 = (-A3A3 + A0 * A5);
1502 fvec Ai3 = (-A2 * A3 + A1 * A4);
1503 fvec Ai4 = (A1 * A3 - A0 * A4);
1504 fvec Ai5 = (-A1 * A1 + A0 * A2);
1507 t.
x = (Ai0 * a0 + Ai1 * a1 + Ai3 * a2) * det;
1508 t.
tx = (Ai1 * a0 + Ai2 * a1 + Ai4 * a2) * det;
1510 L = (Ai3 * a0 + Ai4 * a1 + Ai5 * a2) * det *
rcp(txtx1);
1513 A2 = A2 + (A4 + A4 + A5 * L1) * L1;
1515 det =
rcp(-A1 * A1 + A0 * A2);
1517 t.
y = (A2 * b0 - A1 * b1) * det;
1518 t.
ty = (-A1 * b0 + A0 * b1) * det;
1537 fvec z0,
x,
y, z, S, w, wz, wS, time;
1552 for (
i = 0;
i < NHits;
i++) {
1556 if (timeV) nhits = nhits + w_time[
i];
1574 time += w_time[
i] * (timeV[
i] -
sqrt(
x *
x +
y *
y + z * z) / 30.f);
1576 time = time / nhits;
1578 fvec A3A3 = A3 * A3;
1579 fvec A3A4 = A3 * A4;
1580 fvec A1A5 = A1 * A5;
1581 fvec A2A5 = A2 * A5;
1582 fvec A4A4 = A4 * A4;
1584 fvec det =
rcp(-A2 * A3A3 + A1 * (A3A4 + A3A4 - A1A5) + A0 * (A2A5 - A4A4));
1585 fvec Ai0 = (-A4A4 + A2A5);
1586 fvec Ai1 = (A3A4 - A1A5);
1587 fvec Ai2 = (-A3A3 + A0 * A5);
1588 fvec Ai3 = (-A2 * A3 + A1 * A4);
1589 fvec Ai4 = (A1 * A3 - A0 * A4);
1590 fvec Ai5 = (-A1 * A1 + A0 * A2);
1593 t.
fx = (Ai0 * a0 + Ai1 * a1 + Ai3 * a2) * det;
1594 t.
ftx = (Ai1 * a0 + Ai2 * a1 + Ai4 * a2) * det;
1596 L = (Ai3 * a0 + Ai4 * a1 + Ai5 * a2) * det *
rcp(txtx1);
1599 A2 = A2 + (A4 + A4 + A5 * L1) * L1;
1601 det =
rcp(-A1 * A1 + A0 * A2);
1603 t.
fy = (A2 * b0 - A1 * b1) * det;
1604 t.
fty = (-A1 * b0 + A0 * b1) * det;
1606 if (timeV) t.
ft = time & (nhits > 0);
1661 track.
C55 = 2.6f * 2.6f;
1703 track.
C55 = t_er * t_er;
1742 track.
C55 = t_er * t_er;
1761 track.
C00 = d_x * d_x;
1763 track.
C11 = d_y * d_y;
1783 track.
C55 = t_er * t_er;