9#include "FemtoSerializationInterfaceSH.h"
16 void FemtoSerializationInterfaceSH::PostInit() {
21 maxL = fSlice->GetMaxL();
23 fMaxJM = (maxL + 1) * (maxL + 1);
26 Bool_t FemtoSerializationInterfaceSH::GetBinsNo() {
27 fBinStop = fCF->
GetNum()->GetNbinsX();
32 void FemtoSerializationInterfaceSH::ConvertCF(ECopyDir dir) {
33 unsigned int dim = 2 + fMaxJM * 8 + fMaxJM * fMaxJM * 4;
34 int qbins = fBinHi - fBinLow + 1;
35 ExpandArrayIfSerialize(dim * qbins, dir);
36 std::vector<TH1*> cfs, cfs2;
37 cfs.push_back(fCF->
GetNum());
38 cfs.push_back(fCF->
GetDen());
39 for (
int i = 0; i < fMaxJM; i++) {
40 cfs.push_back(fCF->fNumReal[i]);
41 cfs.push_back(fCF->fDenReal[i]);
42 cfs.push_back(fCF->fNumImag[i]);
43 cfs.push_back(fCF->fDenImag[i]);
44 cfs2.push_back(fCF->fNumReal[i]);
45 cfs2.push_back(fCF->fDenReal[i]);
46 cfs2.push_back(fCF->fNumImag[i]);
47 cfs2.push_back(fCF->fDenImag[i]);
49 for (
int iq = fBinLow; iq <= fBinHi; iq++) {
50 CopyData1D(cfs, iq, dir);
51 CopyData1D(cfs2, iq, dir,
true);
52 for (
int i = 0; i < fMaxJM * 2; i++) {
53 for (
int j = 0; j < fMaxJM * 2; j++) {
54 CopyDataSingle(fCF->fCovNum[iq - 1][i][j], dir);
61 void FemtoSerializationInterfaceSH::ConvertSlice(ECopyDir dir) {
63 ExpandArrayIfSerialize(2 + fMaxJM * 8 + fMaxJM * fMaxJM * 4, dir);
64 CopyDataSingle(fSlice->fNum[fBinLow], dir);
65 CopyDataSingle(fSlice->fDen[fBinLow], dir);
67 for (
int i = 0; i < fMaxJM; i++) {
68 CopyDataSingle(fSlice->fShNumReal[fBinLow][i], dir);
69 CopyDataSingle(fSlice->fShDenReal[fBinLow][i], dir);
70 CopyDataSingle(fSlice->fShNumImag[fBinLow][i], dir);
71 CopyDataSingle(fSlice->fShDenImag[fBinLow][i], dir);
73 auto sqrSeralize = [&](Double_t& val, ECopyDir dirx) {
75 if (dirx == ECopyDir::kSerialize) {
76 copy = TMath::Sqrt(val);
77 CopyDataSingle(copy, dirx);
79 CopyDataSingle(copy, dirx);
84 for (
int i = 0; i < fMaxJM; i++) {
85 sqrSeralize(fSlice->fShNumRealE[fBinLow][i], dir);
86 sqrSeralize(fSlice->fShDenRealE[fBinLow][i], dir);
87 sqrSeralize(fSlice->fShNumImagE[fBinLow][i], dir);
88 sqrSeralize(fSlice->fShDenImagE[fBinLow][i], dir);
90 for (
int i = 0; i < fMaxJM * 2; i++) {
91 for (
int j = 0; j < fMaxJM * 2; j++) {
92 if (i == j && i == 0) std::cout <<
"EXPORT COV " << fSlice->fCovMatrix[fBinLow][i][j] << std::endl;
93 CopyDataSingle(fSlice->fCovMatrix[fBinLow][i][j], dir);
98 void FemtoSerializationInterfaceSH::ConvertCFSimple(ECopyDir dir) {
99 unsigned int dim = 2 + fMaxJM * 2;
100 int qbins = fBinHi - fBinLow + 1;
101 ExpandArrayIfSerialize(dim * qbins, dir);
102 std::vector<TH1*> cfs;
103 cfs.push_back(fCF->
GetNum());
104 cfs.push_back(fCF->
GetDen());
105 for (
int i = 0; i < fMaxJM; i++) {
106 cfs.push_back(fCF->fCFReal[i]);
107 cfs.push_back(fCF->fCFImag[i]);
109 for (
int iq = fBinStart; iq <= fBinStop; iq++) {
110 CopyData1D(cfs, iq, dir);
114 void FemtoSerializationInterfaceSH::ConvertSliceSimple(ECopyDir dir) {
118 ExpandArrayIfSerialize(2 + fMaxJM * 4 + fMaxJM * fMaxJM * 4, dir);
120 CopyDataSingle(fSlice->fNum[fBinLow], dir);
121 CopyDataSingle(fSlice->fDen[fBinLow], dir);
123 for (
int i = 0; i < fMaxJM; i++) {
124 CopyDataSingle(fSlice->fShNumReal[fBinLow][i], dir);
125 CopyDataSingle(fSlice->fShDenReal[fBinLow][i], dir);
126 CopyDataSingle(fSlice->fShNumImag[fBinLow][i], dir);
127 CopyDataSingle(fSlice->fShDenImag[fBinLow][i], dir);
129 for (
int i = 0; i < fMaxJM * 2; i++) {
130 for (
int j = 0; j < fMaxJM * 2; j++) {
131 CopyDataSingle(fSlice->fCovMatrix[fBinLow][i][j], dir);