62 if (sizeX <= 0 || sizeY <= 0){
63 Error (
"TSpectrumTransform",
"Invalid length, must be > than 0");
71 Error (
"TSpectrumTransform",
"Invalid length, must be power of 2");
79 Error (
"TSpectrumTransform",
"Invalid length, must be power of 2");
111 Int_t i, ii, li, l2, l3, j, jj, jj1, lj, iter,
m, jmin, jmax;
114 for (i = 0; i < num; i++)
115 working_space[i + num] = 0;
123 for (
m = 1;
m <= iter;
m++) {
126 for (i = 0; i < (2 * l2); i++) {
127 working_space[num + i] = working_space[i];
129 for (j = 0; j < l2; j++) {
132 val = working_space[jj + num] + working_space[jj + 1 + num];
133 working_space[j] = val;
134 val = working_space[jj + num] - working_space[jj + 1 + num];
135 working_space[l3] = val;
139 val = working_space[0];
141 working_space[0] = val;
142 val = working_space[1];
144 working_space[1] = val;
145 for (ii = 2; ii <= iter; ii++) {
150 for (j = jmin; j <= jmax; j++) {
151 val = working_space[j];
155 working_space[j] = val;
159 for (
m = 1;
m <= iter;
m++) {
164 for (i = 0; i < (2 * li); i++) {
165 working_space[i + num] = working_space[i];
167 for (j = 0; j < li; j++) {
169 jj = 2 * (j + 1) - 1;
171 val = working_space[j + num] - working_space[lj + num];
172 working_space[jj] = val;
173 val = working_space[j + num] + working_space[lj + num];
174 working_space[jj1] = val;
190 Int_t i,
m, nump = 1, mnum, mnum2, mp, ib, mp2, mnum21, iba, iter;
193 for (i = 0; i < num; i++)
194 working_space[i + num] = 0;
201 for (
m = 1;
m <= iter;
m++) {
209 for (mp = 0; mp < nump; mp++) {
211 for (mp2 = 0; mp2 < mnum2; mp2++) {
212 mnum21 = mnum2 + mp2 + ib;
214 val1 = working_space[iba];
215 val2 = working_space[mnum21];
216 working_space[iba + num] = val1 + val2;
217 working_space[mnum21 + num] = val1 - val2;
220 for (i = 0; i < num; i++) {
221 working_space[i] = working_space[i + num];
227 for (i = 0; i < num; i++) {
228 val1 = working_space[i];
230 working_space[i] = val1;
245 Int_t i, ib, il, ibd, ip, ifac, i1;
246 for (i = 0; i < num; i++) {
247 working_space[i + num] = working_space[i];
249 for (i = 1; i <= num; i++) {
263 for (i1 = 1; i1 <= il; i1++) {
265 ip = ip + ifac * ipower[i1 - 1];
267 working_space[ip - 1] = working_space[i - 1 + num];
284 Int_t nxp2, nxp, i, j, k,
m, iter, mxp, j1, j2, n1, n2, it;
285 Double_t a,
b,
c,
d, sign, wpwr, arg, wr, wi, tr, ti, pi =
286 3.14159265358979323846;
289 for (i = 0; i < num; i++)
290 working_space[i + num] = 0;
302 for (it = 1; it <= iter; it++) {
307 for (
m = 1;
m <= nxp2;
m++) {
312 for (mxp = nxp; mxp <= num; mxp += nxp) {
315 val1 = working_space[j1 - 1];
316 val2 = working_space[j2 - 1];
317 val3 = working_space[j1 - 1 + num];
318 val4 = working_space[j2 - 1 + num];
327 working_space[j1 - 1] = val1;
330 working_space[j1 - 1 + num] = val1;
331 a = tr * wr - ti * wi;
333 working_space[j2 - 1] = val1;
334 a = ti * wr + tr * wi;
336 working_space[j2 - 1 + num] = val1;
343 for (i = 1; i <= n1; i++) {
346 val1 = working_space[j - 1];
347 val2 = working_space[j - 1 + num];
348 val3 = working_space[i - 1];
349 working_space[j - 1] = val3;
350 working_space[j - 1 + num] = working_space[i - 1 + num];
351 working_space[i - 1] = val1;
352 working_space[i - 1 + num] = val2;
354 lab60:
if (k >= j)
goto lab65;
362 for (i = 0; i < num; i++) {
364 val1 = working_space[i];
368 working_space[i] = val1;
369 b = working_space[i + num];
371 working_space[i + num] =
b;
375 b = working_space[i];
376 c = working_space[i + num];
378 working_space[i] =
b;
379 working_space[i + num] = 0;
383 for (i = 1; i < num; i++)
384 working_space[num - i + num] = working_space[i];
385 working_space[0 + num] = working_space[0];
386 for (i = 0; i < num; i++) {
387 working_space[i] = working_space[i + num];
388 working_space[i + num] = 0;
407 Int_t i, ib, il, ibd, ip, ifac, i1;
408 for (i = 0; i < num; i++) {
409 working_space[i + shift + start] = working_space[i + start];
410 working_space[i + shift + start + 2 * shift] =
411 working_space[i + start + 2 * shift];
413 for (i = 1; i <= num; i++) {
427 for (i1 = 1; i1 <= il; i1++) {
429 ip = ip + ifac * ipower[i1 - 1];
431 working_space[ip - 1 + start] =
432 working_space[i - 1 + shift + start];
433 working_space[ip - 1 + start + 2 * shift] =
434 working_space[i - 1 + shift + start + 2 * shift];
452 Int_t i, j, k,
m, nump, mnum, mnum2, mp, ib, mp2, mnum21, iba, iter,
453 mp2step, mppom, ring;
454 Double_t a,
b,
c,
d, wpwr, arg, wr, wi, tr, ti, pi =
455 3.14159265358979323846;
456 Double_t val1, val2, val3, val4, a0oldr = 0, b0oldr = 0, a0r, b0r;
458 for (i = 0; i < num; i++)
459 working_space[i + 2 * num] = 0;
472 for (i = 0; i < iter - degree; i++)
474 for (
m = 1;
m <= iter;
m++) {
486 for (mp = 0; mp < nump; mp++) {
489 mppom = mppom % ring;
493 for (i = 0; i < (iter - 1); i++) {
494 if ((mppom & j) != 0)
509 for (mp2 = 0; mp2 < mnum2; mp2++) {
510 mnum21 = mnum2 + mp2 + ib;
512 if (mp2 % mp2step == 0) {
523 val1 = working_space[iba];
524 val2 = working_space[mnum21];
525 val3 = working_space[iba + 2 * num];
526 val4 = working_space[mnum21 + 2 * num];
531 tr =
a * a0r +
b * b0r;
533 working_space[num + iba] = val1;
534 ti =
c * a0r +
d * b0r;
536 working_space[num + iba + 2 * num] = val1;
538 a * b0r * wr -
c * b0r * wi -
b * a0r * wr +
d * a0r * wi;
540 working_space[num + mnum21] = val1;
542 c * b0r * wr +
a * b0r * wi -
d * a0r * wr -
b * a0r * wi;
544 working_space[num + mnum21 + 2 * num] = val1;
547 for (i = 0; i < num; i++) {
548 val1 = working_space[num + i];
549 working_space[i] = val1;
550 val1 = working_space[num + i + 2 * num];
551 working_space[i + 2 * num] = val1;
570 1, mnum, mnum2, mp, ib, mp2, mnum21, iba, iter, mp2step, mppom,
572 Double_t a,
b,
c,
d, wpwr, arg, wr, wi, tr, ti, pi =
573 3.14159265358979323846;
574 Double_t val1, val2, val3, val4, a0oldr = 0, b0oldr = 0, a0r, b0r;
586 for (i = 0; i < iter - degree; i++)
590 for (
m = 1;
m <= iter;
m++) {
598 if (
m > iter - degree + 1)
600 for (mp = nump - 1; mp >= 0; mp--) {
603 mppom = mppom % ring;
607 for (i = 0; i < (iter - 1); i++) {
608 if ((mppom & j) != 0)
623 for (mp2 = 0; mp2 < mnum2; mp2++) {
624 mnum21 = mnum2 + mp2 + ib;
626 if (mp2 % mp2step == 0) {
637 val1 = working_space[iba];
638 val2 = working_space[mnum21];
639 val3 = working_space[iba + 2 * num];
640 val4 = working_space[mnum21 + 2 * num];
645 tr =
a * a0r +
b * wr * b0r +
d * wi * b0r;
647 working_space[num + iba] = val1;
648 ti =
c * a0r +
d * wr * b0r -
b * wi * b0r;
650 working_space[num + iba + 2 * num] = val1;
651 tr =
a * b0r -
b * wr * a0r -
d * wi * a0r;
653 working_space[num + mnum21] = val1;
654 ti =
c * b0r -
d * wr * a0r +
b * wi * a0r;
656 working_space[num + mnum21 + 2 * num] = val1;
659 if (
m <= iter - degree
665 for (i = 0; i < num; i++) {
666 val1 = working_space[num + i];
667 working_space[i] = val1;
668 val1 = working_space[num + i + 2 * num];
669 working_space[i + 2 * num] = val1;
691 for (j = 0; j < numy; j++) {
692 for (i = 0; i < numx; i++) {
693 working_vector[i] = working_matrix[i][j];
700 Walsh(working_vector, numx);
704 for (i = 0; i < numx; i++) {
705 working_matrix[i][j] = working_vector[i];
708 for (i = 0; i < numx; i++) {
709 for (j = 0; j < numy; j++) {
710 working_vector[j] = working_matrix[i][j];
717 Walsh(working_vector, numy);
721 for (j = 0; j < numy; j++) {
722 working_matrix[i][j] = working_vector[j];
728 for (i = 0; i < numx; i++) {
729 for (j = 0; j < numy; j++) {
730 working_vector[j] = working_matrix[i][j];
738 Walsh(working_vector, numy);
741 for (j = 0; j < numy; j++) {
742 working_matrix[i][j] = working_vector[j];
745 for (j = 0; j < numy; j++) {
746 for (i = 0; i < numx; i++) {
747 working_vector[i] = working_matrix[i][j];
755 Walsh(working_vector, numx);
758 for (i = 0; i < numx; i++) {
759 working_matrix[i][j] = working_vector[i];
780 Double_t pi = 3.14159265358979323846;
805 for (j = 0; j < numy; j++) {
806 for (i = 0; i < numx; i++) {
807 working_vector[i] = working_matrix[i][j];
811 for (i = 1; i <= numx; i++) {
812 working_vector[2 * numx - i] = working_vector[i - 1];
815 for (i = 0; i < numx; i++) {
817 working_vector[i] /
TMath::Cos(pi * i / (2 * numx));
819 working_vector[0] = working_vector[0] /
TMath::Sqrt(2.);
822 for (i = 1; i <= numx; i++) {
823 working_vector[2 * numx - i] = -working_vector[i - 1];
826 for (i = 1; i < numx; i++) {
827 working_vector[i - 1] =
828 working_vector[i] /
TMath::Sin(pi * i / (2 * numx));
830 working_vector[numx - 1] =
840 for (i = 0; i < numx; i++) {
841 working_matrix[i][j] = working_vector[i];
843 working_matrix[i][j + numy] = working_vector[i + numx];
846 working_matrix[i][j + numy] = working_vector[i + 2 * numx];
849 for (i = 0; i < numx; i++) {
850 for (j = 0; j < numy; j++) {
851 working_vector[j] = working_matrix[i][j];
853 working_vector[j + numy] = working_matrix[i][j + numy];
856 working_vector[j + 2 * numy] = working_matrix[i][j + numy];
860 for (j = 1; j <= numy; j++) {
861 working_vector[2 * numy - j] = working_vector[j - 1];
864 for (j = 0; j < numy; j++) {
866 working_vector[j] /
TMath::Cos(pi * j / (2 * numy));
867 working_vector[j + 2 * numy] = 0;
869 working_vector[0] = working_vector[0] /
TMath::Sqrt(2.);
872 for (j = 1; j <= numy; j++) {
873 working_vector[2 * numy - j] = -working_vector[j - 1];
876 for (j = 1; j < numy; j++) {
877 working_vector[j - 1] =
878 working_vector[j] /
TMath::Sin(pi * j / (2 * numy));
879 working_vector[j + numy] = 0;
881 working_vector[numy - 1] =
883 working_vector[numy] = 0;
892 for (j = 0; j < numy; j++) {
893 working_matrix[i][j] = working_vector[j];
895 working_matrix[i][j + numy] = working_vector[j + numy];
898 working_matrix[i][j + numy] = working_vector[j + 2 * numy];
904 for (i = 0; i < numx; i++) {
905 for (j = 0; j < numy; j++) {
906 working_vector[j] = working_matrix[i][j];
908 working_vector[j + numy] = working_matrix[i][j + numy];
911 working_vector[j + 2 * numy] = working_matrix[i][j + numy];
915 working_vector[0] = working_vector[0] *
TMath::Sqrt(2.);
916 for (j = 0; j < numy; j++) {
917 working_vector[j + 2 * numy] =
918 working_vector[j] *
TMath::Sin(pi * j / (2 * numy));
920 working_vector[j] *
TMath::Cos(pi * j / (2 * numy));
922 for (j = 1; j < numy; j++) {
923 working_vector[2 * numy - j] = working_vector[j];
924 working_vector[2 * numy - j + 2 * numy] =
925 -working_vector[j + 2 * numy];
927 working_vector[numy] = 0;
928 working_vector[numy + 2 * numy] = 0;
932 working_vector[numy] =
934 for (j = numy - 1; j > 0; j--) {
935 working_vector[j + 2 * numy] =
939 working_vector[j - 1] *
TMath::Sin(pi * j / (2 * numy));
941 for (j = 1; j < numy; j++) {
942 working_vector[2 * numy - j] = working_vector[j];
943 working_vector[2 * numy - j + 2 * numy] =
944 -working_vector[j + 2 * numy];
946 working_vector[0] = 0;
947 working_vector[0 + 2 * numy] = 0;
948 working_vector[numy + 2 * numy] = 0;
958 for (j = 0; j < numy; j++) {
959 working_matrix[i][j] = working_vector[j];
961 working_matrix[i][j + numy] = working_vector[j + numy];
964 working_matrix[i][j + numy] = working_vector[j + 2 * numy];
967 for (j = 0; j < numy; j++) {
968 for (i = 0; i < numx; i++) {
969 working_vector[i] = working_matrix[i][j];
971 working_vector[i + numx] = working_matrix[i][j + numy];
974 working_vector[i + 2 * numx] = working_matrix[i][j + numy];
978 working_vector[0] = working_vector[0] *
TMath::Sqrt(2.);
979 for (i = 0; i < numx; i++) {
980 working_vector[i + 2 * numx] =
981 working_vector[i] *
TMath::Sin(pi * i / (2 * numx));
983 working_vector[i] *
TMath::Cos(pi * i / (2 * numx));
985 for (i = 1; i < numx; i++) {
986 working_vector[2 * numx - i] = working_vector[i];
987 working_vector[2 * numx - i + 2 * numx] =
988 -working_vector[i + 2 * numx];
990 working_vector[numx] = 0;
991 working_vector[numx + 2 * numx] = 0;
995 working_vector[numx] =
997 for (i = numx - 1; i > 0; i--) {
998 working_vector[i + 2 * numx] =
1002 working_vector[i - 1] *
TMath::Sin(pi * i / (2 * numx));
1004 for (i = 1; i < numx; i++) {
1005 working_vector[2 * numx - i] = working_vector[i];
1006 working_vector[2 * numx - i + 2 * numx] =
1007 -working_vector[i + 2 * numx];
1009 working_vector[0] = 0;
1010 working_vector[0 + 2 * numx] = 0;
1011 working_vector[numx + 2 * numx] = 0;
1021 for (i = 0; i < numx; i++) {
1022 working_matrix[i][j] = working_vector[i];
1044 Int_t i, j, jstup, kstup,
l,
m;
1048 for (j = 0; j < numy; j++) {
1050 jstup = numx / kstup;
1051 for (i = 0; i < numx; i++) {
1052 val = working_matrix[i][j];
1057 kstup = 2 * kstup * jstup;
1058 working_vector[kstup + i % jstup] = val;
1059 working_vector[kstup + 2 * jstup - 1 - i % jstup] = val;
1066 kstup = 2 * kstup * jstup;
1067 working_vector[kstup + i % jstup] = val;
1068 working_vector[kstup + 2 * jstup - 1 - i % jstup] = -val;
1072 working_vector[i] = val;
1079 for (i = 0; i < jstup; i++)
1086 for (i = 0; i <
l; i++)
1089 for (i = 0; i < numx; i++) {
1091 kstup = 2 * kstup * jstup;
1094 b = working_vector[kstup + i % jstup];
1100 working_vector[i] =
a;
1101 working_vector[i + 4 * numx] = 0;
1108 for (i = 0; i <
l; i++)
1111 for (i = 0; i < numx; i++) {
1113 kstup = 2 * kstup * jstup;
1116 b = working_vector[jstup + kstup + i % jstup];
1122 working_vector[jstup + kstup / 2 - i % jstup - 1] =
a;
1123 working_vector[i + 4 * numx] = 0;
1132 jstup = numx / kstup;
1133 for (i = 0,
l = 0; i < numx; i++,
l = (
l + kstup) % numx) {
1134 working_vector[numx + i] = working_vector[
l + i / jstup];
1138 working_vector[numx + i + 2 * numx] =
1139 working_vector[
l + i / jstup + 2 * numx];
1142 working_vector[numx + i + 4 * numx] =
1143 working_vector[
l + i / jstup + 4 * numx];
1145 for (i = 0; i < numx; i++) {
1146 working_vector[i] = working_vector[numx + i];
1150 working_vector[i + 2 * numx] =
1151 working_vector[numx + i + 2 * numx];
1154 working_vector[i + 4 * numx] =
1155 working_vector[numx + i + 4 * numx];
1157 for (i = 0; i < numx; i++) {
1158 working_matrix[i][j] = working_vector[i];
1162 working_matrix[i][j + numy] = working_vector[i + 2 * numx];
1165 working_matrix[i][j + numy] = working_vector[i + 4 * numx];
1168 for (i = 0; i < numx; i++) {
1170 jstup = numy / kstup;
1171 for (j = 0; j < numy; j++) {
1172 valx = working_matrix[i][j];
1173 valz = working_matrix[i][j + numy];
1178 kstup = 2 * kstup * jstup;
1179 working_vector[kstup + j % jstup] = valx;
1180 working_vector[kstup + 2 * jstup - 1 - j % jstup] = valx;
1181 working_vector[kstup + j % jstup + 4 * numy] = valz;
1182 working_vector[kstup + 2 * jstup - 1 - j % jstup +
1190 kstup = 2 * kstup * jstup;
1191 working_vector[kstup + j % jstup] = valx;
1192 working_vector[kstup + 2 * jstup - 1 - j % jstup] = -valx;
1193 working_vector[kstup + j % jstup + 4 * numy] = valz;
1194 working_vector[kstup + 2 * jstup - 1 - j % jstup +
1199 working_vector[j] = valx;
1200 working_vector[j + 2 * numy] = valz;
1208 for (j = 0; j < jstup; j++)
1215 for (j = 0; j <
l; j++)
1218 for (j = 0; j < numy; j++) {
1220 kstup = 2 * kstup * jstup;
1223 b = working_vector[kstup + j % jstup];
1229 working_vector[j] =
a;
1230 working_vector[j + 4 * numy] = 0;
1237 for (j = 0; j <
l; j++)
1240 for (j = 0; j < numy; j++) {
1242 kstup = 2 * kstup * jstup;
1245 b = working_vector[jstup + kstup + j % jstup];
1251 working_vector[jstup + kstup / 2 - j % jstup - 1] =
a;
1252 working_vector[j + 4 * numy] = 0;
1261 jstup = numy / kstup;
1262 for (j = 0,
l = 0; j < numy; j++,
l = (
l + kstup) % numy) {
1263 working_vector[numy + j] = working_vector[
l + j / jstup];
1267 working_vector[numy + j + 2 * numy] =
1268 working_vector[
l + j / jstup + 2 * numy];
1271 working_vector[numy + j + 4 * numy] =
1272 working_vector[
l + j / jstup + 4 * numy];
1274 for (j = 0; j < numy; j++) {
1275 working_vector[j] = working_vector[numy + j];
1279 working_vector[j + 2 * numy] =
1280 working_vector[numy + j + 2 * numy];
1283 working_vector[j + 4 * numy] =
1284 working_vector[numy + j + 4 * numy];
1286 for (j = 0; j < numy; j++) {
1287 working_matrix[i][j] = working_vector[j];
1291 working_matrix[i][j + numy] = working_vector[j + 2 * numy];
1294 working_matrix[i][j + numy] = working_vector[j + 4 * numy];
1300 for (i = 0; i < numx; i++) {
1302 jstup = numy / kstup;
1303 for (j = 0; j < numy; j++) {
1304 working_vector[j] = working_matrix[i][j];
1308 working_vector[j + 2 * numy] = working_matrix[i][j + numy];
1311 working_vector[j + 4 * numy] = working_matrix[i][j + numy];
1318 jstup = numy / kstup;
1319 for (j = 0,
l = 0; j < numy; j++,
l = (
l + kstup) % numy) {
1320 working_vector[numy +
l + j / jstup] = working_vector[j];
1324 working_vector[numy +
l + j / jstup + 2 * numy] =
1325 working_vector[j + 2 * numy];
1328 working_vector[numy +
l + j / jstup + 4 * numy] =
1329 working_vector[j + 4 * numy];
1331 for (j = 0; j < numy; j++) {
1332 working_vector[j] = working_vector[numy + j];
1336 working_vector[j + 2 * numy] =
1337 working_vector[numy + j + 2 * numy];
1340 working_vector[j + 4 * numy] =
1341 working_vector[numy + j + 4 * numy];
1347 for (j = 0; j < jstup; j++)
1356 for (j = 0; j < numy; j++) {
1358 kstup = 2 * kstup * jstup;
1360 if (j % jstup == 0) {
1361 working_vector[2 * numy + kstup + j % jstup] =
1363 working_vector[2 * numy + kstup + j % jstup +
1370 working_vector[2 * numy + kstup + j % jstup +
1373 working_vector[2 * numy + kstup + j % jstup] =
1375 } }
for (j = 0; j < numy; j++) {
1377 kstup = 2 * kstup * jstup;
1378 if (j % jstup == 0) {
1379 working_vector[2 * numy + kstup + jstup] = 0;
1380 working_vector[2 * numy + kstup + jstup + 4 * numy] = 0;
1384 working_vector[2 * numy + kstup + 2 * jstup -
1386 working_vector[2 * numy + kstup + j % jstup];
1387 working_vector[2 * numy + kstup + 2 * jstup -
1388 j % jstup + 4 * numy] =
1389 -working_vector[2 * numy + kstup + j % jstup +
1393 for (j = 0; j < 2 * numy; j++) {
1394 working_vector[j] = working_vector[2 * numy + j];
1395 working_vector[j + 4 * numy] =
1396 working_vector[2 * numy + j + 4 * numy];
1401 for (j = 0; j <
l; j++)
1409 for (j = 0; j < numy; j++) {
1411 kstup = 2 * kstup * jstup;
1413 if (j % jstup == 0) {
1414 working_vector[2 * numy + kstup + jstup + j % jstup] =
1415 working_vector[jstup + kstup / 2 - j % jstup -
1417 working_vector[2 * numy + kstup + jstup + j % jstup +
1424 working_vector[2 * numy + kstup + jstup + j % jstup +
1426 -(
Double_t) working_vector[jstup + kstup / 2 -
1428 working_vector[2 * numy + kstup + jstup + j % jstup] =
1429 (
Double_t) working_vector[jstup + kstup / 2 -
1431 } }
for (j = 0; j < numy; j++) {
1433 kstup = 2 * kstup * jstup;
1434 if (j % jstup == 0) {
1435 working_vector[2 * numy + kstup] = 0;
1436 working_vector[2 * numy + kstup + 4 * numy] = 0;
1440 working_vector[2 * numy + kstup + j % jstup] =
1441 working_vector[2 * numy + kstup + 2 * jstup -
1443 working_vector[2 * numy + kstup + j % jstup +
1445 -working_vector[2 * numy + kstup + 2 * jstup -
1446 j % jstup + 4 * numy];
1449 for (j = 0; j < 2 * numy; j++) {
1450 working_vector[j] = working_vector[2 * numy + j];
1451 working_vector[j + 4 * numy] =
1452 working_vector[2 * numy + j + 4 * numy];
1455 for (j = 0; j <
l; j++)
1459 for (j = 0; j < numy; j++) {
1462 kstup = 2 * kstup * jstup;
1463 valx = working_vector[kstup + j % jstup];
1464 valz = working_vector[kstup + j % jstup + 4 * numy];
1468 valx = working_vector[j];
1469 valz = working_vector[j + 2 * numy];
1471 working_matrix[i][j] = valx;
1472 working_matrix[i][j + numy] = valz;
1475 for (j = 0; j < numy; j++) {
1477 jstup = numy / kstup;
1478 for (i = 0; i < numx; i++) {
1479 working_vector[i] = working_matrix[i][j];
1483 working_vector[i + 2 * numx] = working_matrix[i][j + numy];
1486 working_vector[i + 4 * numx] = working_matrix[i][j + numy];
1493 jstup = numx / kstup;
1494 for (i = 0,
l = 0; i < numx; i++,
l = (
l + kstup) % numx) {
1495 working_vector[numx +
l + i / jstup] = working_vector[i];
1499 working_vector[numx +
l + i / jstup + 2 * numx] =
1500 working_vector[i + 2 * numx];
1503 working_vector[numx +
l + i / jstup + 4 * numx] =
1504 working_vector[i + 4 * numx];
1506 for (i = 0; i < numx; i++) {
1507 working_vector[i] = working_vector[numx + i];
1511 working_vector[i + 2 * numx] =
1512 working_vector[numx + i + 2 * numx];
1515 working_vector[i + 4 * numx] =
1516 working_vector[numx + i + 4 * numx];
1522 for (i = 0; i < jstup; i++)
1531 for (i = 0; i < numx; i++) {
1533 kstup = 2 * kstup * jstup;
1535 if (i % jstup == 0) {
1536 working_vector[2 * numx + kstup + i % jstup] =
1538 working_vector[2 * numx + kstup + i % jstup +
1545 working_vector[2 * numx + kstup + i % jstup +
1548 working_vector[2 * numx + kstup + i % jstup] =
1550 } }
for (i = 0; i < numx; i++) {
1552 kstup = 2 * kstup * jstup;
1553 if (i % jstup == 0) {
1554 working_vector[2 * numx + kstup + jstup] = 0;
1555 working_vector[2 * numx + kstup + jstup + 4 * numx] = 0;
1559 working_vector[2 * numx + kstup + 2 * jstup -
1561 working_vector[2 * numx + kstup + i % jstup];
1562 working_vector[2 * numx + kstup + 2 * jstup -
1563 i % jstup + 4 * numx] =
1564 -working_vector[2 * numx + kstup + i % jstup +
1568 for (i = 0; i < 2 * numx; i++) {
1569 working_vector[i] = working_vector[2 * numx + i];
1570 working_vector[i + 4 * numx] =
1571 working_vector[2 * numx + i + 4 * numx];
1576 for (i = 0; i <
l; i++)
1584 for (i = 0; i < numx; i++) {
1586 kstup = 2 * kstup * jstup;
1588 if (i % jstup == 0) {
1589 working_vector[2 * numx + kstup + jstup + i % jstup] =
1590 working_vector[jstup + kstup / 2 - i % jstup -
1592 working_vector[2 * numx + kstup + jstup + i % jstup +
1599 working_vector[2 * numx + kstup + jstup + i % jstup +
1601 -(
Double_t) working_vector[jstup + kstup / 2 -
1603 working_vector[2 * numx + kstup + jstup + i % jstup] =
1604 (
Double_t) working_vector[jstup + kstup / 2 -
1606 } }
for (i = 0; i < numx; i++) {
1608 kstup = 2 * kstup * jstup;
1609 if (i % jstup == 0) {
1610 working_vector[2 * numx + kstup] = 0;
1611 working_vector[2 * numx + kstup + 4 * numx] = 0;
1615 working_vector[2 * numx + kstup + i % jstup] =
1616 working_vector[2 * numx + kstup + 2 * jstup -
1618 working_vector[2 * numx + kstup + i % jstup +
1620 -working_vector[2 * numx + kstup + 2 * jstup -
1621 i % jstup + 4 * numx];
1624 for (i = 0; i < 2 * numx; i++) {
1625 working_vector[i] = working_vector[2 * numx + i];
1626 working_vector[i + 4 * numx] =
1627 working_vector[2 * numx + i + 4 * numx];
1630 for (i = 0; i <
l; i++)
1634 for (i = 0; i < numx; i++) {
1637 kstup = 2 * kstup * jstup;
1638 val = working_vector[kstup + i % jstup];
1642 val = working_vector[i];
1643 working_matrix[i][j] = val;
1752 Double_t *working_vector =
nullptr, **working_matrix =
nullptr;
1759 for (i = 0; i <
fSizeX; i++)
1771 for (i = 0; i <
fSizeX; i++)
1780 for (i = 0; i <
fSizeX; i++)
1787 for (i = 0; i <
fSizeX; i++) {
1788 for (j = 0; j <
fSizeY; j++) {
1789 working_matrix[i][j] = fSource[i][j];
1794 for (i = 0; i <
fSizeX; i++) {
1795 for (j = 0; j <
fSizeY; j++) {
1796 fDest[i][j] = working_matrix[i][j];
1801 for (i = 0; i <
fSizeX; i++) {
1802 for (j = 0; j <
fSizeY; j++) {
1803 working_matrix[i][j] = fSource[i][j];
1808 for (i = 0; i <
fSizeX; i++) {
1809 for (j = 0; j <
fSizeY; j++) {
1810 fDest[i][j] = working_matrix[i][j];
1815 for (i = 0; i <
fSizeX; i++) {
1816 for (j = 0; j <
fSizeY; j++) {
1817 working_matrix[i][j] = fSource[i][j];
1822 for (i = 0; i <
fSizeX; i++) {
1823 for (j = 0; j <
fSizeY; j++) {
1824 fDest[i][j] = working_matrix[i][j];
1829 for (i = 0; i <
fSizeX; i++) {
1830 for (j = 0; j <
fSizeY; j++) {
1831 working_matrix[i][j] = fSource[i][j];
1836 for (i = 0; i <
fSizeX; i++) {
1837 for (j = 0; j <
fSizeY; j++) {
1838 fDest[i][j] = working_matrix[i][j];
1843 for (i = 0; i <
fSizeX; i++) {
1844 for (j = 0; j <
fSizeY; j++) {
1845 working_matrix[i][j] = fSource[i][j];
1850 for (i = 0; i <
fSizeX; i++) {
1851 for (j = 0; j <
fSizeY; j++) {
1852 fDest[i][j] = working_matrix[i][j];
1855 for (i = 0; i <
fSizeX; i++) {
1856 for (j = 0; j <
fSizeY; j++) {
1862 for (i = 0; i <
fSizeX; i++) {
1863 for (j = 0; j <
fSizeY; j++) {
1864 working_matrix[i][j] = fSource[i][j];
1869 for (i = 0; i <
fSizeX; i++) {
1870 for (j = 0; j <
fSizeY; j++) {
1871 fDest[i][j] = working_matrix[i][j];
1882 for (i = 0; i <
fSizeX; i++) {
1883 for (j = 0; j <
fSizeY; j++) {
1884 working_matrix[i][j] = fSource[i][j];
1889 for (i = 0; i <
fSizeX; i++) {
1890 for (j = 0; j <
fSizeY; j++) {
1891 fDest[i][j] = working_matrix[i][j];
1896 for (i = 0; i <
fSizeX; i++) {
1897 for (j = 0; j <
fSizeY; j++) {
1909 for (i = 0; i <
fSizeX; i++) {
1910 for (j = 0; j <
fSizeY; j++) {
1911 working_matrix[i][j] = fSource[i][j];
1916 for (i = 0; i <
fSizeX; i++) {
1917 for (j = 0; j <
fSizeY; j++) {
1918 fDest[i][j] = working_matrix[i][j];
1923 for (i = 0; i <
fSizeX; i++) {
1924 for (j = 0; j <
fSizeY; j++) {
1925 working_matrix[i][j] = fSource[i][j];
1930 for (i = 0; i <
fSizeX; i++) {
1931 for (j = 0; j <
fSizeY; j++) {
1932 fDest[i][j] = working_matrix[i][j];
1937 for (i = 0; i <
fSizeX; i++) {
1938 for (j = 0; j <
fSizeY; j++) {
1939 working_matrix[i][j] = fSource[i][j];
1944 for (i = 0; i <
fSizeX; i++) {
1945 for (j = 0; j <
fSizeY; j++) {
1946 fDest[i][j] = working_matrix[i][j];
1951 for (i = 0; i <
fSizeX; i++) {
1952 for (j = 0; j <
fSizeY; j++) {
1953 working_matrix[i][j] = fSource[i][j];
1958 for (i = 0; i <
fSizeX; i++) {
1959 for (j = 0; j <
fSizeY; j++) {
1960 fDest[i][j] = working_matrix[i][j];
1965 for (i = 0; i <
fSizeX; i++) {
1966 for (j = 0; j <
fSizeY; j++) {
1967 working_matrix[i][j] = fSource[i][j];
1970 for (i = 0; i <
fSizeX; i++) {
1971 for (j = 0; j <
fSizeY; j++) {
1972 working_matrix[i][j +
fSizeY] = fSource[i][j +
fSizeY];
1977 for (i = 0; i <
fSizeX; i++) {
1978 for (j = 0; j <
fSizeY; j++) {
1979 fDest[i][j] = working_matrix[i][j];
1984 for (i = 0; i <
fSizeX; i++) {
1985 for (j = 0; j <
fSizeY; j++) {
1986 working_matrix[i][j] = fSource[i][j];
1991 for (i = 0; i <
fSizeX; i++) {
1992 for (j = 0; j <
fSizeY; j++) {
1993 fDest[i][j] = working_matrix[i][j];
2004 for (i = 0; i <
fSizeX; i++) {
2005 for (j = 0; j <
fSizeY; j++) {
2006 working_matrix[i][j] = fSource[i][j];
2011 for (i = 0; i <
fSizeX; i++) {
2012 for (j = 0; j <
fSizeY; j++) {
2013 working_matrix[i][j +
fSizeY] = fSource[i][j +
fSizeY];
2019 for (i = 0; i <
fSizeX; i++) {
2020 for (j = 0; j <
fSizeY; j++) {
2021 fDest[i][j] = working_matrix[i][j];
2027 for (i = 0; i <
fSizeX; i++) {
2028 if (working_matrix)
delete[]working_matrix[i];
2030 delete[]working_matrix;
2031 delete[]working_vector;
2113 Double_t *working_vector =
nullptr, **working_matrix =
nullptr;
2120 for (i = 0; i <
fSizeX; i++)
2132 for (i = 0; i <
fSizeX; i++)
2141 for (i = 0; i <
fSizeX; i++)
2147 for (i = 0; i <
fSizeX; i++) {
2148 for (j = 0; j <
fSizeY; j++) {
2149 working_matrix[i][j] = fSource[i][j];
2150 old_area = old_area + fSource[i][j];
2157 for (i = 0; i <
fSizeX; i++) {
2158 for (j = 0; j <
fSizeY; j++) {
2159 working_matrix[i][j] = fSource[i][j];
2160 old_area = old_area + fSource[i][j];
2167 for (i = 0; i <
fSizeX; i++) {
2168 for (j = 0; j <
fSizeY; j++) {
2169 working_matrix[i][j] = fSource[i][j];
2170 old_area = old_area + fSource[i][j];
2177 for (i = 0; i <
fSizeX; i++) {
2178 for (j = 0; j <
fSizeY; j++) {
2179 working_matrix[i][j] = fSource[i][j];
2180 old_area = old_area + fSource[i][j];
2187 for (i = 0; i <
fSizeX; i++) {
2188 for (j = 0; j <
fSizeY; j++) {
2189 working_matrix[i][j] = fSource[i][j];
2190 old_area = old_area + fSource[i][j];
2197 for (i = 0; i <
fSizeX; i++) {
2198 for (j = 0; j <
fSizeY; j++) {
2199 working_matrix[i][j] = fSource[i][j];
2200 old_area = old_area + fSource[i][j];
2213 for (i = 0; i <
fSizeX; i++) {
2214 for (j = 0; j <
fSizeY; j++) {
2215 working_matrix[i][j] = fSource[i][j];
2216 old_area = old_area + fSource[i][j];
2223 for (i = 0; i <
fSizeX; i++) {
2224 for (j = 0; j <
fSizeY; j++) {
2226 if (working_matrix) working_matrix[i][j] =
fFilterCoeff;
2231 for (i = 0; i <
fSizeX; i++) {
2232 for (j = 0; j <
fSizeY; j++) {
2242 for (i = 0; i <
fSizeX; i++) {
2243 for (j = 0; j <
fSizeY; j++) {
2244 new_area = new_area + working_matrix[i][j];
2247 if (new_area != 0) {
2248 a = old_area / new_area;
2249 for (i = 0; i <
fSizeX; i++) {
2250 for (j = 0; j <
fSizeY; j++) {
2251 fDest[i][j] = working_matrix[i][j] *
a;
2259 for (i = 0; i <
fSizeX; i++) {
2260 for (j = 0; j <
fSizeY; j++) {
2261 new_area = new_area + working_matrix[i][j];
2264 if (new_area != 0) {
2265 a = old_area / new_area;
2266 for (i = 0; i <
fSizeX; i++) {
2267 for (j = 0; j <
fSizeY; j++) {
2268 fDest[i][j] = working_matrix[i][j] *
a;
2276 for (i = 0; i <
fSizeX; i++) {
2277 for (j = 0; j <
fSizeY; j++) {
2278 new_area = new_area + working_matrix[i][j];
2281 if (new_area != 0) {
2282 a = old_area / new_area;
2283 for (i = 0; i <
fSizeX; i++) {
2284 for (j = 0; j <
fSizeY; j++) {
2285 fDest[i][j] = working_matrix[i][j] *
a;
2293 for (i = 0; i <
fSizeX; i++) {
2294 for (j = 0; j <
fSizeY; j++) {
2295 new_area = new_area + working_matrix[i][j];
2298 if (new_area != 0) {
2299 a = old_area / new_area;
2300 for (i = 0; i <
fSizeX; i++) {
2301 for (j = 0; j <
fSizeY; j++) {
2302 fDest[i][j] = working_matrix[i][j] *
a;
2310 for (i = 0; i <
fSizeX; i++) {
2311 for (j = 0; j <
fSizeY; j++) {
2312 new_area = new_area + working_matrix[i][j];
2315 if (new_area != 0) {
2316 a = old_area / new_area;
2317 for (i = 0; i <
fSizeX; i++) {
2318 for (j = 0; j <
fSizeY; j++) {
2319 fDest[i][j] = working_matrix[i][j] *
a;
2327 for (i = 0; i <
fSizeX; i++) {
2328 for (j = 0; j <
fSizeY; j++) {
2329 new_area = new_area + working_matrix[i][j];
2332 if (new_area != 0) {
2333 a = old_area / new_area;
2334 for (i = 0; i <
fSizeX; i++) {
2335 for (j = 0; j <
fSizeY; j++) {
2336 fDest[i][j] = working_matrix[i][j] *
a;
2350 for (i = 0; i <
fSizeX; i++) {
2351 for (j = 0; j <
fSizeY; j++) {
2352 new_area = new_area + working_matrix[i][j];
2355 if (new_area != 0) {
2356 a = old_area / new_area;
2357 for (i = 0; i <
fSizeX; i++) {
2358 for (j = 0; j <
fSizeY; j++) {
2359 fDest[i][j] = working_matrix[i][j] *
a;
2365 for (i = 0; i <
fSizeX; i++) {
2366 if (working_matrix)
delete[]working_matrix[i];
2368 delete[]working_matrix;
2369 delete[]working_vector;
2444 Double_t *working_vector =
nullptr, **working_matrix =
nullptr;
2451 for (i = 0; i <
fSizeX; i++)
2463 for (i = 0; i <
fSizeX; i++)
2472 for (i = 0; i <
fSizeX; i++)
2478 for (i = 0; i <
fSizeX; i++) {
2479 for (j = 0; j <
fSizeY; j++) {
2480 working_matrix[i][j] = fSource[i][j];
2481 old_area = old_area + fSource[i][j];
2488 for (i = 0; i <
fSizeX; i++) {
2489 for (j = 0; j <
fSizeY; j++) {
2490 working_matrix[i][j] = fSource[i][j];
2491 old_area = old_area + fSource[i][j];
2498 for (i = 0; i <
fSizeX; i++) {
2499 for (j = 0; j <
fSizeY; j++) {
2500 working_matrix[i][j] = fSource[i][j];
2501 old_area = old_area + fSource[i][j];
2508 for (i = 0; i <
fSizeX; i++) {
2509 for (j = 0; j <
fSizeY; j++) {
2510 working_matrix[i][j] = fSource[i][j];
2511 old_area = old_area + fSource[i][j];
2518 for (i = 0; i <
fSizeX; i++) {
2519 for (j = 0; j <
fSizeY; j++) {
2520 working_matrix[i][j] = fSource[i][j];
2521 old_area = old_area + fSource[i][j];
2528 for (i = 0; i <
fSizeX; i++) {
2529 for (j = 0; j <
fSizeY; j++) {
2530 working_matrix[i][j] = fSource[i][j];
2531 old_area = old_area + fSource[i][j];
2544 for (i = 0; i <
fSizeX; i++) {
2545 for (j = 0; j <
fSizeY; j++) {
2546 working_matrix[i][j] = fSource[i][j];
2547 old_area = old_area + fSource[i][j];
2554 for (i = 0; i <
fSizeX; i++) {
2555 for (j = 0; j <
fSizeY; j++) {
2562 for (i = 0; i <
fSizeX; i++) {
2563 for (j = 0; j <
fSizeY; j++) {
2573 for (i = 0; i <
fSizeX; i++) {
2574 for (j = 0; j <
fSizeY; j++) {
2575 new_area = new_area + working_matrix[i][j];
2578 if (new_area != 0) {
2579 a = old_area / new_area;
2580 for (i = 0; i <
fSizeX; i++) {
2581 for (j = 0; j <
fSizeY; j++) {
2582 fDest[i][j] = working_matrix[i][j] *
a;
2590 for (i = 0; i <
fSizeX; i++) {
2591 for (j = 0; j <
fSizeY; j++) {
2592 new_area = new_area + working_matrix[i][j];
2595 if (new_area != 0) {
2596 a = old_area / new_area;
2597 for (i = 0; i <
fSizeX; i++) {
2598 for (j = 0; j <
fSizeY; j++) {
2599 fDest[i][j] = working_matrix[i][j] *
a;
2607 for (i = 0; i <
fSizeX; i++) {
2608 for (j = 0; j <
fSizeY; j++) {
2609 new_area = new_area + working_matrix[i][j];
2612 if (new_area != 0) {
2613 a = old_area / new_area;
2614 for (i = 0; i <
fSizeX; i++) {
2615 for (j = 0; j <
fSizeY; j++) {
2616 fDest[i][j] = working_matrix[i][j] *
a;
2624 for (i = 0; i <
fSizeX; i++) {
2625 for (j = 0; j <
fSizeY; j++) {
2626 new_area = new_area + working_matrix[i][j];
2629 if (new_area != 0) {
2630 a = old_area / new_area;
2631 for (i = 0; i <
fSizeX; i++) {
2632 for (j = 0; j <
fSizeY; j++) {
2633 fDest[i][j] = working_matrix[i][j] *
a;
2641 for (i = 0; i <
fSizeX; i++) {
2642 for (j = 0; j <
fSizeY; j++) {
2643 new_area = new_area + working_matrix[i][j];
2646 if (new_area != 0) {
2647 a = old_area / new_area;
2648 for (i = 0; i <
fSizeX; i++) {
2649 for (j = 0; j <
fSizeY; j++) {
2650 fDest[i][j] = working_matrix[i][j] *
a;
2658 for (i = 0; i <
fSizeX; i++) {
2659 for (j = 0; j <
fSizeY; j++) {
2660 new_area = new_area + working_matrix[i][j];
2663 if (new_area != 0) {
2664 a = old_area / new_area;
2665 for (i = 0; i <
fSizeX; i++) {
2666 for (j = 0; j <
fSizeY; j++) {
2667 fDest[i][j] = working_matrix[i][j] *
a;
2681 for (i = 0; i <
fSizeX; i++) {
2682 for (j = 0; j <
fSizeY; j++) {
2683 new_area = new_area + working_matrix[i][j];
2686 if (new_area != 0) {
2687 a = old_area / new_area;
2688 for (i = 0; i <
fSizeX; i++) {
2689 for (j = 0; j <
fSizeY; j++) {
2690 fDest[i][j] = working_matrix[i][j] *
a;
2696 for (i = 0; i <
fSizeX; i++) {
2697 if (working_matrix)
delete[]working_matrix[i];
2699 delete[]working_matrix;
2700 delete[]working_vector;
2725 Error (
"TSpectrumTransform",
"Invalid type of transform");
2729 if (degree > j1 || degree > j2 || degree < 1){
2730 Error (
"TSpectrumTransform",
"Invalid degree of mixed transform");
2745 Error(
"TSpectrumTransform",
"Wrong range");
2749 Error(
"TSpectrumTransform",
"Wrong range");
2765 Error(
"TSpectrumTransform",
"Wrong direction");
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.