60 if (sizeX <= 0 || sizeY <= 0){
61 Error (
"TSpectrumTransform",
"Invalid length, must be > than 0");
71 Error (
"TSpectrumTransform",
"Invalid length, must be power of 2");
81 Error (
"TSpectrumTransform",
"Invalid length, must be power of 2");
113 Int_t i, ii, li, l2, l3, j, jj, jj1, lj, iter,
m, jmin, jmax;
116 for (i = 0; i < num; i++)
117 working_space[i + num] = 0;
125 for (m = 1; m <= iter; m++) {
128 for (i = 0; i < (2 * l2); i++) {
129 working_space[num + i] = working_space[i];
131 for (j = 0; j < l2; j++) {
134 val = working_space[jj + num] + working_space[jj + 1 + num];
135 working_space[j] = val;
136 val = working_space[jj + num] - working_space[jj + 1 + num];
137 working_space[l3] = val;
141 val = working_space[0];
143 working_space[0] = val;
144 val = working_space[1];
146 working_space[1] = val;
147 for (ii = 2; ii <= iter; ii++) {
152 for (j = jmin; j <= jmax; j++) {
153 val = working_space[j];
157 working_space[j] = val;
161 for (m = 1; m <= iter; m++) {
166 for (i = 0; i < (2 * li); i++) {
167 working_space[i + num] = working_space[i];
169 for (j = 0; j < li; j++) {
171 jj = 2 * (j + 1) - 1;
173 val = working_space[j + num] - working_space[lj + num];
174 working_space[jj] = val;
175 val = working_space[j + num] + working_space[lj + num];
176 working_space[jj1] = val;
192 Int_t i,
m, nump = 1, mnum, mnum2, mp, ib, mp2, mnum21, iba, iter;
195 for (i = 0; i < num; i++)
196 working_space[i + num] = 0;
203 for (m = 1; m <= iter; m++) {
211 for (mp = 0; mp < nump; mp++) {
213 for (mp2 = 0; mp2 < mnum2; mp2++) {
214 mnum21 = mnum2 + mp2 + ib;
216 val1 = working_space[iba];
217 val2 = working_space[mnum21];
218 working_space[iba + num] = val1 + val2;
219 working_space[mnum21 + num] = val1 - val2;
222 for (i = 0; i < num; i++) {
223 working_space[i] = working_space[i + num];
229 for (i = 0; i < num; i++) {
230 val1 = working_space[i];
232 working_space[i] = val1;
247 Int_t i, ib, il, ibd, ip, ifac, i1;
248 for (i = 0; i < num; i++) {
249 working_space[i + num] = working_space[i];
251 for (i = 1; i <= num; i++) {
265 for (i1 = 1; i1 <= il; i1++) {
267 ip = ip + ifac * ipower[i1 - 1];
269 working_space[ip - 1] = working_space[i - 1 + num];
286 Int_t nxp2, nxp, i, j, k,
m, iter, mxp, j1, j2, n1, n2, it;
287 Double_t a,
b, c, d, sign, wpwr, arg, wr, wi, tr, ti,
pi =
288 3.14159265358979323846;
291 for (i = 0; i < num; i++)
292 working_space[i + num] = 0;
304 for (it = 1; it <= iter; it++) {
309 for (m = 1; m <= nxp2; m++) {
314 for (mxp = nxp; mxp <= num; mxp += nxp) {
317 val1 = working_space[j1 - 1];
318 val2 = working_space[j2 - 1];
319 val3 = working_space[j1 - 1 + num];
320 val4 = working_space[j2 - 1 + num];
329 working_space[j1 - 1] = val1;
332 working_space[j1 - 1 + num] = val1;
333 a = tr * wr - ti * wi;
335 working_space[j2 - 1] = val1;
336 a = ti * wr + tr * wi;
338 working_space[j2 - 1 + num] = val1;
345 for (i = 1; i <= n1; i++) {
348 val1 = working_space[j - 1];
349 val2 = working_space[j - 1 + num];
350 val3 = working_space[i - 1];
351 working_space[j - 1] = val3;
352 working_space[j - 1 + num] = working_space[i - 1 + num];
353 working_space[i - 1] = val1;
354 working_space[i - 1 + num] = val2;
356 lab60:
if (k >= j)
goto lab65;
364 for (i = 0; i < num; i++) {
366 val1 = working_space[i];
370 working_space[i] = val1;
371 b = working_space[i + num];
373 working_space[i + num] =
b;
377 b = working_space[i];
378 c = working_space[i + num];
380 working_space[i] =
b;
381 working_space[i + num] = 0;
385 for (i = 1; i < num; i++)
386 working_space[num - i + num] = working_space[i];
387 working_space[0 + num] = working_space[0];
388 for (i = 0; i < num; i++) {
389 working_space[i] = working_space[i + num];
390 working_space[i + num] = 0;
409 Int_t i, ib, il, ibd, ip, ifac, i1;
410 for (i = 0; i < num; i++) {
411 working_space[i + shift + start] = working_space[i + start];
412 working_space[i + shift + start + 2 * shift] =
413 working_space[i + start + 2 * shift];
415 for (i = 1; i <= num; i++) {
429 for (i1 = 1; i1 <= il; i1++) {
431 ip = ip + ifac * ipower[i1 - 1];
433 working_space[ip - 1 + start] =
434 working_space[i - 1 + shift + start];
435 working_space[ip - 1 + start + 2 * shift] =
436 working_space[i - 1 + shift + start + 2 * shift];
454 Int_t i, j, k,
m, nump, mnum, mnum2, mp, ib, mp2, mnum21, iba, iter,
455 mp2step, mppom, ring;
456 Double_t a,
b, c, d, wpwr, arg, wr, wi, tr, ti,
pi =
457 3.14159265358979323846;
458 Double_t val1, val2, val3, val4, a0oldr = 0, b0oldr = 0, a0r, b0r;
460 for (i = 0; i < num; i++)
461 working_space[i + 2 * num] = 0;
474 for (i = 0; i < iter -
degree; i++)
476 for (m = 1; m <= iter; m++) {
488 for (mp = 0; mp < nump; mp++) {
491 mppom = mppom % ring;
495 for (i = 0; i < (iter - 1); i++) {
496 if ((mppom & j) != 0)
511 for (mp2 = 0; mp2 < mnum2; mp2++) {
512 mnum21 = mnum2 + mp2 + ib;
514 if (mp2 % mp2step == 0) {
525 val1 = working_space[iba];
526 val2 = working_space[mnum21];
527 val3 = working_space[iba + 2 * num];
528 val4 = working_space[mnum21 + 2 * num];
533 tr = a * a0r + b * b0r;
535 working_space[num + iba] = val1;
536 ti = c * a0r + d * b0r;
538 working_space[num + iba + 2 * num] = val1;
540 a * b0r * wr - c * b0r * wi - b * a0r * wr + d * a0r * wi;
542 working_space[num + mnum21] = val1;
544 c * b0r * wr + a * b0r * wi - d * a0r * wr - b * a0r * wi;
546 working_space[num + mnum21 + 2 * num] = val1;
549 for (i = 0; i < num; i++) {
550 val1 = working_space[num + i];
551 working_space[i] = val1;
552 val1 = working_space[num + i + 2 * num];
553 working_space[i + 2 * num] = val1;
572 1, mnum, mnum2, mp, ib, mp2, mnum21, iba, iter, mp2step, mppom,
574 Double_t a,
b, c, d, wpwr, arg, wr, wi, tr, ti,
pi =
575 3.14159265358979323846;
576 Double_t val1, val2, val3, val4, a0oldr = 0, b0oldr = 0, a0r, b0r;
588 for (i = 0; i < iter -
degree; i++)
592 for (m = 1; m <= iter; m++) {
600 if (m > iter - degree + 1)
602 for (mp = nump - 1; mp >= 0; mp--) {
605 mppom = mppom % ring;
609 for (i = 0; i < (iter - 1); i++) {
610 if ((mppom & j) != 0)
625 for (mp2 = 0; mp2 < mnum2; mp2++) {
626 mnum21 = mnum2 + mp2 + ib;
628 if (mp2 % mp2step == 0) {
639 val1 = working_space[iba];
640 val2 = working_space[mnum21];
641 val3 = working_space[iba + 2 * num];
642 val4 = working_space[mnum21 + 2 * num];
647 tr = a * a0r + b * wr * b0r + d * wi * b0r;
649 working_space[num + iba] = val1;
650 ti = c * a0r + d * wr * b0r - b * wi * b0r;
652 working_space[num + iba + 2 * num] = val1;
653 tr = a * b0r - b * wr * a0r - d * wi * a0r;
655 working_space[num + mnum21] = val1;
656 ti = c * b0r - d * wr * a0r + b * wi * a0r;
658 working_space[num + mnum21 + 2 * num] = val1;
661 if (m <= iter - degree
667 for (i = 0; i < num; i++) {
668 val1 = working_space[num + i];
669 working_space[i] = val1;
670 val1 = working_space[num + i + 2 * num];
671 working_space[i + 2 * num] = val1;
693 for (j = 0; j < numy; j++) {
694 for (i = 0; i < numx; i++) {
695 working_vector[i] = working_matrix[i][j];
702 Walsh(working_vector, numx);
706 for (i = 0; i < numx; i++) {
707 working_matrix[i][j] = working_vector[i];
710 for (i = 0; i < numx; i++) {
711 for (j = 0; j < numy; j++) {
712 working_vector[j] = working_matrix[i][j];
719 Walsh(working_vector, numy);
723 for (j = 0; j < numy; j++) {
724 working_matrix[i][j] = working_vector[j];
730 for (i = 0; i < numx; i++) {
731 for (j = 0; j < numy; j++) {
732 working_vector[j] = working_matrix[i][j];
740 Walsh(working_vector, numy);
743 for (j = 0; j < numy; j++) {
744 working_matrix[i][j] = working_vector[j];
747 for (j = 0; j < numy; j++) {
748 for (i = 0; i < numx; i++) {
749 working_vector[i] = working_matrix[i][j];
757 Walsh(working_vector, numx);
760 for (i = 0; i < numx; i++) {
761 working_matrix[i][j] = working_vector[i];
781 Int_t i, j, iterx, itery,
n, size;
811 for (j = 0; j < numy; j++) {
812 for (i = 0; i < numx; i++) {
813 working_vector[i] = working_matrix[i][j];
817 for (i = 1; i <= numx; i++) {
818 working_vector[2 * numx - i] = working_vector[i - 1];
821 for (i = 0; i < numx; i++) {
823 working_vector[i] /
TMath::Cos(pi * i / (2 * numx));
825 working_vector[0] = working_vector[0] /
TMath::Sqrt(2.);
828 for (i = 1; i <= numx; i++) {
829 working_vector[2 * numx - i] = -working_vector[i - 1];
832 for (i = 1; i < numx; i++) {
833 working_vector[i - 1] =
834 working_vector[i] /
TMath::Sin(pi * i / (2 * numx));
836 working_vector[numx - 1] =
846 for (i = 0; i < numx; i++) {
847 working_matrix[i][j] = working_vector[i];
849 working_matrix[i][j + numy] = working_vector[i + numx];
852 working_matrix[i][j + numy] = working_vector[i + 2 * numx];
855 for (i = 0; i < numx; i++) {
856 for (j = 0; j < numy; j++) {
857 working_vector[j] = working_matrix[i][j];
859 working_vector[j + numy] = working_matrix[i][j + numy];
862 working_vector[j + 2 * numy] = working_matrix[i][j + numy];
866 for (j = 1; j <= numy; j++) {
867 working_vector[2 * numy - j] = working_vector[j - 1];
870 for (j = 0; j < numy; j++) {
872 working_vector[j] /
TMath::Cos(pi * j / (2 * numy));
873 working_vector[j + 2 * numy] = 0;
875 working_vector[0] = working_vector[0] /
TMath::Sqrt(2.);
878 for (j = 1; j <= numy; j++) {
879 working_vector[2 * numy - j] = -working_vector[j - 1];
882 for (j = 1; j < numy; j++) {
883 working_vector[j - 1] =
884 working_vector[j] /
TMath::Sin(pi * j / (2 * numy));
885 working_vector[j + numy] = 0;
887 working_vector[numy - 1] =
889 working_vector[numy] = 0;
898 for (j = 0; j < numy; j++) {
899 working_matrix[i][j] = working_vector[j];
901 working_matrix[i][j + numy] = working_vector[j + numy];
904 working_matrix[i][j + numy] = working_vector[j + 2 * numy];
910 for (i = 0; i < numx; i++) {
911 for (j = 0; j < numy; j++) {
912 working_vector[j] = working_matrix[i][j];
914 working_vector[j + numy] = working_matrix[i][j + numy];
917 working_vector[j + 2 * numy] = working_matrix[i][j + numy];
921 working_vector[0] = working_vector[0] *
TMath::Sqrt(2.);
922 for (j = 0; j < numy; j++) {
923 working_vector[j + 2 * numy] =
924 working_vector[j] *
TMath::Sin(pi * j / (2 * numy));
926 working_vector[j] *
TMath::Cos(pi * j / (2 * numy));
928 for (j = 1; j < numy; j++) {
929 working_vector[2 * numy - j] = working_vector[j];
930 working_vector[2 * numy - j + 2 * numy] =
931 -working_vector[j + 2 * numy];
933 working_vector[numy] = 0;
934 working_vector[numy + 2 * numy] = 0;
938 working_vector[numy] =
940 for (j = numy - 1; j > 0; j--) {
941 working_vector[j + 2 * numy] =
945 working_vector[j - 1] *
TMath::Sin(pi * j / (2 * numy));
947 for (j = 1; j < numy; j++) {
948 working_vector[2 * numy - j] = working_vector[j];
949 working_vector[2 * numy - j + 2 * numy] =
950 -working_vector[j + 2 * numy];
952 working_vector[0] = 0;
953 working_vector[0 + 2 * numy] = 0;
954 working_vector[numy + 2 * numy] = 0;
964 for (j = 0; j < numy; j++) {
965 working_matrix[i][j] = working_vector[j];
967 working_matrix[i][j + numy] = working_vector[j + numy];
970 working_matrix[i][j + numy] = working_vector[j + 2 * numy];
973 for (j = 0; j < numy; j++) {
974 for (i = 0; i < numx; i++) {
975 working_vector[i] = working_matrix[i][j];
977 working_vector[i + numx] = working_matrix[i][j + numy];
980 working_vector[i + 2 * numx] = working_matrix[i][j + numy];
984 working_vector[0] = working_vector[0] *
TMath::Sqrt(2.);
985 for (i = 0; i < numx; i++) {
986 working_vector[i + 2 * numx] =
987 working_vector[i] *
TMath::Sin(pi * i / (2 * numx));
989 working_vector[i] *
TMath::Cos(pi * i / (2 * numx));
991 for (i = 1; i < numx; i++) {
992 working_vector[2 * numx - i] = working_vector[i];
993 working_vector[2 * numx - i + 2 * numx] =
994 -working_vector[i + 2 * numx];
996 working_vector[numx] = 0;
997 working_vector[numx + 2 * numx] = 0;
1001 working_vector[numx] =
1003 for (i = numx - 1; i > 0; i--) {
1004 working_vector[i + 2 * numx] =
1008 working_vector[i - 1] *
TMath::Sin(pi * i / (2 * numx));
1010 for (i = 1; i < numx; i++) {
1011 working_vector[2 * numx - i] = working_vector[i];
1012 working_vector[2 * numx - i + 2 * numx] =
1013 -working_vector[i + 2 * numx];
1015 working_vector[0] = 0;
1016 working_vector[0 + 2 * numx] = 0;
1017 working_vector[numx + 2 * numx] = 0;
1027 for (i = 0; i < numx; i++) {
1028 working_matrix[i][j] = working_vector[i];
1050 Int_t i, j, jstup, kstup,
l,
m;
1054 for (j = 0; j < numy; j++) {
1056 jstup = numx / kstup;
1057 for (i = 0; i < numx; i++) {
1058 val = working_matrix[i][j];
1063 kstup = 2 * kstup * jstup;
1064 working_vector[kstup + i % jstup] = val;
1065 working_vector[kstup + 2 * jstup - 1 - i % jstup] = val;
1072 kstup = 2 * kstup * jstup;
1073 working_vector[kstup + i % jstup] = val;
1074 working_vector[kstup + 2 * jstup - 1 - i % jstup] = -val;
1078 working_vector[i] = val;
1084 GeneralExe(working_vector, 0, numx, degree, type);
1085 for (i = 0; i < jstup; i++)
1092 for (i = 0; i <
l; i++)
1094 GeneralExe(working_vector, 0, 2 * numx, degree, type);
1095 for (i = 0; i < numx; i++) {
1097 kstup = 2 * kstup * jstup;
1100 b = working_vector[kstup + i % jstup];
1106 working_vector[i] =
a;
1107 working_vector[i + 4 * numx] = 0;
1114 for (i = 0; i <
l; i++)
1116 GeneralExe(working_vector, 0, 2 * numx, degree, type);
1117 for (i = 0; i < numx; i++) {
1119 kstup = 2 * kstup * jstup;
1122 b = working_vector[jstup + kstup + i % jstup];
1128 working_vector[jstup + kstup / 2 - i % jstup - 1] =
a;
1129 working_vector[i + 4 * numx] = 0;
1138 jstup = numx / kstup;
1139 for (i = 0, l = 0; i < numx; i++, l = (l + kstup) % numx) {
1140 working_vector[numx + i] = working_vector[l + i / jstup];
1144 working_vector[numx + i + 2 * numx] =
1145 working_vector[l + i / jstup + 2 * numx];
1148 working_vector[numx + i + 4 * numx] =
1149 working_vector[l + i / jstup + 4 * numx];
1151 for (i = 0; i < numx; i++) {
1152 working_vector[i] = working_vector[numx + i];
1156 working_vector[i + 2 * numx] =
1157 working_vector[numx + i + 2 * numx];
1160 working_vector[i + 4 * numx] =
1161 working_vector[numx + i + 4 * numx];
1163 for (i = 0; i < numx; i++) {
1164 working_matrix[i][j] = working_vector[i];
1168 working_matrix[i][j + numy] = working_vector[i + 2 * numx];
1171 working_matrix[i][j + numy] = working_vector[i + 4 * numx];
1174 for (i = 0; i < numx; i++) {
1176 jstup = numy / kstup;
1177 for (j = 0; j < numy; j++) {
1178 valx = working_matrix[i][j];
1179 valz = working_matrix[i][j + numy];
1184 kstup = 2 * kstup * jstup;
1185 working_vector[kstup + j % jstup] = valx;
1186 working_vector[kstup + 2 * jstup - 1 - j % jstup] = valx;
1187 working_vector[kstup + j % jstup + 4 * numy] = valz;
1188 working_vector[kstup + 2 * jstup - 1 - j % jstup +
1196 kstup = 2 * kstup * jstup;
1197 working_vector[kstup + j % jstup] = valx;
1198 working_vector[kstup + 2 * jstup - 1 - j % jstup] = -valx;
1199 working_vector[kstup + j % jstup + 4 * numy] = valz;
1200 working_vector[kstup + 2 * jstup - 1 - j % jstup +
1205 working_vector[j] = valx;
1206 working_vector[j + 2 * numy] = valz;
1213 GeneralExe(working_vector, 1, numy, degree, type);
1214 for (j = 0; j < jstup; j++)
1221 for (j = 0; j <
l; j++)
1223 GeneralExe(working_vector, 1, 2 * numy, degree, type);
1224 for (j = 0; j < numy; j++) {
1226 kstup = 2 * kstup * jstup;
1229 b = working_vector[kstup + j % jstup];
1235 working_vector[j] =
a;
1236 working_vector[j + 4 * numy] = 0;
1243 for (j = 0; j <
l; j++)
1245 GeneralExe(working_vector, 1, 2 * numy, degree, type);
1246 for (j = 0; j < numy; j++) {
1248 kstup = 2 * kstup * jstup;
1251 b = working_vector[jstup + kstup + j % jstup];
1257 working_vector[jstup + kstup / 2 - j % jstup - 1] =
a;
1258 working_vector[j + 4 * numy] = 0;
1267 jstup = numy / kstup;
1268 for (j = 0, l = 0; j < numy; j++, l = (l + kstup) % numy) {
1269 working_vector[numy + j] = working_vector[l + j / jstup];
1273 working_vector[numy + j + 2 * numy] =
1274 working_vector[l + j / jstup + 2 * numy];
1277 working_vector[numy + j + 4 * numy] =
1278 working_vector[l + j / jstup + 4 * numy];
1280 for (j = 0; j < numy; j++) {
1281 working_vector[j] = working_vector[numy + j];
1285 working_vector[j + 2 * numy] =
1286 working_vector[numy + j + 2 * numy];
1289 working_vector[j + 4 * numy] =
1290 working_vector[numy + j + 4 * numy];
1292 for (j = 0; j < numy; j++) {
1293 working_matrix[i][j] = working_vector[j];
1297 working_matrix[i][j + numy] = working_vector[j + 2 * numy];
1300 working_matrix[i][j + numy] = working_vector[j + 4 * numy];
1306 for (i = 0; i < numx; i++) {
1308 jstup = numy / kstup;
1309 for (j = 0; j < numy; j++) {
1310 working_vector[j] = working_matrix[i][j];
1314 working_vector[j + 2 * numy] = working_matrix[i][j + numy];
1317 working_vector[j + 4 * numy] = working_matrix[i][j + numy];
1324 jstup = numy / kstup;
1325 for (j = 0, l = 0; j < numy; j++, l = (l + kstup) % numy) {
1326 working_vector[numy + l + j / jstup] = working_vector[j];
1330 working_vector[numy + l + j / jstup + 2 * numy] =
1331 working_vector[j + 2 * numy];
1334 working_vector[numy + l + j / jstup + 4 * numy] =
1335 working_vector[j + 4 * numy];
1337 for (j = 0; j < numy; j++) {
1338 working_vector[j] = working_vector[numy + j];
1342 working_vector[j + 2 * numy] =
1343 working_vector[numy + j + 2 * numy];
1346 working_vector[j + 4 * numy] =
1347 working_vector[numy + j + 4 * numy];
1353 for (j = 0; j < jstup; j++)
1355 GeneralInv(working_vector, numy, degree, type);
1362 for (j = 0; j < numy; j++) {
1364 kstup = 2 * kstup * jstup;
1366 if (j % jstup == 0) {
1367 working_vector[2 * numy + kstup + j % jstup] =
1369 working_vector[2 * numy + kstup + j % jstup +
1376 working_vector[2 * numy + kstup + j % jstup +
1379 working_vector[2 * numy + kstup + j % jstup] =
1381 } }
for (j = 0; j < numy; j++) {
1383 kstup = 2 * kstup * jstup;
1384 if (j % jstup == 0) {
1385 working_vector[2 * numy + kstup + jstup] = 0;
1386 working_vector[2 * numy + kstup + jstup + 4 * numy] = 0;
1390 working_vector[2 * numy + kstup + 2 * jstup -
1392 working_vector[2 * numy + kstup + j % jstup];
1393 working_vector[2 * numy + kstup + 2 * jstup -
1394 j % jstup + 4 * numy] =
1395 -working_vector[2 * numy + kstup + j % jstup +
1399 for (j = 0; j < 2 * numy; j++) {
1400 working_vector[j] = working_vector[2 * numy + j];
1401 working_vector[j + 4 * numy] =
1402 working_vector[2 * numy + j + 4 * numy];
1404 GeneralInv(working_vector, 2 * numy, degree, type);
1407 for (j = 0; j <
l; j++)
1415 for (j = 0; j < numy; j++) {
1417 kstup = 2 * kstup * jstup;
1419 if (j % jstup == 0) {
1420 working_vector[2 * numy + kstup + jstup + j % jstup] =
1421 working_vector[jstup + kstup / 2 - j % jstup -
1423 working_vector[2 * numy + kstup + jstup + j % jstup +
1430 working_vector[2 * numy + kstup + jstup + j % jstup +
1432 -(
Double_t) working_vector[jstup + kstup / 2 -
1434 working_vector[2 * numy + kstup + jstup + j % jstup] =
1435 (
Double_t) working_vector[jstup + kstup / 2 -
1437 } }
for (j = 0; j < numy; j++) {
1439 kstup = 2 * kstup * jstup;
1440 if (j % jstup == 0) {
1441 working_vector[2 * numy + kstup] = 0;
1442 working_vector[2 * numy + kstup + 4 * numy] = 0;
1446 working_vector[2 * numy + kstup + j % jstup] =
1447 working_vector[2 * numy + kstup + 2 * jstup -
1449 working_vector[2 * numy + kstup + j % jstup +
1451 -working_vector[2 * numy + kstup + 2 * jstup -
1452 j % jstup + 4 * numy];
1455 for (j = 0; j < 2 * numy; j++) {
1456 working_vector[j] = working_vector[2 * numy + j];
1457 working_vector[j + 4 * numy] =
1458 working_vector[2 * numy + j + 4 * numy];
1460 GeneralInv(working_vector, 2 * numy, degree, type);
1461 for (j = 0; j <
l; j++)
1465 for (j = 0; j < numy; j++) {
1468 kstup = 2 * kstup * jstup;
1469 valx = working_vector[kstup + j % jstup];
1470 valz = working_vector[kstup + j % jstup + 4 * numy];
1474 valx = working_vector[j];
1475 valz = working_vector[j + 2 * numy];
1477 working_matrix[i][j] = valx;
1478 working_matrix[i][j + numy] = valz;
1481 for (j = 0; j < numy; j++) {
1483 jstup = numy / kstup;
1484 for (i = 0; i < numx; i++) {
1485 working_vector[i] = working_matrix[i][j];
1489 working_vector[i + 2 * numx] = working_matrix[i][j + numy];
1492 working_vector[i + 4 * numx] = working_matrix[i][j + numy];
1499 jstup = numx / kstup;
1500 for (i = 0, l = 0; i < numx; i++, l = (l + kstup) % numx) {
1501 working_vector[numx + l + i / jstup] = working_vector[i];
1505 working_vector[numx + l + i / jstup + 2 * numx] =
1506 working_vector[i + 2 * numx];
1509 working_vector[numx + l + i / jstup + 4 * numx] =
1510 working_vector[i + 4 * numx];
1512 for (i = 0; i < numx; i++) {
1513 working_vector[i] = working_vector[numx + i];
1517 working_vector[i + 2 * numx] =
1518 working_vector[numx + i + 2 * numx];
1521 working_vector[i + 4 * numx] =
1522 working_vector[numx + i + 4 * numx];
1528 for (i = 0; i < jstup; i++)
1530 GeneralInv(working_vector, numx, degree, type);
1537 for (i = 0; i < numx; i++) {
1539 kstup = 2 * kstup * jstup;
1541 if (i % jstup == 0) {
1542 working_vector[2 * numx + kstup + i % jstup] =
1544 working_vector[2 * numx + kstup + i % jstup +
1551 working_vector[2 * numx + kstup + i % jstup +
1554 working_vector[2 * numx + kstup + i % jstup] =
1556 } }
for (i = 0; i < numx; i++) {
1558 kstup = 2 * kstup * jstup;
1559 if (i % jstup == 0) {
1560 working_vector[2 * numx + kstup + jstup] = 0;
1561 working_vector[2 * numx + kstup + jstup + 4 * numx] = 0;
1565 working_vector[2 * numx + kstup + 2 * jstup -
1567 working_vector[2 * numx + kstup + i % jstup];
1568 working_vector[2 * numx + kstup + 2 * jstup -
1569 i % jstup + 4 * numx] =
1570 -working_vector[2 * numx + kstup + i % jstup +
1574 for (i = 0; i < 2 * numx; i++) {
1575 working_vector[i] = working_vector[2 * numx + i];
1576 working_vector[i + 4 * numx] =
1577 working_vector[2 * numx + i + 4 * numx];
1579 GeneralInv(working_vector, 2 * numx, degree, type);
1582 for (i = 0; i <
l; i++)
1590 for (i = 0; i < numx; i++) {
1592 kstup = 2 * kstup * jstup;
1594 if (i % jstup == 0) {
1595 working_vector[2 * numx + kstup + jstup + i % jstup] =
1596 working_vector[jstup + kstup / 2 - i % jstup -
1598 working_vector[2 * numx + kstup + jstup + i % jstup +
1605 working_vector[2 * numx + kstup + jstup + i % jstup +
1607 -(
Double_t) working_vector[jstup + kstup / 2 -
1609 working_vector[2 * numx + kstup + jstup + i % jstup] =
1610 (
Double_t) working_vector[jstup + kstup / 2 -
1612 } }
for (i = 0; i < numx; i++) {
1614 kstup = 2 * kstup * jstup;
1615 if (i % jstup == 0) {
1616 working_vector[2 * numx + kstup] = 0;
1617 working_vector[2 * numx + kstup + 4 * numx] = 0;
1621 working_vector[2 * numx + kstup + i % jstup] =
1622 working_vector[2 * numx + kstup + 2 * jstup -
1624 working_vector[2 * numx + kstup + i % jstup +
1626 -working_vector[2 * numx + kstup + 2 * jstup -
1627 i % jstup + 4 * numx];
1630 for (i = 0; i < 2 * numx; i++) {
1631 working_vector[i] = working_vector[2 * numx + i];
1632 working_vector[i + 4 * numx] =
1633 working_vector[2 * numx + i + 4 * numx];
1635 GeneralInv(working_vector, 2 * numx, degree, type);
1636 for (i = 0; i <
l; i++)
1640 for (i = 0; i < numx; i++) {
1643 kstup = 2 * kstup * jstup;
1644 val = working_vector[kstup + i % jstup];
1648 val = working_vector[i];
1649 working_matrix[i][j] = val;
1758 Double_t *working_vector = 0, **working_matrix = 0;
1763 working_vector =
new Double_t[2 * size];
1765 for (i = 0; i <
fSizeX; i++)
1775 working_vector =
new Double_t[4 * size];
1777 for (i = 0; i <
fSizeX; i++)
1784 working_vector =
new Double_t[8 * size];
1786 for (i = 0; i <
fSizeX; i++)
1793 for (i = 0; i <
fSizeX; i++) {
1794 for (j = 0; j <
fSizeY; j++) {
1795 working_matrix[i][j] = fSource[i][j];
1800 for (i = 0; i <
fSizeX; i++) {
1801 for (j = 0; j <
fSizeY; j++) {
1802 fDest[i][j] = working_matrix[i][j];
1807 for (i = 0; i <
fSizeX; i++) {
1808 for (j = 0; j <
fSizeY; j++) {
1809 working_matrix[i][j] = fSource[i][j];
1814 for (i = 0; i <
fSizeX; i++) {
1815 for (j = 0; j <
fSizeY; j++) {
1816 fDest[i][j] = working_matrix[i][j];
1821 for (i = 0; i <
fSizeX; i++) {
1822 for (j = 0; j <
fSizeY; j++) {
1823 working_matrix[i][j] = fSource[i][j];
1828 for (i = 0; i <
fSizeX; i++) {
1829 for (j = 0; j <
fSizeY; j++) {
1830 fDest[i][j] = working_matrix[i][j];
1835 for (i = 0; i <
fSizeX; i++) {
1836 for (j = 0; j <
fSizeY; j++) {
1837 working_matrix[i][j] = fSource[i][j];
1842 for (i = 0; i <
fSizeX; i++) {
1843 for (j = 0; j <
fSizeY; j++) {
1844 fDest[i][j] = working_matrix[i][j];
1849 for (i = 0; i <
fSizeX; i++) {
1850 for (j = 0; j <
fSizeY; j++) {
1851 working_matrix[i][j] = fSource[i][j];
1856 for (i = 0; i <
fSizeX; i++) {
1857 for (j = 0; j <
fSizeY; j++) {
1858 fDest[i][j] = working_matrix[i][j];
1861 for (i = 0; i <
fSizeX; i++) {
1862 for (j = 0; j <
fSizeY; j++) {
1868 for (i = 0; i <
fSizeX; i++) {
1869 for (j = 0; j <
fSizeY; j++) {
1870 working_matrix[i][j] = fSource[i][j];
1875 for (i = 0; i <
fSizeX; i++) {
1876 for (j = 0; j <
fSizeY; j++) {
1877 fDest[i][j] = working_matrix[i][j];
1888 for (i = 0; i <
fSizeX; i++) {
1889 for (j = 0; j <
fSizeY; j++) {
1890 working_matrix[i][j] = fSource[i][j];
1895 for (i = 0; i <
fSizeX; i++) {
1896 for (j = 0; j <
fSizeY; j++) {
1897 fDest[i][j] = working_matrix[i][j];
1902 for (i = 0; i <
fSizeX; i++) {
1903 for (j = 0; j <
fSizeY; j++) {
1915 for (i = 0; i <
fSizeX; i++) {
1916 for (j = 0; j <
fSizeY; j++) {
1917 working_matrix[i][j] = fSource[i][j];
1922 for (i = 0; i <
fSizeX; i++) {
1923 for (j = 0; j <
fSizeY; j++) {
1924 fDest[i][j] = working_matrix[i][j];
1929 for (i = 0; i <
fSizeX; i++) {
1930 for (j = 0; j <
fSizeY; j++) {
1931 working_matrix[i][j] = fSource[i][j];
1936 for (i = 0; i <
fSizeX; i++) {
1937 for (j = 0; j <
fSizeY; j++) {
1938 fDest[i][j] = working_matrix[i][j];
1943 for (i = 0; i <
fSizeX; i++) {
1944 for (j = 0; j <
fSizeY; j++) {
1945 working_matrix[i][j] = fSource[i][j];
1950 for (i = 0; i <
fSizeX; i++) {
1951 for (j = 0; j <
fSizeY; j++) {
1952 fDest[i][j] = working_matrix[i][j];
1957 for (i = 0; i <
fSizeX; i++) {
1958 for (j = 0; j <
fSizeY; j++) {
1959 working_matrix[i][j] = fSource[i][j];
1964 for (i = 0; i <
fSizeX; i++) {
1965 for (j = 0; j <
fSizeY; j++) {
1966 fDest[i][j] = working_matrix[i][j];
1971 for (i = 0; i <
fSizeX; i++) {
1972 for (j = 0; j <
fSizeY; j++) {
1973 working_matrix[i][j] = fSource[i][j];
1976 for (i = 0; i <
fSizeX; i++) {
1977 for (j = 0; j <
fSizeY; j++) {
1978 working_matrix[i][j +
fSizeY] = fSource[i][j +
fSizeY];
1983 for (i = 0; i <
fSizeX; i++) {
1984 for (j = 0; j <
fSizeY; j++) {
1985 fDest[i][j] = working_matrix[i][j];
1990 for (i = 0; i <
fSizeX; i++) {
1991 for (j = 0; j <
fSizeY; j++) {
1992 working_matrix[i][j] = fSource[i][j];
1997 for (i = 0; i <
fSizeX; i++) {
1998 for (j = 0; j <
fSizeY; j++) {
1999 fDest[i][j] = working_matrix[i][j];
2010 for (i = 0; i <
fSizeX; i++) {
2011 for (j = 0; j <
fSizeY; j++) {
2012 working_matrix[i][j] = fSource[i][j];
2017 for (i = 0; i <
fSizeX; i++) {
2018 for (j = 0; j <
fSizeY; j++) {
2019 working_matrix[i][j +
fSizeY] = fSource[i][j +
fSizeY];
2025 for (i = 0; i <
fSizeX; i++) {
2026 for (j = 0; j <
fSizeY; j++) {
2027 fDest[i][j] = working_matrix[i][j];
2033 for (i = 0; i <
fSizeX; i++) {
2034 if (working_matrix)
delete[]working_matrix[i];
2036 delete[]working_matrix;
2037 delete[]working_vector;
2119 Double_t *working_vector = 0, **working_matrix = 0;
2124 working_vector =
new Double_t[2 * size];
2126 for (i = 0; i <
fSizeX; i++)
2136 working_vector =
new Double_t[4 * size];
2138 for (i = 0; i <
fSizeX; i++)
2145 working_vector =
new Double_t[8 * size];
2147 for (i = 0; i <
fSizeX; i++)
2153 for (i = 0; i <
fSizeX; i++) {
2154 for (j = 0; j <
fSizeY; j++) {
2155 working_matrix[i][j] = fSource[i][j];
2156 old_area = old_area + fSource[i][j];
2163 for (i = 0; i <
fSizeX; i++) {
2164 for (j = 0; j <
fSizeY; j++) {
2165 working_matrix[i][j] = fSource[i][j];
2166 old_area = old_area + fSource[i][j];
2173 for (i = 0; i <
fSizeX; i++) {
2174 for (j = 0; j <
fSizeY; j++) {
2175 working_matrix[i][j] = fSource[i][j];
2176 old_area = old_area + fSource[i][j];
2183 for (i = 0; i <
fSizeX; i++) {
2184 for (j = 0; j <
fSizeY; j++) {
2185 working_matrix[i][j] = fSource[i][j];
2186 old_area = old_area + fSource[i][j];
2193 for (i = 0; i <
fSizeX; i++) {
2194 for (j = 0; j <
fSizeY; j++) {
2195 working_matrix[i][j] = fSource[i][j];
2196 old_area = old_area + fSource[i][j];
2203 for (i = 0; i <
fSizeX; i++) {
2204 for (j = 0; j <
fSizeY; j++) {
2205 working_matrix[i][j] = fSource[i][j];
2206 old_area = old_area + fSource[i][j];
2219 for (i = 0; i <
fSizeX; i++) {
2220 for (j = 0; j <
fSizeY; j++) {
2221 working_matrix[i][j] = fSource[i][j];
2222 old_area = old_area + fSource[i][j];
2229 for (i = 0; i <
fSizeX; i++) {
2230 for (j = 0; j <
fSizeY; j++) {
2232 if (working_matrix) working_matrix[i][j] =
fFilterCoeff;
2237 for (i = 0; i <
fSizeX; i++) {
2238 for (j = 0; j <
fSizeY; j++) {
2248 for (i = 0; i <
fSizeX; i++) {
2249 for (j = 0; j <
fSizeY; j++) {
2250 new_area = new_area + working_matrix[i][j];
2253 if (new_area != 0) {
2254 a = old_area / new_area;
2255 for (i = 0; i <
fSizeX; i++) {
2256 for (j = 0; j <
fSizeY; j++) {
2257 fDest[i][j] = working_matrix[i][j] *
a;
2265 for (i = 0; i <
fSizeX; i++) {
2266 for (j = 0; j <
fSizeY; j++) {
2267 new_area = new_area + working_matrix[i][j];
2270 if (new_area != 0) {
2271 a = old_area / new_area;
2272 for (i = 0; i <
fSizeX; i++) {
2273 for (j = 0; j <
fSizeY; j++) {
2274 fDest[i][j] = working_matrix[i][j] *
a;
2282 for (i = 0; i <
fSizeX; i++) {
2283 for (j = 0; j <
fSizeY; j++) {
2284 new_area = new_area + working_matrix[i][j];
2287 if (new_area != 0) {
2288 a = old_area / new_area;
2289 for (i = 0; i <
fSizeX; i++) {
2290 for (j = 0; j <
fSizeY; j++) {
2291 fDest[i][j] = working_matrix[i][j] *
a;
2299 for (i = 0; i <
fSizeX; i++) {
2300 for (j = 0; j <
fSizeY; j++) {
2301 new_area = new_area + working_matrix[i][j];
2304 if (new_area != 0) {
2305 a = old_area / new_area;
2306 for (i = 0; i <
fSizeX; i++) {
2307 for (j = 0; j <
fSizeY; j++) {
2308 fDest[i][j] = working_matrix[i][j] *
a;
2316 for (i = 0; i <
fSizeX; i++) {
2317 for (j = 0; j <
fSizeY; j++) {
2318 new_area = new_area + working_matrix[i][j];
2321 if (new_area != 0) {
2322 a = old_area / new_area;
2323 for (i = 0; i <
fSizeX; i++) {
2324 for (j = 0; j <
fSizeY; j++) {
2325 fDest[i][j] = working_matrix[i][j] *
a;
2333 for (i = 0; i <
fSizeX; i++) {
2334 for (j = 0; j <
fSizeY; j++) {
2335 new_area = new_area + working_matrix[i][j];
2338 if (new_area != 0) {
2339 a = old_area / new_area;
2340 for (i = 0; i <
fSizeX; i++) {
2341 for (j = 0; j <
fSizeY; j++) {
2342 fDest[i][j] = working_matrix[i][j] *
a;
2356 for (i = 0; i <
fSizeX; i++) {
2357 for (j = 0; j <
fSizeY; j++) {
2358 new_area = new_area + working_matrix[i][j];
2361 if (new_area != 0) {
2362 a = old_area / new_area;
2363 for (i = 0; i <
fSizeX; i++) {
2364 for (j = 0; j <
fSizeY; j++) {
2365 fDest[i][j] = working_matrix[i][j] *
a;
2371 for (i = 0; i <
fSizeX; i++) {
2372 if (working_matrix)
delete[]working_matrix[i];
2374 delete[]working_matrix;
2375 delete[]working_vector;
2450 Double_t *working_vector = 0, **working_matrix = 0;
2455 working_vector =
new Double_t[2 * size];
2457 for (i = 0; i <
fSizeX; i++)
2467 working_vector =
new Double_t[4 * size];
2469 for (i = 0; i <
fSizeX; i++)
2476 working_vector =
new Double_t[8 * size];
2478 for (i = 0; i <
fSizeX; i++)
2484 for (i = 0; i <
fSizeX; i++) {
2485 for (j = 0; j <
fSizeY; j++) {
2486 working_matrix[i][j] = fSource[i][j];
2487 old_area = old_area + fSource[i][j];
2494 for (i = 0; i <
fSizeX; i++) {
2495 for (j = 0; j <
fSizeY; j++) {
2496 working_matrix[i][j] = fSource[i][j];
2497 old_area = old_area + fSource[i][j];
2504 for (i = 0; i <
fSizeX; i++) {
2505 for (j = 0; j <
fSizeY; j++) {
2506 working_matrix[i][j] = fSource[i][j];
2507 old_area = old_area + fSource[i][j];
2514 for (i = 0; i <
fSizeX; i++) {
2515 for (j = 0; j <
fSizeY; j++) {
2516 working_matrix[i][j] = fSource[i][j];
2517 old_area = old_area + fSource[i][j];
2524 for (i = 0; i <
fSizeX; i++) {
2525 for (j = 0; j <
fSizeY; j++) {
2526 working_matrix[i][j] = fSource[i][j];
2527 old_area = old_area + fSource[i][j];
2534 for (i = 0; i <
fSizeX; i++) {
2535 for (j = 0; j <
fSizeY; j++) {
2536 working_matrix[i][j] = fSource[i][j];
2537 old_area = old_area + fSource[i][j];
2550 for (i = 0; i <
fSizeX; i++) {
2551 for (j = 0; j <
fSizeY; j++) {
2552 working_matrix[i][j] = fSource[i][j];
2553 old_area = old_area + fSource[i][j];
2560 for (i = 0; i <
fSizeX; i++) {
2561 for (j = 0; j <
fSizeY; j++) {
2568 for (i = 0; i <
fSizeX; i++) {
2569 for (j = 0; j <
fSizeY; j++) {
2579 for (i = 0; i <
fSizeX; i++) {
2580 for (j = 0; j <
fSizeY; j++) {
2581 new_area = new_area + working_matrix[i][j];
2584 if (new_area != 0) {
2585 a = old_area / new_area;
2586 for (i = 0; i <
fSizeX; i++) {
2587 for (j = 0; j <
fSizeY; j++) {
2588 fDest[i][j] = working_matrix[i][j] *
a;
2596 for (i = 0; i <
fSizeX; i++) {
2597 for (j = 0; j <
fSizeY; j++) {
2598 new_area = new_area + working_matrix[i][j];
2601 if (new_area != 0) {
2602 a = old_area / new_area;
2603 for (i = 0; i <
fSizeX; i++) {
2604 for (j = 0; j <
fSizeY; j++) {
2605 fDest[i][j] = working_matrix[i][j] *
a;
2613 for (i = 0; i <
fSizeX; i++) {
2614 for (j = 0; j <
fSizeY; j++) {
2615 new_area = new_area + working_matrix[i][j];
2618 if (new_area != 0) {
2619 a = old_area / new_area;
2620 for (i = 0; i <
fSizeX; i++) {
2621 for (j = 0; j <
fSizeY; j++) {
2622 fDest[i][j] = working_matrix[i][j] *
a;
2630 for (i = 0; i <
fSizeX; i++) {
2631 for (j = 0; j <
fSizeY; j++) {
2632 new_area = new_area + working_matrix[i][j];
2635 if (new_area != 0) {
2636 a = old_area / new_area;
2637 for (i = 0; i <
fSizeX; i++) {
2638 for (j = 0; j <
fSizeY; j++) {
2639 fDest[i][j] = working_matrix[i][j] *
a;
2647 for (i = 0; i <
fSizeX; i++) {
2648 for (j = 0; j <
fSizeY; j++) {
2649 new_area = new_area + working_matrix[i][j];
2652 if (new_area != 0) {
2653 a = old_area / new_area;
2654 for (i = 0; i <
fSizeX; i++) {
2655 for (j = 0; j <
fSizeY; j++) {
2656 fDest[i][j] = working_matrix[i][j] *
a;
2664 for (i = 0; i <
fSizeX; i++) {
2665 for (j = 0; j <
fSizeY; j++) {
2666 new_area = new_area + working_matrix[i][j];
2669 if (new_area != 0) {
2670 a = old_area / new_area;
2671 for (i = 0; i <
fSizeX; i++) {
2672 for (j = 0; j <
fSizeY; j++) {
2673 fDest[i][j] = working_matrix[i][j] *
a;
2687 for (i = 0; i <
fSizeX; i++) {
2688 for (j = 0; j <
fSizeY; j++) {
2689 new_area = new_area + working_matrix[i][j];
2692 if (new_area != 0) {
2693 a = old_area / new_area;
2694 for (i = 0; i <
fSizeX; i++) {
2695 for (j = 0; j <
fSizeY; j++) {
2696 fDest[i][j] = working_matrix[i][j] *
a;
2702 for (i = 0; i <
fSizeX; i++) {
2703 if (working_matrix)
delete[]working_matrix[i];
2705 delete[]working_matrix;
2706 delete[]working_vector;
2731 Error (
"TSpectrumTransform",
"Invalid type of transform");
2735 if (degree > j1 || degree > j2 || degree < 1){
2736 Error (
"TSpectrumTransform",
"Invalid degree of mixed transform");
2750 if(xmin<0 || xmax < xmin || xmax >=
fSizeX){
2751 Error(
"TSpectrumTransform",
"Wrong range");
2754 if(ymin<0 || ymax < ymin || ymax >=
fSizeY){
2755 Error(
"TSpectrumTransform",
"Wrong range");
2771 Error(
"TSpectrumTransform",
"Wrong direction");
static constexpr double pi
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
static constexpr double degree
Mother of all ROOT objects.
Short_t Max(Short_t a, Short_t b)
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)