40 fTransformType=kTransformCos;
42 fDirection=kTransformForward;
57 Error (
"TSpectrumTransform",
"Invalid length, must be > than 0");
67 Error (
"TSpectrumTransform",
"Invalid length, must be power of 2");
97 int i, ii, li, l2, l3, j, jj, jj1, lj, iter,
m, jmin, jmax;
100 for (i = 0; i < num; i++)
101 working_space[i + num] = 0;
109 for (m = 1; m <= iter; m++) {
112 for (i = 0; i < (2 * l2); i++) {
113 working_space[num + i] = working_space[i];
115 for (j = 0; j < l2; j++) {
118 val = working_space[jj + num] + working_space[jj + 1 + num];
119 working_space[j] = val;
120 val = working_space[jj + num] - working_space[jj + 1 + num];
121 working_space[l3] = val;
125 val = working_space[0];
127 working_space[0] = val;
128 val = working_space[1];
130 working_space[1] = val;
131 for (ii = 2; ii <= iter; ii++) {
136 for (j = jmin; j <= jmax; j++) {
137 val = working_space[j];
141 working_space[j] = val;
145 for (m = 1; m <= iter; m++) {
150 for (i = 0; i < (2 * li); i++) {
151 working_space[i + num] = working_space[i];
153 for (j = 0; j < li; j++) {
155 jj = 2 * (j + 1) - 1;
157 val = working_space[j + num] - working_space[lj + num];
158 working_space[jj] = val;
159 val = working_space[j + num] + working_space[lj + num];
160 working_space[jj1] = val;
175 int i,
m, nump = 1, mnum, mnum2, mp, ib, mp2, mnum21, iba, iter;
178 for (i = 0; i < num; i++)
179 working_space[i + num] = 0;
186 for (m = 1; m <= iter; m++) {
194 for (mp = 0; mp < nump; mp++) {
196 for (mp2 = 0; mp2 < mnum2; mp2++) {
197 mnum21 = mnum2 + mp2 + ib;
199 val1 = working_space[iba];
200 val2 = working_space[mnum21];
201 working_space[iba + num] = val1 + val2;
202 working_space[mnum21 + num] = val1 - val2;
205 for (i = 0; i < num; i++) {
206 working_space[i] = working_space[i + num];
212 for (i = 0; i < num; i++) {
213 val1 = working_space[i];
215 working_space[i] = val1;
229 int i, ib, il, ibd, ip, ifac, i1;
230 for (i = 0; i < num; i++) {
231 working_space[i + num] = working_space[i];
233 for (i = 1; i <= num; i++) {
247 for (i1 = 1; i1 <= il; i1++) {
249 ip = ip + ifac * ipower[i1 - 1];
251 working_space[ip - 1] = working_space[i - 1 + num];
265 int direction,
int zt_clear)
267 int nxp2, nxp, i, j, k,
m, iter, mxp, j1, j2, n1, n2, it;
268 Double_t a,
b, c, d, sign, wpwr, arg, wr, wi, tr, ti,
pi =
269 3.14159265358979323846;
272 for (i = 0; i < num; i++)
273 working_space[i + num] = 0;
285 for (it = 1; it <= iter; it++) {
290 for (m = 1; m <= nxp2; m++) {
295 for (mxp = nxp; mxp <= num; mxp += nxp) {
298 val1 = working_space[j1 - 1];
299 val2 = working_space[j2 - 1];
300 val3 = working_space[j1 - 1 + num];
301 val4 = working_space[j2 - 1 + num];
310 working_space[j1 - 1] = val1;
313 working_space[j1 - 1 + num] = val1;
314 a = tr * wr - ti * wi;
316 working_space[j2 - 1] = val1;
317 a = ti * wr + tr * wi;
319 working_space[j2 - 1 + num] = val1;
326 for (i = 1; i <= n1; i++) {
329 val1 = working_space[j - 1];
330 val2 = working_space[j - 1 + num];
331 val3 = working_space[i - 1];
332 working_space[j - 1] = val3;
333 working_space[j - 1 + num] = working_space[i - 1 + num];
334 working_space[i - 1] = val1;
335 working_space[i - 1 + num] = val2;
337 lab60:
if (k >= j)
goto lab65;
345 for (i = 0; i < num; i++) {
347 val1 = working_space[i];
351 working_space[i] = val1;
352 b = working_space[i + num];
354 working_space[i + num] =
b;
358 b = working_space[i];
359 c = working_space[i + num];
361 working_space[i] =
b;
362 working_space[i + num] = 0;
366 for (i = 1; i < num; i++)
367 working_space[num - i + num] = working_space[i];
368 working_space[0 + num] = working_space[0];
369 for (i = 0; i < num; i++) {
370 working_space[i] = working_space[i + num];
371 working_space[i + num] = 0;
389 int i, ib, il, ibd, ip, ifac, i1;
390 for (i = 0; i < num; i++) {
391 working_space[i + shift + start] = working_space[i + start];
392 working_space[i + shift + start + 2 * shift] =
393 working_space[i + start + 2 * shift];
395 for (i = 1; i <= num; i++) {
409 for (i1 = 1; i1 <= il; i1++) {
411 ip = ip + ifac * ipower[i1 - 1];
413 working_space[ip - 1 + start] =
414 working_space[i - 1 + shift + start];
415 working_space[ip - 1 + start + 2 * shift] =
416 working_space[i - 1 + shift + start + 2 * shift];
431 int degree,
int type)
433 int i, j, k,
m, nump, mnum, mnum2, mp, ib, mp2, mnum21, iba, iter,
434 mp2step, mppom, ring;
435 Double_t a,
b, c, d, wpwr, arg, wr, wi, tr, ti,
pi =
436 3.14159265358979323846;
437 Double_t val1, val2, val3, val4, a0oldr = 0, b0oldr = 0, a0r, b0r;
439 for (i = 0; i < num; i++)
440 working_space[i + 2 * num] = 0;
453 for (i = 0; i < iter - degree; i++)
455 for (m = 1; m <= iter; m++) {
467 for (mp = 0; mp < nump; mp++) {
470 mppom = mppom % ring;
474 for (i = 0; i < (iter - 1); i++) {
475 if ((mppom & j) != 0)
490 for (mp2 = 0; mp2 < mnum2; mp2++) {
491 mnum21 = mnum2 + mp2 + ib;
493 if (mp2 % mp2step == 0) {
504 val1 = working_space[iba];
505 val2 = working_space[mnum21];
506 val3 = working_space[iba + 2 * num];
507 val4 = working_space[mnum21 + 2 * num];
512 tr = a * a0r + b * b0r;
514 working_space[num + iba] = val1;
515 ti = c * a0r + d * b0r;
517 working_space[num + iba + 2 * num] = val1;
519 a * b0r * wr - c * b0r * wi - b * a0r * wr + d * a0r * wi;
521 working_space[num + mnum21] = val1;
523 c * b0r * wr + a * b0r * wi - d * a0r * wr - b * a0r * wi;
525 working_space[num + mnum21 + 2 * num] = val1;
528 for (i = 0; i < num; i++) {
529 val1 = working_space[num + i];
530 working_space[i] = val1;
531 val1 = working_space[num + i + 2 * num];
532 working_space[i + 2 * num] = val1;
549 int i, j, k,
m, nump =
550 1, mnum, mnum2, mp, ib, mp2, mnum21, iba, iter, mp2step, mppom,
552 Double_t a,
b, c, d, wpwr, arg, wr, wi, tr, ti,
pi =
553 3.14159265358979323846;
554 Double_t val1, val2, val3, val4, a0oldr = 0, b0oldr = 0, a0r, b0r;
566 for (i = 0; i < iter - degree; i++)
570 for (m = 1; m <= iter; m++) {
578 if (m > iter - degree + 1)
580 for (mp = nump - 1; mp >= 0; mp--) {
583 mppom = mppom % ring;
587 for (i = 0; i < (iter - 1); i++) {
588 if ((mppom & j) != 0)
603 for (mp2 = 0; mp2 < mnum2; mp2++) {
604 mnum21 = mnum2 + mp2 + ib;
606 if (mp2 % mp2step == 0) {
617 val1 = working_space[iba];
618 val2 = working_space[mnum21];
619 val3 = working_space[iba + 2 * num];
620 val4 = working_space[mnum21 + 2 * num];
625 tr = a * a0r + b * wr * b0r + d * wi * b0r;
627 working_space[num + iba] = val1;
628 ti = c * a0r + d * wr * b0r - b * wi * b0r;
630 working_space[num + iba + 2 * num] = val1;
631 tr = a * b0r - b * wr * a0r - d * wi * a0r;
633 working_space[num + mnum21] = val1;
634 ti = c * b0r - d * wr * a0r + b * wi * a0r;
636 working_space[num + mnum21 + 2 * num] = val1;
639 if (m <= iter - degree
645 for (i = 0; i < num; i++) {
646 val1 = working_space[num + i];
647 working_space[i] = val1;
648 val1 = working_space[num + i + 2 * num];
649 working_space[i + 2 * num] = val1;
742 int i, j=0, k = 1,
m,
l;
776 for (i = 0; i <
fSize; i++) {
777 working_space[i] = source[i];
780 for (i = 0; i <
fSize; i++) {
781 destVector[i] = working_space[i];
785 for (i = 0; i <
fSize; i++) {
786 working_space[i] = source[i];
788 Walsh(working_space, fSize);
790 for (i = 0; i <
fSize; i++) {
791 destVector[i] = working_space[i];
796 for (i = 1; i <= (fSize / 2); i++) {
798 working_space[i - 1] = val;
799 working_space[fSize - i] = val;
802 for (i = 0; i < fSize / 2; i++) {
805 b = working_space[i];
807 working_space[i] =
a;
808 working_space[i +
fSize] = 0;
809 } working_space[0] = working_space[0] /
TMath::Sqrt(2.0);
810 for (i = 0; i < fSize / 2; i++) {
811 destVector[i] = working_space[i];
816 for (i = 1; i <= (fSize / 2); i++) {
818 working_space[i - 1] = val;
819 working_space[fSize - i] = -val;
822 for (i = 0; i < fSize / 2; i++) {
825 b = working_space[i];
828 working_space[i - 1] =
a;
829 working_space[i +
fSize] = 0;
831 working_space[fSize / 2 - 1] =
833 for (i = 0; i < fSize / 2; i++) {
834 destVector[i] = working_space[i];
838 for (i = 0; i <
fSize; i++) {
839 working_space[i] = source[i];
842 for (i = 0; i < 2 *
fSize; i++) {
843 destVector[i] = working_space[i];
847 for (i = 0; i <
fSize; i++) {
848 working_space[i] = source[i];
851 for (i = 0; i <
fSize; i++) {
852 destVector[i] = working_space[i];
862 for (i = 0; i <
fSize; i++) {
869 working_space[k + i % j] = val;
870 working_space[k + 2 * j - 1 - i % j] = val;
878 working_space[k + i % j] = val;
879 working_space[k + 2 * j - 1 - i % j] = -val;
883 working_space[i] = val;
888 for (i = 0; i < j; i++)
897 for (i = 0; i <
l; i++)
900 for (i = 0; i <
fSize; i++) {
905 b = working_space[k + i % j];
911 working_space[i] =
a;
912 working_space[i + 2 *
fSize] = 0;
920 for (i = 0; i <
l; i++)
923 for (i = 0; i <
fSize; i++) {
928 b = working_space[j + k + i % j];
934 working_space[j + k / 2 - i % j - 1] =
a;
935 working_space[i + 2 *
fSize] = 0;
944 for (i = 0, l = 0; i <
fSize; i++, l = (l + k) % fSize) {
945 working_space[fSize + i] = working_space[l + i / j];
946 working_space[fSize + i + 2 *
fSize] =
947 working_space[l + i / j + 2 *
fSize];
949 for (i = 0; i <
fSize; i++) {
950 working_space[i] = working_space[fSize + i];
951 working_space[i + 2 *
fSize] =
952 working_space[fSize + i + 2 *
fSize];
954 for (i = 0; i <
fSize; i++) {
955 destVector[i] = working_space[i];
959 for (i = 0; i <
fSize; i++) {
960 destVector[fSize + i] = working_space[i + 2 *
fSize];
970 for (i = 0; i <
fSize; i++) {
971 working_space[i] = source[i];
974 for (i = 0; i <
fSize; i++) {
975 destVector[i] = working_space[i];
979 for (i = 0; i <
fSize; i++) {
980 working_space[i] = source[i];
983 Walsh(working_space, fSize);
984 for (i = 0; i <
fSize; i++) {
985 destVector[i] = working_space[i];
989 for (i = 0; i <
fSize; i++) {
990 working_space[i] = source[i];
993 working_space[0] = working_space[0] *
TMath::Sqrt(2.0);
994 for (i = 0; i < fSize / 2; i++) {
999 working_space[i] = (
Double_t) working_space[i] * a;
1000 }
for (i = 2; i <= (fSize / 2); i++) {
1001 working_space[fSize - i + 1] = working_space[i - 1];
1002 working_space[fSize - i + 1 +
fSize] =
1003 -working_space[i - 1 +
fSize];
1005 working_space[fSize / 2] = 0;
1006 working_space[fSize / 2 +
fSize] = 0;
1008 for (i = 0; i < fSize / 2; i++) {
1009 destVector[i] = working_space[i];
1013 for (i = 0; i <
fSize; i++) {
1014 working_space[i] = source[i];
1017 working_space[fSize / 2] =
1019 for (i = fSize / 2 - 1; i > 0; i--) {
1021 working_space[i +
fSize] =
1025 }
for (i = 2; i <= (fSize / 2); i++) {
1026 working_space[fSize - i + 1] = working_space[i - 1];
1027 working_space[fSize - i + 1 +
fSize] =
1028 -working_space[i - 1 +
fSize];
1030 working_space[0] = 0;
1031 working_space[
fSize] = 0;
1032 working_space[fSize / 2 +
fSize] = 0;
1034 for (i = 0; i < fSize / 2; i++) {
1035 destVector[i] = working_space[i];
1039 for (i = 0; i < 2 *
fSize; i++) {
1040 working_space[i] = source[i];
1043 for (i = 0; i <
fSize; i++) {
1044 destVector[i] = working_space[i];
1048 for (i = 0; i <
fSize; i++) {
1049 working_space[i] = source[i];
1052 for (i = 0; i <
fSize; i++) {
1053 destVector[i] = working_space[i];
1063 for (i = 0; i <
fSize; i++) {
1064 working_space[i] = source[i];
1068 for (i = 0; i <
fSize; i++) {
1069 working_space[i + 2 *
fSize] = source[fSize + i];
1078 for (i = 0, l = 0; i <
fSize; i++, l = (l + k) % fSize) {
1079 working_space[fSize + l + i / j] = working_space[i];
1080 working_space[fSize + l + i / j + 2 *
fSize] =
1081 working_space[i + 2 *
fSize];
1083 for (i = 0; i <
fSize; i++) {
1084 working_space[i] = working_space[fSize + i];
1085 working_space[i + 2 *
fSize] =
1086 working_space[fSize + i + 2 *
fSize];
1092 for (i = 0; i < j; i++)
1101 for (i = 0; i <
fSize; i++) {
1106 working_space[2 * fSize + k + i % j] =
1108 working_space[4 * fSize + 2 * fSize + k + i % j] = 0;
1114 working_space[4 * fSize + 2 * fSize + k + i % j] =
1116 working_space[2 * fSize + k + i % j] =
1118 } }
for (i = 0; i <
fSize; i++) {
1122 working_space[2 * fSize + k + j] = 0;
1123 working_space[4 * fSize + 2 * fSize + k + j] = 0;
1127 working_space[2 * fSize + k + 2 * j - i % j] =
1128 working_space[2 * fSize + k + i % j];
1129 working_space[4 * fSize + 2 * fSize + k + 2 * j - i % j] =
1130 -working_space[4 * fSize + 2 * fSize + k + i % j];
1133 for (i = 0; i < 2 *
fSize; i++) {
1134 working_space[i] = working_space[2 * fSize + i];
1135 working_space[4 * fSize + i] =
1136 working_space[4 * fSize + 2 * fSize + i];
1141 for (i = 0; i <
l; i++)
1150 for (i = 0; i <
fSize; i++) {
1155 working_space[2 * fSize + k + j + i % j] =
1156 working_space[j + k / 2 - i % j -
1158 working_space[4 * fSize + 2 * fSize + k + j + i % j] = 0;
1164 working_space[4 * fSize + 2 * fSize + k + j + i % j] =
1165 -(
Double_t) working_space[j + k / 2 - i % j - 1] * b;
1166 working_space[2 * fSize + k + j + i % j] =
1167 (
Double_t) working_space[j + k / 2 - i % j - 1] * a;
1168 } }
for (i = 0; i <
fSize; i++) {
1172 working_space[2 * fSize + k] = 0;
1173 working_space[4 * fSize + 2 * fSize + k] = 0;
1177 working_space[2 * fSize + k + i % j] =
1178 working_space[2 * fSize + k + 2 * j - i % j];
1179 working_space[4 * fSize + 2 * fSize + k + i % j] =
1180 -working_space[4 * fSize + 2 * fSize + k + 2 * j -
1184 for (i = 0; i < 2 *
fSize; i++) {
1185 working_space[i] = working_space[2 * fSize + i];
1186 working_space[4 * fSize + i] =
1187 working_space[4 * fSize + 2 * fSize + i];
1190 for (i = 0; i <
l; i++)
1193 for (i = 0; i <
fSize; i++) {
1197 val = working_space[k + i % j];
1201 val = working_space[i];
1202 destVector[i] = val;
1207 delete[]working_space;
1270 int i, j=0, k = 1,
m,
l;
1273 Double_t a,
b,
pi = 3.14159265358979323846, old_area, new_area;
1303 for (i = 0; i <
fSize; i++) {
1304 working_space[i] = source[i];
1309 for (i = 0; i <
fSize; i++) {
1310 working_space[i] = source[i];
1312 Walsh(working_space, fSize);
1317 for (i = 1; i <= (fSize / 2); i++) {
1318 val = source[i - 1];
1319 working_space[i - 1] = val;
1320 working_space[fSize - i] = val;
1323 for (i = 0; i < fSize / 2; i++) {
1326 b = working_space[i];
1328 working_space[i] =
a;
1329 working_space[i +
fSize] = 0;
1330 } working_space[0] = working_space[0] /
TMath::Sqrt(2.0);
1335 for (i = 1; i <= (fSize / 2); i++) {
1336 val = source[i - 1];
1337 working_space[i - 1] = val;
1338 working_space[fSize - i] = -val;
1341 for (i = 0; i < fSize / 2; i++) {
1344 b = working_space[i];
1347 working_space[i - 1] =
a;
1348 working_space[i +
fSize] = 0;
1350 working_space[fSize / 2 - 1] =
1355 for (i = 0; i <
fSize; i++) {
1356 working_space[i] = source[i];
1361 for (i = 0; i <
fSize; i++) {
1362 working_space[i] = source[i];
1373 for (i = 0; i <
fSize; i++) {
1379 working_space[k + i % j] = val;
1380 working_space[k + 2 * j - 1 - i % j] = val;
1388 working_space[k + i % j] = val;
1389 working_space[k + 2 * j - 1 - i % j] = -val;
1393 working_space[i] = val;
1398 for (i = 0; i < j; i++)
1406 for (i = 0; i <
l; i++)
1409 for (i = 0; i <
fSize; i++) {
1414 b = working_space[k + i % j];
1420 working_space[i] =
a;
1421 working_space[i + 2 *
fSize] = 0;
1428 for (i = 0; i <
l; i++)
1431 for (i = 0; i <
fSize; i++) {
1436 b = working_space[j + k + i % j];
1442 working_space[j + k / 2 - i % j - 1] =
a;
1443 working_space[i + 2 *
fSize] = 0;
1452 for (i = 0, l = 0; i <
fSize; i++, l = (l + k) % fSize) {
1453 working_space[fSize + i] = working_space[l + i / j];
1454 working_space[fSize + i + 2 *
fSize] =
1455 working_space[l + i / j + 2 *
fSize];
1457 for (i = 0; i <
fSize; i++) {
1458 working_space[i] = working_space[fSize + i];
1459 working_space[i + 2 *
fSize] = working_space[fSize + i + 2 *
fSize];
1463 if (!working_space)
return;
1464 for (i = 0, old_area = 0; i <
fSize; i++) {
1465 old_area += working_space[i];
1467 for (i = 0, new_area = 0; i <
fSize; i++) {
1470 new_area += working_space[i];
1472 if (new_area != 0) {
1473 a = old_area / new_area;
1474 for (i = 0; i <
fSize; i++) {
1475 working_space[i] *=
a;
1479 for (i = 0, old_area = 0; i <
fSize; i++) {
1480 old_area += working_space[i +
fSize];
1482 for (i = 0, new_area = 0; i <
fSize; i++) {
1485 new_area += working_space[i +
fSize];
1487 if (new_area != 0) {
1488 a = old_area / new_area;
1489 for (i = 0; i <
fSize; i++) {
1490 working_space[i +
fSize] *=
a;
1497 for (i = 0, old_area = 0; i <
fSize; i++) {
1498 old_area += working_space[i + 2 *
fSize];
1500 for (i = 0, new_area = 0; i <
fSize; i++) {
1503 new_area += working_space[i + 2 *
fSize];
1505 if (new_area != 0) {
1506 a = old_area / new_area;
1507 for (i = 0; i <
fSize; i++) {
1508 working_space[i + 2 *
fSize] *=
a;
1515 for (i = 0; i <
fSize; i++) {
1516 destVector[i] = working_space[i];
1521 Walsh(working_space, fSize);
1522 for (i = 0; i <
fSize; i++) {
1523 destVector[i] = working_space[i];
1528 working_space[0] = working_space[0] *
TMath::Sqrt(2.0);
1529 for (i = 0; i < fSize / 2; i++) {
1534 working_space[i] = (
Double_t) working_space[i] * a;
1535 }
for (i = 2; i <= (fSize / 2); i++) {
1536 working_space[fSize - i + 1] = working_space[i - 1];
1537 working_space[fSize - i + 1 +
fSize] =
1538 -working_space[i - 1 +
fSize];
1540 working_space[fSize / 2] = 0;
1541 working_space[fSize / 2 +
fSize] = 0;
1543 for (i = 0; i < fSize / 2; i++) {
1544 destVector[i] = working_space[i];
1549 working_space[fSize / 2] =
1551 for (i = fSize / 2 - 1; i > 0; i--) {
1553 working_space[i +
fSize] =
1556 }
for (i = 2; i <= (fSize / 2); i++) {
1557 working_space[fSize - i + 1] = working_space[i - 1];
1558 working_space[fSize - i + 1 +
fSize] =
1559 -working_space[i - 1 +
fSize];
1561 working_space[0] = 0;
1562 working_space[
fSize] = 0;
1563 working_space[fSize / 2 +
fSize] = 0;
1565 for (i = 0; i < fSize / 2; i++) {
1566 destVector[i] = working_space[i];
1571 for (i = 0; i <
fSize; i++) {
1572 destVector[i] = working_space[i];
1577 for (i = 0; i <
fSize; i++) {
1578 destVector[i] = working_space[i];
1594 for (i = 0, l = 0; i <
fSize; i++, l = (l + k) % fSize) {
1595 working_space[fSize + l + i / j] = working_space[i];
1596 working_space[fSize + l + i / j + 2 *
fSize] =
1597 working_space[i + 2 *
fSize];
1599 for (i = 0; i <
fSize; i++) {
1600 working_space[i] = working_space[fSize + i];
1601 working_space[i + 2 *
fSize] = working_space[fSize + i + 2 *
fSize];
1607 for (i = 0; i < j; i++)
1615 for (i = 0; i <
fSize; i++) {
1620 working_space[2 * fSize + k + i % j] =
1622 working_space[4 * fSize + 2 * fSize + k + i % j] = 0;
1628 working_space[4 * fSize + 2 * fSize + k + i % j] =
1630 working_space[2 * fSize + k + i % j] =
1632 } }
for (i = 0; i <
fSize; i++) {
1636 working_space[2 * fSize + k + j] = 0;
1637 working_space[4 * fSize + 2 * fSize + k + j] = 0;
1641 working_space[2 * fSize + k + 2 * j - i % j] =
1642 working_space[2 * fSize + k + i % j];
1643 working_space[4 * fSize + 2 * fSize + k + 2 * j - i % j] =
1644 -working_space[4 * fSize + 2 * fSize + k + i % j];
1647 for (i = 0; i < 2 *
fSize; i++) {
1648 working_space[i] = working_space[2 * fSize + i];
1649 working_space[4 * fSize + i] =
1650 working_space[4 * fSize + 2 * fSize + i];
1655 for (i = 0; i <
l; i++)
1663 for (i = 0; i <
fSize; i++) {
1668 working_space[2 * fSize + k + j + i % j] =
1669 working_space[j + k / 2 - i % j - 1] *
TMath::Sqrt(2.0);
1670 working_space[4 * fSize + 2 * fSize + k + j + i % j] = 0;
1676 working_space[4 * fSize + 2 * fSize + k + j + i % j] =
1677 -(
Double_t) working_space[j + k / 2 - i % j - 1] * b;
1678 working_space[2 * fSize + k + j + i % j] =
1679 (
Double_t) working_space[j + k / 2 - i % j - 1] * a;
1680 } }
for (i = 0; i <
fSize; i++) {
1684 working_space[2 * fSize + k] = 0;
1685 working_space[4 * fSize + 2 * fSize + k] = 0;
1689 working_space[2 * fSize + k + i % j] =
1690 working_space[2 * fSize + k + 2 * j - i % j];
1691 working_space[4 * fSize + 2 * fSize + k + i % j] =
1692 -working_space[4 * fSize + 2 * fSize + k + 2 * j - i % j];
1695 for (i = 0; i < 2 *
fSize; i++) {
1696 working_space[i] = working_space[2 * fSize + i];
1697 working_space[4 * fSize + i] =
1698 working_space[4 * fSize + 2 * fSize + i];
1701 for (i = 0; i <
l; i++)
1704 for (i = 0; i <
fSize; i++) {
1708 val = working_space[k + i % j];
1712 val = working_space[i];
1713 destVector[i] = val;
1717 delete[]working_space;
1780 int i, j=0, k = 1,
m,
l;
1783 Double_t a,
b,
pi = 3.14159265358979323846, old_area, new_area;
1813 for (i = 0; i <
fSize; i++) {
1814 working_space[i] = source[i];
1819 for (i = 0; i <
fSize; i++) {
1820 working_space[i] = source[i];
1822 Walsh(working_space, fSize);
1827 for (i = 1; i <= (fSize / 2); i++) {
1828 val = source[i - 1];
1829 working_space[i - 1] = val;
1830 working_space[fSize - i] = val;
1833 for (i = 0; i < fSize / 2; i++) {
1836 b = working_space[i];
1838 working_space[i] =
a;
1839 working_space[i +
fSize] = 0;
1840 } working_space[0] = working_space[0] /
TMath::Sqrt(2.0);
1845 for (i = 1; i <= (fSize / 2); i++) {
1846 val = source[i - 1];
1847 working_space[i - 1] = val;
1848 working_space[fSize - i] = -val;
1851 for (i = 0; i < fSize / 2; i++) {
1854 b = working_space[i];
1857 working_space[i - 1] =
a;
1858 working_space[i +
fSize] = 0;
1860 working_space[fSize / 2 - 1] =
1865 for (i = 0; i <
fSize; i++) {
1866 working_space[i] = source[i];
1871 for (i = 0; i <
fSize; i++) {
1872 working_space[i] = source[i];
1883 for (i = 0; i <
fSize; i++) {
1889 working_space[k + i % j] = val;
1890 working_space[k + 2 * j - 1 - i % j] = val;
1898 working_space[k + i % j] = val;
1899 working_space[k + 2 * j - 1 - i % j] = -val;
1903 working_space[i] = val;
1908 for (i = 0; i < j; i++)
1916 for (i = 0; i <
l; i++)
1919 for (i = 0; i <
fSize; i++) {
1924 b = working_space[k + i % j];
1930 working_space[i] =
a;
1931 working_space[i + 2 *
fSize] = 0;
1938 for (i = 0; i <
l; i++)
1941 for (i = 0; i <
fSize; i++) {
1946 b = working_space[j + k + i % j];
1952 working_space[j + k / 2 - i % j - 1] =
a;
1953 working_space[i + 2 *
fSize] = 0;
1962 for (i = 0, l = 0; i <
fSize; i++, l = (l + k) % fSize) {
1963 working_space[fSize + i] = working_space[l + i / j];
1964 working_space[fSize + i + 2 *
fSize] =
1965 working_space[l + i / j + 2 *
fSize];
1967 for (i = 0; i <
fSize; i++) {
1968 working_space[i] = working_space[fSize + i];
1969 working_space[i + 2 *
fSize] = working_space[fSize + i + 2 *
fSize];
1973 if (!working_space)
return;
1974 for (i = 0, old_area = 0; i <
fSize; i++) {
1975 old_area += working_space[i];
1977 for (i = 0, new_area = 0; i <
fSize; i++) {
1980 new_area += working_space[i];
1982 if (new_area != 0) {
1983 a = old_area / new_area;
1984 for (i = 0; i <
fSize; i++) {
1985 working_space[i] *=
a;
1989 for (i = 0, old_area = 0; i <
fSize; i++) {
1990 old_area += working_space[i +
fSize];
1992 for (i = 0, new_area = 0; i <
fSize; i++) {
1995 new_area += working_space[i +
fSize];
1997 if (new_area != 0) {
1998 a = old_area / new_area;
1999 for (i = 0; i <
fSize; i++) {
2000 working_space[i +
fSize] *=
a;
2007 for (i = 0, old_area = 0; i <
fSize; i++) {
2008 old_area += working_space[i + 2 *
fSize];
2010 for (i = 0, new_area = 0; i <
fSize; i++) {
2013 new_area += working_space[i + 2 *
fSize];
2015 if (new_area != 0) {
2016 a = old_area / new_area;
2017 for (i = 0; i <
fSize; i++) {
2018 working_space[i + 2 *
fSize] *=
a;
2025 for (i = 0; i <
fSize; i++) {
2026 destVector[i] = working_space[i];
2031 Walsh(working_space, fSize);
2032 for (i = 0; i <
fSize; i++) {
2033 destVector[i] = working_space[i];
2038 working_space[0] = working_space[0] *
TMath::Sqrt(2.0);
2039 for (i = 0; i < fSize / 2; i++) {
2044 working_space[i] = (
Double_t) working_space[i] * a;
2045 }
for (i = 2; i <= (fSize / 2); i++) {
2046 working_space[fSize - i + 1] = working_space[i - 1];
2047 working_space[fSize - i + 1 +
fSize] =
2048 -working_space[i - 1 +
fSize];
2050 working_space[fSize / 2] = 0;
2051 working_space[fSize / 2 +
fSize] = 0;
2053 for (i = 0; i < fSize / 2; i++) {
2054 destVector[i] = working_space[i];
2059 working_space[fSize / 2] =
2061 for (i = fSize / 2 - 1; i > 0; i--) {
2063 working_space[i +
fSize] =
2066 }
for (i = 2; i <= (fSize / 2); i++) {
2067 working_space[fSize - i + 1] = working_space[i - 1];
2068 working_space[fSize - i + 1 +
fSize] =
2069 -working_space[i - 1 +
fSize];
2071 working_space[0] = 0;
2072 working_space[
fSize] = 0;
2073 working_space[fSize / 2 +
fSize] = 0;
2075 for (i = 0; i < fSize / 2; i++) {
2076 destVector[i] = working_space[i];
2081 for (i = 0; i <
fSize; i++) {
2082 destVector[i] = working_space[i];
2087 for (i = 0; i <
fSize; i++) {
2088 destVector[i] = working_space[i];
2104 for (i = 0, l = 0; i <
fSize; i++, l = (l + k) % fSize) {
2105 working_space[fSize + l + i / j] = working_space[i];
2106 working_space[fSize + l + i / j + 2 *
fSize] =
2107 working_space[i + 2 *
fSize];
2109 for (i = 0; i <
fSize; i++) {
2110 working_space[i] = working_space[fSize + i];
2111 working_space[i + 2 *
fSize] = working_space[fSize + i + 2 *
fSize];
2117 for (i = 0; i < j; i++)
2125 for (i = 0; i <
fSize; i++) {
2130 working_space[2 * fSize + k + i % j] =
2132 working_space[4 * fSize + 2 * fSize + k + i % j] = 0;
2138 working_space[4 * fSize + 2 * fSize + k + i % j] =
2140 working_space[2 * fSize + k + i % j] =
2142 } }
for (i = 0; i <
fSize; i++) {
2146 working_space[2 * fSize + k + j] = 0;
2147 working_space[4 * fSize + 2 * fSize + k + j] = 0;
2151 working_space[2 * fSize + k + 2 * j - i % j] =
2152 working_space[2 * fSize + k + i % j];
2153 working_space[4 * fSize + 2 * fSize + k + 2 * j - i % j] =
2154 -working_space[4 * fSize + 2 * fSize + k + i % j];
2157 for (i = 0; i < 2 *
fSize; i++) {
2158 working_space[i] = working_space[2 * fSize + i];
2159 working_space[4 * fSize + i] =
2160 working_space[4 * fSize + 2 * fSize + i];
2165 for (i = 0; i <
l; i++)
2173 for (i = 0; i <
fSize; i++) {
2178 working_space[2 * fSize + k + j + i % j] =
2179 working_space[j + k / 2 - i % j - 1] *
TMath::Sqrt(2.0);
2180 working_space[4 * fSize + 2 * fSize + k + j + i % j] = 0;
2186 working_space[4 * fSize + 2 * fSize + k + j + i % j] =
2187 -(
Double_t) working_space[j + k / 2 - i % j - 1] * b;
2188 working_space[2 * fSize + k + j + i % j] =
2189 (
Double_t) working_space[j + k / 2 - i % j - 1] * a;
2190 } }
for (i = 0; i <
fSize; i++) {
2194 working_space[2 * fSize + k] = 0;
2195 working_space[4 * fSize + 2 * fSize + k] = 0;
2199 working_space[2 * fSize + k + i % j] =
2200 working_space[2 * fSize + k + 2 * j - i % j];
2201 working_space[4 * fSize + 2 * fSize + k + i % j] =
2202 -working_space[4 * fSize + 2 * fSize + k + 2 * j - i % j];
2205 for (i = 0; i < 2 *
fSize; i++) {
2206 working_space[i] = working_space[2 * fSize + i];
2207 working_space[4 * fSize + i] =
2208 working_space[4 * fSize + 2 * fSize + i];
2211 for (i = 0; i <
l; i++)
2214 for (i = 0; i <
fSize; i++) {
2218 val = working_space[k + i % j];
2222 val = working_space[i];
2223 destVector[i] = val;
2227 delete[]working_space;
2241 for (; n <
fSize;) {
2246 Error (
"TSpectrumTransform",
"Invalid type of transform");
2250 if (degree > j || degree < 1){
2251 Error (
"TSpectrumTransform",
"Invalid degree of mixed transform");
2265 if(xmin<0 || xmax < xmin || xmax >=
fSize){
2266 Error(
"TSpectrumTransform",
"Wrong range");
2280 Error(
"TSpectrumTransform",
"Wrong direction");
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
The TNamed class is the base class for all named ROOT classes.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Double_t Sqrt(Double_t x)