62 if (sizeX <= 0 || sizeY <= 0){
63 Error (
"TSpectrumTransform",
"Invalid length, must be > than 0");
73 Error (
"TSpectrumTransform",
"Invalid length, must be power of 2");
83 Error (
"TSpectrumTransform",
"Invalid length, must be power of 2");
115 Int_t i, ii, li, l2, l3, j, jj, jj1, lj, iter,
m, jmin, jmax;
118 for (i = 0; i < num; i++)
119 working_space[i + num] = 0;
127 for (
m = 1;
m <= iter;
m++) {
130 for (i = 0; i < (2 * l2); i++) {
131 working_space[num + i] = working_space[i];
133 for (j = 0; j < l2; j++) {
136 val = working_space[jj + num] + working_space[jj + 1 + num];
137 working_space[j] = val;
138 val = working_space[jj + num] - working_space[jj + 1 + num];
139 working_space[l3] = val;
143 val = working_space[0];
145 working_space[0] = val;
146 val = working_space[1];
148 working_space[1] = val;
149 for (ii = 2; ii <= iter; ii++) {
154 for (j = jmin; j <= jmax; j++) {
155 val = working_space[j];
159 working_space[j] = val;
163 for (
m = 1;
m <= iter;
m++) {
168 for (i = 0; i < (2 * li); i++) {
169 working_space[i + num] = working_space[i];
171 for (j = 0; j < li; j++) {
173 jj = 2 * (j + 1) - 1;
175 val = working_space[j + num] - working_space[lj + num];
176 working_space[jj] = val;
177 val = working_space[j + num] + working_space[lj + num];
178 working_space[jj1] = val;
194 Int_t i,
m, nump = 1, mnum, mnum2, mp, ib, mp2, mnum21, iba, iter;
197 for (i = 0; i < num; i++)
198 working_space[i + num] = 0;
205 for (
m = 1;
m <= iter;
m++) {
213 for (mp = 0; mp < nump; mp++) {
215 for (mp2 = 0; mp2 < mnum2; mp2++) {
216 mnum21 = mnum2 + mp2 + ib;
218 val1 = working_space[iba];
219 val2 = working_space[mnum21];
220 working_space[iba + num] = val1 + val2;
221 working_space[mnum21 + num] = val1 - val2;
224 for (i = 0; i < num; i++) {
225 working_space[i] = working_space[i + num];
231 for (i = 0; i < num; i++) {
232 val1 = working_space[i];
234 working_space[i] = val1;
249 Int_t i, ib, il, ibd, ip, ifac, i1;
250 for (i = 0; i < num; i++) {
251 working_space[i + num] = working_space[i];
253 for (i = 1; i <= num; i++) {
267 for (i1 = 1; i1 <= il; i1++) {
269 ip = ip + ifac * ipower[i1 - 1];
271 working_space[ip - 1] = working_space[i - 1 + num];
288 Int_t nxp2, nxp, i, j, k,
m, iter, mxp, j1, j2, n1, n2, it;
289 Double_t a,
b,
c,
d, sign, wpwr, arg, wr, wi, tr, ti, pi =
290 3.14159265358979323846;
293 for (i = 0; i < num; i++)
294 working_space[i + num] = 0;
306 for (it = 1; it <= iter; it++) {
311 for (
m = 1;
m <= nxp2;
m++) {
316 for (mxp = nxp; mxp <= num; mxp += nxp) {
319 val1 = working_space[j1 - 1];
320 val2 = working_space[j2 - 1];
321 val3 = working_space[j1 - 1 + num];
322 val4 = working_space[j2 - 1 + num];
331 working_space[j1 - 1] = val1;
334 working_space[j1 - 1 + num] = val1;
335 a = tr * wr - ti * wi;
337 working_space[j2 - 1] = val1;
338 a = ti * wr + tr * wi;
340 working_space[j2 - 1 + num] = val1;
347 for (i = 1; i <= n1; i++) {
350 val1 = working_space[j - 1];
351 val2 = working_space[j - 1 + num];
352 val3 = working_space[i - 1];
353 working_space[j - 1] = val3;
354 working_space[j - 1 + num] = working_space[i - 1 + num];
355 working_space[i - 1] = val1;
356 working_space[i - 1 + num] = val2;
358 lab60:
if (k >= j)
goto lab65;
366 for (i = 0; i < num; i++) {
368 val1 = working_space[i];
372 working_space[i] = val1;
373 b = working_space[i + num];
375 working_space[i + num] =
b;
379 b = working_space[i];
380 c = working_space[i + num];
382 working_space[i] =
b;
383 working_space[i + num] = 0;
387 for (i = 1; i < num; i++)
388 working_space[num - i + num] = working_space[i];
389 working_space[0 + num] = working_space[0];
390 for (i = 0; i < num; i++) {
391 working_space[i] = working_space[i + num];
392 working_space[i + num] = 0;
411 Int_t i, ib, il, ibd, ip, ifac, i1;
412 for (i = 0; i < num; i++) {
413 working_space[i + shift + start] = working_space[i + start];
414 working_space[i + shift + start + 2 * shift] =
415 working_space[i + start + 2 * shift];
417 for (i = 1; i <= num; i++) {
431 for (i1 = 1; i1 <= il; i1++) {
433 ip = ip + ifac * ipower[i1 - 1];
435 working_space[ip - 1 + start] =
436 working_space[i - 1 + shift + start];
437 working_space[ip - 1 + start + 2 * shift] =
438 working_space[i - 1 + shift + start + 2 * shift];
456 Int_t i, j, k,
m, nump, mnum, mnum2, mp, ib, mp2, mnum21, iba, iter,
457 mp2step, mppom, ring;
458 Double_t a,
b,
c,
d, wpwr, arg, wr, wi, tr, ti, pi =
459 3.14159265358979323846;
460 Double_t val1, val2, val3, val4, a0oldr = 0, b0oldr = 0, a0r, b0r;
462 for (i = 0; i < num; i++)
463 working_space[i + 2 * num] = 0;
476 for (i = 0; i < iter - degree; i++)
478 for (
m = 1;
m <= iter;
m++) {
490 for (mp = 0; mp < nump; mp++) {
493 mppom = mppom % ring;
497 for (i = 0; i < (iter - 1); i++) {
498 if ((mppom & j) != 0)
513 for (mp2 = 0; mp2 < mnum2; mp2++) {
514 mnum21 = mnum2 + mp2 + ib;
516 if (mp2 % mp2step == 0) {
527 val1 = working_space[iba];
528 val2 = working_space[mnum21];
529 val3 = working_space[iba + 2 * num];
530 val4 = working_space[mnum21 + 2 * num];
535 tr =
a * a0r +
b * b0r;
537 working_space[num + iba] = val1;
538 ti =
c * a0r +
d * b0r;
540 working_space[num + iba + 2 * num] = val1;
542 a * b0r * wr -
c * b0r * wi -
b * a0r * wr +
d * a0r * wi;
544 working_space[num + mnum21] = val1;
546 c * b0r * wr +
a * b0r * wi -
d * a0r * wr -
b * a0r * wi;
548 working_space[num + mnum21 + 2 * num] = val1;
551 for (i = 0; i < num; i++) {
552 val1 = working_space[num + i];
553 working_space[i] = val1;
554 val1 = working_space[num + i + 2 * num];
555 working_space[i + 2 * num] = val1;
574 1, mnum, mnum2, mp, ib, mp2, mnum21, iba, iter, mp2step, mppom,
576 Double_t a,
b,
c,
d, wpwr, arg, wr, wi, tr, ti, pi =
577 3.14159265358979323846;
578 Double_t val1, val2, val3, val4, a0oldr = 0, b0oldr = 0, a0r, b0r;
590 for (i = 0; i < iter - degree; i++)
594 for (
m = 1;
m <= iter;
m++) {
602 if (
m > iter - degree + 1)
604 for (mp = nump - 1; mp >= 0; mp--) {
607 mppom = mppom % ring;
611 for (i = 0; i < (iter - 1); i++) {
612 if ((mppom & j) != 0)
627 for (mp2 = 0; mp2 < mnum2; mp2++) {
628 mnum21 = mnum2 + mp2 + ib;
630 if (mp2 % mp2step == 0) {
641 val1 = working_space[iba];
642 val2 = working_space[mnum21];
643 val3 = working_space[iba + 2 * num];
644 val4 = working_space[mnum21 + 2 * num];
649 tr =
a * a0r +
b * wr * b0r +
d * wi * b0r;
651 working_space[num + iba] = val1;
652 ti =
c * a0r +
d * wr * b0r -
b * wi * b0r;
654 working_space[num + iba + 2 * num] = val1;
655 tr =
a * b0r -
b * wr * a0r -
d * wi * a0r;
657 working_space[num + mnum21] = val1;
658 ti =
c * b0r -
d * wr * a0r +
b * wi * a0r;
660 working_space[num + mnum21 + 2 * num] = val1;
663 if (
m <= iter - degree
669 for (i = 0; i < num; i++) {
670 val1 = working_space[num + i];
671 working_space[i] = val1;
672 val1 = working_space[num + i + 2 * num];
673 working_space[i + 2 * num] = val1;
695 for (j = 0; j < numy; j++) {
696 for (i = 0; i < numx; i++) {
697 working_vector[i] = working_matrix[i][j];
704 Walsh(working_vector, numx);
708 for (i = 0; i < numx; i++) {
709 working_matrix[i][j] = working_vector[i];
712 for (i = 0; i < numx; i++) {
713 for (j = 0; j < numy; j++) {
714 working_vector[j] = working_matrix[i][j];
721 Walsh(working_vector, numy);
725 for (j = 0; j < numy; j++) {
726 working_matrix[i][j] = working_vector[j];
732 for (i = 0; i < numx; i++) {
733 for (j = 0; j < numy; j++) {
734 working_vector[j] = working_matrix[i][j];
742 Walsh(working_vector, numy);
745 for (j = 0; j < numy; j++) {
746 working_matrix[i][j] = working_vector[j];
749 for (j = 0; j < numy; j++) {
750 for (i = 0; i < numx; i++) {
751 working_vector[i] = working_matrix[i][j];
759 Walsh(working_vector, numx);
762 for (i = 0; i < numx; i++) {
763 working_matrix[i][j] = working_vector[i];
784 Double_t pi = 3.14159265358979323846;
813 for (j = 0; j < numy; j++) {
814 for (i = 0; i < numx; i++) {
815 working_vector[i] = working_matrix[i][j];
819 for (i = 1; i <= numx; i++) {
820 working_vector[2 * numx - i] = working_vector[i - 1];
823 for (i = 0; i < numx; i++) {
825 working_vector[i] /
TMath::Cos(pi * i / (2 * numx));
827 working_vector[0] = working_vector[0] /
TMath::Sqrt(2.);
830 for (i = 1; i <= numx; i++) {
831 working_vector[2 * numx - i] = -working_vector[i - 1];
834 for (i = 1; i < numx; i++) {
835 working_vector[i - 1] =
836 working_vector[i] /
TMath::Sin(pi * i / (2 * numx));
838 working_vector[numx - 1] =
848 for (i = 0; i < numx; i++) {
849 working_matrix[i][j] = working_vector[i];
851 working_matrix[i][j + numy] = working_vector[i + numx];
854 working_matrix[i][j + numy] = working_vector[i + 2 * numx];
857 for (i = 0; i < numx; i++) {
858 for (j = 0; j < numy; j++) {
859 working_vector[j] = working_matrix[i][j];
861 working_vector[j + numy] = working_matrix[i][j + numy];
864 working_vector[j + 2 * numy] = working_matrix[i][j + numy];
868 for (j = 1; j <= numy; j++) {
869 working_vector[2 * numy - j] = working_vector[j - 1];
872 for (j = 0; j < numy; j++) {
874 working_vector[j] /
TMath::Cos(pi * j / (2 * numy));
875 working_vector[j + 2 * numy] = 0;
877 working_vector[0] = working_vector[0] /
TMath::Sqrt(2.);
880 for (j = 1; j <= numy; j++) {
881 working_vector[2 * numy - j] = -working_vector[j - 1];
884 for (j = 1; j < numy; j++) {
885 working_vector[j - 1] =
886 working_vector[j] /
TMath::Sin(pi * j / (2 * numy));
887 working_vector[j + numy] = 0;
889 working_vector[numy - 1] =
891 working_vector[numy] = 0;
900 for (j = 0; j < numy; j++) {
901 working_matrix[i][j] = working_vector[j];
903 working_matrix[i][j + numy] = working_vector[j + numy];
906 working_matrix[i][j + numy] = working_vector[j + 2 * numy];
912 for (i = 0; i < numx; i++) {
913 for (j = 0; j < numy; j++) {
914 working_vector[j] = working_matrix[i][j];
916 working_vector[j + numy] = working_matrix[i][j + numy];
919 working_vector[j + 2 * numy] = working_matrix[i][j + numy];
923 working_vector[0] = working_vector[0] *
TMath::Sqrt(2.);
924 for (j = 0; j < numy; j++) {
925 working_vector[j + 2 * numy] =
926 working_vector[j] *
TMath::Sin(pi * j / (2 * numy));
928 working_vector[j] *
TMath::Cos(pi * j / (2 * numy));
930 for (j = 1; j < numy; j++) {
931 working_vector[2 * numy - j] = working_vector[j];
932 working_vector[2 * numy - j + 2 * numy] =
933 -working_vector[j + 2 * numy];
935 working_vector[numy] = 0;
936 working_vector[numy + 2 * numy] = 0;
940 working_vector[numy] =
942 for (j = numy - 1; j > 0; j--) {
943 working_vector[j + 2 * numy] =
947 working_vector[j - 1] *
TMath::Sin(pi * j / (2 * numy));
949 for (j = 1; j < numy; j++) {
950 working_vector[2 * numy - j] = working_vector[j];
951 working_vector[2 * numy - j + 2 * numy] =
952 -working_vector[j + 2 * numy];
954 working_vector[0] = 0;
955 working_vector[0 + 2 * numy] = 0;
956 working_vector[numy + 2 * numy] = 0;
966 for (j = 0; j < numy; j++) {
967 working_matrix[i][j] = working_vector[j];
969 working_matrix[i][j + numy] = working_vector[j + numy];
972 working_matrix[i][j + numy] = working_vector[j + 2 * numy];
975 for (j = 0; j < numy; j++) {
976 for (i = 0; i < numx; i++) {
977 working_vector[i] = working_matrix[i][j];
979 working_vector[i + numx] = working_matrix[i][j + numy];
982 working_vector[i + 2 * numx] = working_matrix[i][j + numy];
986 working_vector[0] = working_vector[0] *
TMath::Sqrt(2.);
987 for (i = 0; i < numx; i++) {
988 working_vector[i + 2 * numx] =
989 working_vector[i] *
TMath::Sin(pi * i / (2 * numx));
991 working_vector[i] *
TMath::Cos(pi * i / (2 * numx));
993 for (i = 1; i < numx; i++) {
994 working_vector[2 * numx - i] = working_vector[i];
995 working_vector[2 * numx - i + 2 * numx] =
996 -working_vector[i + 2 * numx];
998 working_vector[numx] = 0;
999 working_vector[numx + 2 * numx] = 0;
1003 working_vector[numx] =
1005 for (i = numx - 1; i > 0; i--) {
1006 working_vector[i + 2 * numx] =
1010 working_vector[i - 1] *
TMath::Sin(pi * i / (2 * numx));
1012 for (i = 1; i < numx; i++) {
1013 working_vector[2 * numx - i] = working_vector[i];
1014 working_vector[2 * numx - i + 2 * numx] =
1015 -working_vector[i + 2 * numx];
1017 working_vector[0] = 0;
1018 working_vector[0 + 2 * numx] = 0;
1019 working_vector[numx + 2 * numx] = 0;
1029 for (i = 0; i < numx; i++) {
1030 working_matrix[i][j] = working_vector[i];
1052 Int_t i, j, jstup, kstup,
l,
m;
1056 for (j = 0; j < numy; j++) {
1058 jstup = numx / kstup;
1059 for (i = 0; i < numx; i++) {
1060 val = working_matrix[i][j];
1065 kstup = 2 * kstup * jstup;
1066 working_vector[kstup + i % jstup] = val;
1067 working_vector[kstup + 2 * jstup - 1 - i % jstup] = val;
1074 kstup = 2 * kstup * jstup;
1075 working_vector[kstup + i % jstup] = val;
1076 working_vector[kstup + 2 * jstup - 1 - i % jstup] = -val;
1080 working_vector[i] = val;
1087 for (i = 0; i < jstup; i++)
1094 for (i = 0; i <
l; i++)
1097 for (i = 0; i < numx; i++) {
1099 kstup = 2 * kstup * jstup;
1102 b = working_vector[kstup + i % jstup];
1108 working_vector[i] =
a;
1109 working_vector[i + 4 * numx] = 0;
1116 for (i = 0; i <
l; i++)
1119 for (i = 0; i < numx; i++) {
1121 kstup = 2 * kstup * jstup;
1124 b = working_vector[jstup + kstup + i % jstup];
1130 working_vector[jstup + kstup / 2 - i % jstup - 1] =
a;
1131 working_vector[i + 4 * numx] = 0;
1140 jstup = numx / kstup;
1141 for (i = 0,
l = 0; i < numx; i++,
l = (
l + kstup) % numx) {
1142 working_vector[numx + i] = working_vector[
l + i / jstup];
1146 working_vector[numx + i + 2 * numx] =
1147 working_vector[
l + i / jstup + 2 * numx];
1150 working_vector[numx + i + 4 * numx] =
1151 working_vector[
l + i / jstup + 4 * numx];
1153 for (i = 0; i < numx; i++) {
1154 working_vector[i] = working_vector[numx + i];
1158 working_vector[i + 2 * numx] =
1159 working_vector[numx + i + 2 * numx];
1162 working_vector[i + 4 * numx] =
1163 working_vector[numx + i + 4 * numx];
1165 for (i = 0; i < numx; i++) {
1166 working_matrix[i][j] = working_vector[i];
1170 working_matrix[i][j + numy] = working_vector[i + 2 * numx];
1173 working_matrix[i][j + numy] = working_vector[i + 4 * numx];
1176 for (i = 0; i < numx; i++) {
1178 jstup = numy / kstup;
1179 for (j = 0; j < numy; j++) {
1180 valx = working_matrix[i][j];
1181 valz = working_matrix[i][j + numy];
1186 kstup = 2 * kstup * jstup;
1187 working_vector[kstup + j % jstup] = valx;
1188 working_vector[kstup + 2 * jstup - 1 - j % jstup] = valx;
1189 working_vector[kstup + j % jstup + 4 * numy] = valz;
1190 working_vector[kstup + 2 * jstup - 1 - j % jstup +
1198 kstup = 2 * kstup * jstup;
1199 working_vector[kstup + j % jstup] = valx;
1200 working_vector[kstup + 2 * jstup - 1 - j % jstup] = -valx;
1201 working_vector[kstup + j % jstup + 4 * numy] = valz;
1202 working_vector[kstup + 2 * jstup - 1 - j % jstup +
1207 working_vector[j] = valx;
1208 working_vector[j + 2 * numy] = valz;
1216 for (j = 0; j < jstup; j++)
1223 for (j = 0; j <
l; j++)
1226 for (j = 0; j < numy; j++) {
1228 kstup = 2 * kstup * jstup;
1231 b = working_vector[kstup + j % jstup];
1237 working_vector[j] =
a;
1238 working_vector[j + 4 * numy] = 0;
1245 for (j = 0; j <
l; j++)
1248 for (j = 0; j < numy; j++) {
1250 kstup = 2 * kstup * jstup;
1253 b = working_vector[jstup + kstup + j % jstup];
1259 working_vector[jstup + kstup / 2 - j % jstup - 1] =
a;
1260 working_vector[j + 4 * numy] = 0;
1269 jstup = numy / kstup;
1270 for (j = 0,
l = 0; j < numy; j++,
l = (
l + kstup) % numy) {
1271 working_vector[numy + j] = working_vector[
l + j / jstup];
1275 working_vector[numy + j + 2 * numy] =
1276 working_vector[
l + j / jstup + 2 * numy];
1279 working_vector[numy + j + 4 * numy] =
1280 working_vector[
l + j / jstup + 4 * numy];
1282 for (j = 0; j < numy; j++) {
1283 working_vector[j] = working_vector[numy + j];
1287 working_vector[j + 2 * numy] =
1288 working_vector[numy + j + 2 * numy];
1291 working_vector[j + 4 * numy] =
1292 working_vector[numy + j + 4 * numy];
1294 for (j = 0; j < numy; j++) {
1295 working_matrix[i][j] = working_vector[j];
1299 working_matrix[i][j + numy] = working_vector[j + 2 * numy];
1302 working_matrix[i][j + numy] = working_vector[j + 4 * numy];
1308 for (i = 0; i < numx; i++) {
1310 jstup = numy / kstup;
1311 for (j = 0; j < numy; j++) {
1312 working_vector[j] = working_matrix[i][j];
1316 working_vector[j + 2 * numy] = working_matrix[i][j + numy];
1319 working_vector[j + 4 * numy] = working_matrix[i][j + numy];
1326 jstup = numy / kstup;
1327 for (j = 0,
l = 0; j < numy; j++,
l = (
l + kstup) % numy) {
1328 working_vector[numy +
l + j / jstup] = working_vector[j];
1332 working_vector[numy +
l + j / jstup + 2 * numy] =
1333 working_vector[j + 2 * numy];
1336 working_vector[numy +
l + j / jstup + 4 * numy] =
1337 working_vector[j + 4 * numy];
1339 for (j = 0; j < numy; j++) {
1340 working_vector[j] = working_vector[numy + j];
1344 working_vector[j + 2 * numy] =
1345 working_vector[numy + j + 2 * numy];
1348 working_vector[j + 4 * numy] =
1349 working_vector[numy + j + 4 * numy];
1355 for (j = 0; j < jstup; j++)
1364 for (j = 0; j < numy; j++) {
1366 kstup = 2 * kstup * jstup;
1368 if (j % jstup == 0) {
1369 working_vector[2 * numy + kstup + j % jstup] =
1371 working_vector[2 * numy + kstup + j % jstup +
1378 working_vector[2 * numy + kstup + j % jstup +
1381 working_vector[2 * numy + kstup + j % jstup] =
1383 } }
for (j = 0; j < numy; j++) {
1385 kstup = 2 * kstup * jstup;
1386 if (j % jstup == 0) {
1387 working_vector[2 * numy + kstup + jstup] = 0;
1388 working_vector[2 * numy + kstup + jstup + 4 * numy] = 0;
1392 working_vector[2 * numy + kstup + 2 * jstup -
1394 working_vector[2 * numy + kstup + j % jstup];
1395 working_vector[2 * numy + kstup + 2 * jstup -
1396 j % jstup + 4 * numy] =
1397 -working_vector[2 * numy + kstup + j % jstup +
1401 for (j = 0; j < 2 * numy; j++) {
1402 working_vector[j] = working_vector[2 * numy + j];
1403 working_vector[j + 4 * numy] =
1404 working_vector[2 * numy + j + 4 * numy];
1409 for (j = 0; j <
l; j++)
1417 for (j = 0; j < numy; j++) {
1419 kstup = 2 * kstup * jstup;
1421 if (j % jstup == 0) {
1422 working_vector[2 * numy + kstup + jstup + j % jstup] =
1423 working_vector[jstup + kstup / 2 - j % jstup -
1425 working_vector[2 * numy + kstup + jstup + j % jstup +
1432 working_vector[2 * numy + kstup + jstup + j % jstup +
1434 -(
Double_t) working_vector[jstup + kstup / 2 -
1436 working_vector[2 * numy + kstup + jstup + j % jstup] =
1437 (
Double_t) working_vector[jstup + kstup / 2 -
1439 } }
for (j = 0; j < numy; j++) {
1441 kstup = 2 * kstup * jstup;
1442 if (j % jstup == 0) {
1443 working_vector[2 * numy + kstup] = 0;
1444 working_vector[2 * numy + kstup + 4 * numy] = 0;
1448 working_vector[2 * numy + kstup + j % jstup] =
1449 working_vector[2 * numy + kstup + 2 * jstup -
1451 working_vector[2 * numy + kstup + j % jstup +
1453 -working_vector[2 * numy + kstup + 2 * jstup -
1454 j % jstup + 4 * numy];
1457 for (j = 0; j < 2 * numy; j++) {
1458 working_vector[j] = working_vector[2 * numy + j];
1459 working_vector[j + 4 * numy] =
1460 working_vector[2 * numy + j + 4 * numy];
1463 for (j = 0; j <
l; j++)
1467 for (j = 0; j < numy; j++) {
1470 kstup = 2 * kstup * jstup;
1471 valx = working_vector[kstup + j % jstup];
1472 valz = working_vector[kstup + j % jstup + 4 * numy];
1476 valx = working_vector[j];
1477 valz = working_vector[j + 2 * numy];
1479 working_matrix[i][j] = valx;
1480 working_matrix[i][j + numy] = valz;
1483 for (j = 0; j < numy; j++) {
1485 jstup = numy / kstup;
1486 for (i = 0; i < numx; i++) {
1487 working_vector[i] = working_matrix[i][j];
1491 working_vector[i + 2 * numx] = working_matrix[i][j + numy];
1494 working_vector[i + 4 * numx] = working_matrix[i][j + numy];
1501 jstup = numx / kstup;
1502 for (i = 0,
l = 0; i < numx; i++,
l = (
l + kstup) % numx) {
1503 working_vector[numx +
l + i / jstup] = working_vector[i];
1507 working_vector[numx +
l + i / jstup + 2 * numx] =
1508 working_vector[i + 2 * numx];
1511 working_vector[numx +
l + i / jstup + 4 * numx] =
1512 working_vector[i + 4 * numx];
1514 for (i = 0; i < numx; i++) {
1515 working_vector[i] = working_vector[numx + i];
1519 working_vector[i + 2 * numx] =
1520 working_vector[numx + i + 2 * numx];
1523 working_vector[i + 4 * numx] =
1524 working_vector[numx + i + 4 * numx];
1530 for (i = 0; i < jstup; i++)
1539 for (i = 0; i < numx; i++) {
1541 kstup = 2 * kstup * jstup;
1543 if (i % jstup == 0) {
1544 working_vector[2 * numx + kstup + i % jstup] =
1546 working_vector[2 * numx + kstup + i % jstup +
1553 working_vector[2 * numx + kstup + i % jstup +
1556 working_vector[2 * numx + kstup + i % jstup] =
1558 } }
for (i = 0; i < numx; i++) {
1560 kstup = 2 * kstup * jstup;
1561 if (i % jstup == 0) {
1562 working_vector[2 * numx + kstup + jstup] = 0;
1563 working_vector[2 * numx + kstup + jstup + 4 * numx] = 0;
1567 working_vector[2 * numx + kstup + 2 * jstup -
1569 working_vector[2 * numx + kstup + i % jstup];
1570 working_vector[2 * numx + kstup + 2 * jstup -
1571 i % jstup + 4 * numx] =
1572 -working_vector[2 * numx + kstup + i % jstup +
1576 for (i = 0; i < 2 * numx; i++) {
1577 working_vector[i] = working_vector[2 * numx + i];
1578 working_vector[i + 4 * numx] =
1579 working_vector[2 * numx + i + 4 * numx];
1584 for (i = 0; i <
l; i++)
1592 for (i = 0; i < numx; i++) {
1594 kstup = 2 * kstup * jstup;
1596 if (i % jstup == 0) {
1597 working_vector[2 * numx + kstup + jstup + i % jstup] =
1598 working_vector[jstup + kstup / 2 - i % jstup -
1600 working_vector[2 * numx + kstup + jstup + i % jstup +
1607 working_vector[2 * numx + kstup + jstup + i % jstup +
1609 -(
Double_t) working_vector[jstup + kstup / 2 -
1611 working_vector[2 * numx + kstup + jstup + i % jstup] =
1612 (
Double_t) working_vector[jstup + kstup / 2 -
1614 } }
for (i = 0; i < numx; i++) {
1616 kstup = 2 * kstup * jstup;
1617 if (i % jstup == 0) {
1618 working_vector[2 * numx + kstup] = 0;
1619 working_vector[2 * numx + kstup + 4 * numx] = 0;
1623 working_vector[2 * numx + kstup + i % jstup] =
1624 working_vector[2 * numx + kstup + 2 * jstup -
1626 working_vector[2 * numx + kstup + i % jstup +
1628 -working_vector[2 * numx + kstup + 2 * jstup -
1629 i % jstup + 4 * numx];
1632 for (i = 0; i < 2 * numx; i++) {
1633 working_vector[i] = working_vector[2 * numx + i];
1634 working_vector[i + 4 * numx] =
1635 working_vector[2 * numx + i + 4 * numx];
1638 for (i = 0; i <
l; i++)
1642 for (i = 0; i < numx; i++) {
1645 kstup = 2 * kstup * jstup;
1646 val = working_vector[kstup + i % jstup];
1650 val = working_vector[i];
1651 working_matrix[i][j] = val;
1760 Double_t *working_vector = 0, **working_matrix = 0;
1767 for (i = 0; i <
fSizeX; i++)
1779 for (i = 0; i <
fSizeX; i++)
1788 for (i = 0; i <
fSizeX; i++)
1795 for (i = 0; i <
fSizeX; i++) {
1796 for (j = 0; j <
fSizeY; j++) {
1797 working_matrix[i][j] = fSource[i][j];
1802 for (i = 0; i <
fSizeX; i++) {
1803 for (j = 0; j <
fSizeY; j++) {
1804 fDest[i][j] = working_matrix[i][j];
1809 for (i = 0; i <
fSizeX; i++) {
1810 for (j = 0; j <
fSizeY; j++) {
1811 working_matrix[i][j] = fSource[i][j];
1816 for (i = 0; i <
fSizeX; i++) {
1817 for (j = 0; j <
fSizeY; j++) {
1818 fDest[i][j] = working_matrix[i][j];
1823 for (i = 0; i <
fSizeX; i++) {
1824 for (j = 0; j <
fSizeY; j++) {
1825 working_matrix[i][j] = fSource[i][j];
1830 for (i = 0; i <
fSizeX; i++) {
1831 for (j = 0; j <
fSizeY; j++) {
1832 fDest[i][j] = working_matrix[i][j];
1837 for (i = 0; i <
fSizeX; i++) {
1838 for (j = 0; j <
fSizeY; j++) {
1839 working_matrix[i][j] = fSource[i][j];
1844 for (i = 0; i <
fSizeX; i++) {
1845 for (j = 0; j <
fSizeY; j++) {
1846 fDest[i][j] = working_matrix[i][j];
1851 for (i = 0; i <
fSizeX; i++) {
1852 for (j = 0; j <
fSizeY; j++) {
1853 working_matrix[i][j] = fSource[i][j];
1858 for (i = 0; i <
fSizeX; i++) {
1859 for (j = 0; j <
fSizeY; j++) {
1860 fDest[i][j] = working_matrix[i][j];
1863 for (i = 0; i <
fSizeX; i++) {
1864 for (j = 0; j <
fSizeY; j++) {
1870 for (i = 0; i <
fSizeX; i++) {
1871 for (j = 0; j <
fSizeY; j++) {
1872 working_matrix[i][j] = fSource[i][j];
1877 for (i = 0; i <
fSizeX; i++) {
1878 for (j = 0; j <
fSizeY; j++) {
1879 fDest[i][j] = working_matrix[i][j];
1890 for (i = 0; i <
fSizeX; i++) {
1891 for (j = 0; j <
fSizeY; j++) {
1892 working_matrix[i][j] = fSource[i][j];
1897 for (i = 0; i <
fSizeX; i++) {
1898 for (j = 0; j <
fSizeY; j++) {
1899 fDest[i][j] = working_matrix[i][j];
1904 for (i = 0; i <
fSizeX; i++) {
1905 for (j = 0; j <
fSizeY; j++) {
1917 for (i = 0; i <
fSizeX; i++) {
1918 for (j = 0; j <
fSizeY; j++) {
1919 working_matrix[i][j] = fSource[i][j];
1924 for (i = 0; i <
fSizeX; i++) {
1925 for (j = 0; j <
fSizeY; j++) {
1926 fDest[i][j] = working_matrix[i][j];
1931 for (i = 0; i <
fSizeX; i++) {
1932 for (j = 0; j <
fSizeY; j++) {
1933 working_matrix[i][j] = fSource[i][j];
1938 for (i = 0; i <
fSizeX; i++) {
1939 for (j = 0; j <
fSizeY; j++) {
1940 fDest[i][j] = working_matrix[i][j];
1945 for (i = 0; i <
fSizeX; i++) {
1946 for (j = 0; j <
fSizeY; j++) {
1947 working_matrix[i][j] = fSource[i][j];
1952 for (i = 0; i <
fSizeX; i++) {
1953 for (j = 0; j <
fSizeY; j++) {
1954 fDest[i][j] = working_matrix[i][j];
1959 for (i = 0; i <
fSizeX; i++) {
1960 for (j = 0; j <
fSizeY; j++) {
1961 working_matrix[i][j] = fSource[i][j];
1966 for (i = 0; i <
fSizeX; i++) {
1967 for (j = 0; j <
fSizeY; j++) {
1968 fDest[i][j] = working_matrix[i][j];
1973 for (i = 0; i <
fSizeX; i++) {
1974 for (j = 0; j <
fSizeY; j++) {
1975 working_matrix[i][j] = fSource[i][j];
1978 for (i = 0; i <
fSizeX; i++) {
1979 for (j = 0; j <
fSizeY; j++) {
1980 working_matrix[i][j +
fSizeY] = fSource[i][j +
fSizeY];
1985 for (i = 0; i <
fSizeX; i++) {
1986 for (j = 0; j <
fSizeY; j++) {
1987 fDest[i][j] = working_matrix[i][j];
1992 for (i = 0; i <
fSizeX; i++) {
1993 for (j = 0; j <
fSizeY; j++) {
1994 working_matrix[i][j] = fSource[i][j];
1999 for (i = 0; i <
fSizeX; i++) {
2000 for (j = 0; j <
fSizeY; j++) {
2001 fDest[i][j] = working_matrix[i][j];
2012 for (i = 0; i <
fSizeX; i++) {
2013 for (j = 0; j <
fSizeY; j++) {
2014 working_matrix[i][j] = fSource[i][j];
2019 for (i = 0; i <
fSizeX; i++) {
2020 for (j = 0; j <
fSizeY; j++) {
2021 working_matrix[i][j +
fSizeY] = fSource[i][j +
fSizeY];
2027 for (i = 0; i <
fSizeX; i++) {
2028 for (j = 0; j <
fSizeY; j++) {
2029 fDest[i][j] = working_matrix[i][j];
2035 for (i = 0; i <
fSizeX; i++) {
2036 if (working_matrix)
delete[]working_matrix[i];
2038 delete[]working_matrix;
2039 delete[]working_vector;
2121 Double_t *working_vector = 0, **working_matrix = 0;
2128 for (i = 0; i <
fSizeX; i++)
2140 for (i = 0; i <
fSizeX; i++)
2149 for (i = 0; i <
fSizeX; i++)
2155 for (i = 0; i <
fSizeX; i++) {
2156 for (j = 0; j <
fSizeY; j++) {
2157 working_matrix[i][j] = fSource[i][j];
2158 old_area = old_area + fSource[i][j];
2165 for (i = 0; i <
fSizeX; i++) {
2166 for (j = 0; j <
fSizeY; j++) {
2167 working_matrix[i][j] = fSource[i][j];
2168 old_area = old_area + fSource[i][j];
2175 for (i = 0; i <
fSizeX; i++) {
2176 for (j = 0; j <
fSizeY; j++) {
2177 working_matrix[i][j] = fSource[i][j];
2178 old_area = old_area + fSource[i][j];
2185 for (i = 0; i <
fSizeX; i++) {
2186 for (j = 0; j <
fSizeY; j++) {
2187 working_matrix[i][j] = fSource[i][j];
2188 old_area = old_area + fSource[i][j];
2195 for (i = 0; i <
fSizeX; i++) {
2196 for (j = 0; j <
fSizeY; j++) {
2197 working_matrix[i][j] = fSource[i][j];
2198 old_area = old_area + fSource[i][j];
2205 for (i = 0; i <
fSizeX; i++) {
2206 for (j = 0; j <
fSizeY; j++) {
2207 working_matrix[i][j] = fSource[i][j];
2208 old_area = old_area + fSource[i][j];
2221 for (i = 0; i <
fSizeX; i++) {
2222 for (j = 0; j <
fSizeY; j++) {
2223 working_matrix[i][j] = fSource[i][j];
2224 old_area = old_area + fSource[i][j];
2231 for (i = 0; i <
fSizeX; i++) {
2232 for (j = 0; j <
fSizeY; j++) {
2234 if (working_matrix) working_matrix[i][j] =
fFilterCoeff;
2239 for (i = 0; i <
fSizeX; i++) {
2240 for (j = 0; j <
fSizeY; j++) {
2250 for (i = 0; i <
fSizeX; i++) {
2251 for (j = 0; j <
fSizeY; j++) {
2252 new_area = new_area + working_matrix[i][j];
2255 if (new_area != 0) {
2256 a = old_area / new_area;
2257 for (i = 0; i <
fSizeX; i++) {
2258 for (j = 0; j <
fSizeY; j++) {
2259 fDest[i][j] = working_matrix[i][j] *
a;
2267 for (i = 0; i <
fSizeX; i++) {
2268 for (j = 0; j <
fSizeY; j++) {
2269 new_area = new_area + working_matrix[i][j];
2272 if (new_area != 0) {
2273 a = old_area / new_area;
2274 for (i = 0; i <
fSizeX; i++) {
2275 for (j = 0; j <
fSizeY; j++) {
2276 fDest[i][j] = working_matrix[i][j] *
a;
2284 for (i = 0; i <
fSizeX; i++) {
2285 for (j = 0; j <
fSizeY; j++) {
2286 new_area = new_area + working_matrix[i][j];
2289 if (new_area != 0) {
2290 a = old_area / new_area;
2291 for (i = 0; i <
fSizeX; i++) {
2292 for (j = 0; j <
fSizeY; j++) {
2293 fDest[i][j] = working_matrix[i][j] *
a;
2301 for (i = 0; i <
fSizeX; i++) {
2302 for (j = 0; j <
fSizeY; j++) {
2303 new_area = new_area + working_matrix[i][j];
2306 if (new_area != 0) {
2307 a = old_area / new_area;
2308 for (i = 0; i <
fSizeX; i++) {
2309 for (j = 0; j <
fSizeY; j++) {
2310 fDest[i][j] = working_matrix[i][j] *
a;
2318 for (i = 0; i <
fSizeX; i++) {
2319 for (j = 0; j <
fSizeY; j++) {
2320 new_area = new_area + working_matrix[i][j];
2323 if (new_area != 0) {
2324 a = old_area / new_area;
2325 for (i = 0; i <
fSizeX; i++) {
2326 for (j = 0; j <
fSizeY; j++) {
2327 fDest[i][j] = working_matrix[i][j] *
a;
2335 for (i = 0; i <
fSizeX; i++) {
2336 for (j = 0; j <
fSizeY; j++) {
2337 new_area = new_area + working_matrix[i][j];
2340 if (new_area != 0) {
2341 a = old_area / new_area;
2342 for (i = 0; i <
fSizeX; i++) {
2343 for (j = 0; j <
fSizeY; j++) {
2344 fDest[i][j] = working_matrix[i][j] *
a;
2358 for (i = 0; i <
fSizeX; i++) {
2359 for (j = 0; j <
fSizeY; j++) {
2360 new_area = new_area + working_matrix[i][j];
2363 if (new_area != 0) {
2364 a = old_area / new_area;
2365 for (i = 0; i <
fSizeX; i++) {
2366 for (j = 0; j <
fSizeY; j++) {
2367 fDest[i][j] = working_matrix[i][j] *
a;
2373 for (i = 0; i <
fSizeX; i++) {
2374 if (working_matrix)
delete[]working_matrix[i];
2376 delete[]working_matrix;
2377 delete[]working_vector;
2452 Double_t *working_vector = 0, **working_matrix = 0;
2459 for (i = 0; i <
fSizeX; i++)
2471 for (i = 0; i <
fSizeX; i++)
2480 for (i = 0; i <
fSizeX; i++)
2486 for (i = 0; i <
fSizeX; i++) {
2487 for (j = 0; j <
fSizeY; j++) {
2488 working_matrix[i][j] = fSource[i][j];
2489 old_area = old_area + fSource[i][j];
2496 for (i = 0; i <
fSizeX; i++) {
2497 for (j = 0; j <
fSizeY; j++) {
2498 working_matrix[i][j] = fSource[i][j];
2499 old_area = old_area + fSource[i][j];
2506 for (i = 0; i <
fSizeX; i++) {
2507 for (j = 0; j <
fSizeY; j++) {
2508 working_matrix[i][j] = fSource[i][j];
2509 old_area = old_area + fSource[i][j];
2516 for (i = 0; i <
fSizeX; i++) {
2517 for (j = 0; j <
fSizeY; j++) {
2518 working_matrix[i][j] = fSource[i][j];
2519 old_area = old_area + fSource[i][j];
2526 for (i = 0; i <
fSizeX; i++) {
2527 for (j = 0; j <
fSizeY; j++) {
2528 working_matrix[i][j] = fSource[i][j];
2529 old_area = old_area + fSource[i][j];
2536 for (i = 0; i <
fSizeX; i++) {
2537 for (j = 0; j <
fSizeY; j++) {
2538 working_matrix[i][j] = fSource[i][j];
2539 old_area = old_area + fSource[i][j];
2552 for (i = 0; i <
fSizeX; i++) {
2553 for (j = 0; j <
fSizeY; j++) {
2554 working_matrix[i][j] = fSource[i][j];
2555 old_area = old_area + fSource[i][j];
2562 for (i = 0; i <
fSizeX; i++) {
2563 for (j = 0; j <
fSizeY; j++) {
2570 for (i = 0; i <
fSizeX; i++) {
2571 for (j = 0; j <
fSizeY; j++) {
2581 for (i = 0; i <
fSizeX; i++) {
2582 for (j = 0; j <
fSizeY; j++) {
2583 new_area = new_area + working_matrix[i][j];
2586 if (new_area != 0) {
2587 a = old_area / new_area;
2588 for (i = 0; i <
fSizeX; i++) {
2589 for (j = 0; j <
fSizeY; j++) {
2590 fDest[i][j] = working_matrix[i][j] *
a;
2598 for (i = 0; i <
fSizeX; i++) {
2599 for (j = 0; j <
fSizeY; j++) {
2600 new_area = new_area + working_matrix[i][j];
2603 if (new_area != 0) {
2604 a = old_area / new_area;
2605 for (i = 0; i <
fSizeX; i++) {
2606 for (j = 0; j <
fSizeY; j++) {
2607 fDest[i][j] = working_matrix[i][j] *
a;
2615 for (i = 0; i <
fSizeX; i++) {
2616 for (j = 0; j <
fSizeY; j++) {
2617 new_area = new_area + working_matrix[i][j];
2620 if (new_area != 0) {
2621 a = old_area / new_area;
2622 for (i = 0; i <
fSizeX; i++) {
2623 for (j = 0; j <
fSizeY; j++) {
2624 fDest[i][j] = working_matrix[i][j] *
a;
2632 for (i = 0; i <
fSizeX; i++) {
2633 for (j = 0; j <
fSizeY; j++) {
2634 new_area = new_area + working_matrix[i][j];
2637 if (new_area != 0) {
2638 a = old_area / new_area;
2639 for (i = 0; i <
fSizeX; i++) {
2640 for (j = 0; j <
fSizeY; j++) {
2641 fDest[i][j] = working_matrix[i][j] *
a;
2649 for (i = 0; i <
fSizeX; i++) {
2650 for (j = 0; j <
fSizeY; j++) {
2651 new_area = new_area + working_matrix[i][j];
2654 if (new_area != 0) {
2655 a = old_area / new_area;
2656 for (i = 0; i <
fSizeX; i++) {
2657 for (j = 0; j <
fSizeY; j++) {
2658 fDest[i][j] = working_matrix[i][j] *
a;
2666 for (i = 0; i <
fSizeX; i++) {
2667 for (j = 0; j <
fSizeY; j++) {
2668 new_area = new_area + working_matrix[i][j];
2671 if (new_area != 0) {
2672 a = old_area / new_area;
2673 for (i = 0; i <
fSizeX; i++) {
2674 for (j = 0; j <
fSizeY; j++) {
2675 fDest[i][j] = working_matrix[i][j] *
a;
2689 for (i = 0; i <
fSizeX; i++) {
2690 for (j = 0; j <
fSizeY; j++) {
2691 new_area = new_area + working_matrix[i][j];
2694 if (new_area != 0) {
2695 a = old_area / new_area;
2696 for (i = 0; i <
fSizeX; i++) {
2697 for (j = 0; j <
fSizeY; j++) {
2698 fDest[i][j] = working_matrix[i][j] *
a;
2704 for (i = 0; i <
fSizeX; i++) {
2705 if (working_matrix)
delete[]working_matrix[i];
2707 delete[]working_matrix;
2708 delete[]working_vector;
2733 Error (
"TSpectrumTransform",
"Invalid type of transform");
2737 if (degree > j1 || degree > j2 || degree < 1){
2738 Error (
"TSpectrumTransform",
"Invalid degree of mixed transform");
2753 Error(
"TSpectrumTransform",
"Wrong range");
2757 Error(
"TSpectrumTransform",
"Wrong range");
2773 Error(
"TSpectrumTransform",
"Wrong direction");
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Mother of all ROOT objects.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Short_t Max(Short_t a, Short_t b)
Double_t Sqrt(Double_t x)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)