Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
FemtoSerializationInterface1D.cxx
1/*
2 * FemtoSerialization1D.cxx
3 *
4 * Created on: 17 sty 2024
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "FemtoSerializationInterface1D.h"
10#include "Femto1DCF.h"
11
12namespace Hal {
13
14 Bool_t FemtoSerializationInterface1D::GetBinsNo() {
15 if (!fCF) return kFALSE;
16 fBinStart = 1;
17 fBinStop = fCF->GetNum()->GetNbinsX();
18 return kTRUE;
19 }
20
21
22 Bool_t GetBinsNo() { return kTRUE; };
23 void FemtoSerializationInterface1D::ConvertCF(ECopyDir dir) {
24 ExpandArrayIfSerialize(fCF->GetNum()->GetNbinsX() * 2, dir);
25 std::vector<TH1*> cfs;
26 cfs.push_back(fCF->GetNum());
27 cfs.push_back(fCF->GetDen());
28 for (int i = fBinLow; i <= fBinHi; i++) {
29 CopyData1D(cfs, i, dir);
30 }
31 }
32 void FemtoSerializationInterface1D::ConvertSlice(ECopyDir dir) {
33 ExpandArrayIfSerialize(2, dir);
34 CopyDataSingle(fSlice->fNum[fBinLow], dir);
35 CopyDataSingle(fSlice->fDen[fBinLow], dir);
36 }
37 void FemtoSerializationInterface1D::ConvertCFSimple(ECopyDir dir) {
38 ExpandArrayIfSerialize(fCF->GetNum()->GetNbinsX(), dir);
39 std::vector<TH1*> nums, dens;
40 nums.push_back(fCF->GetNum());
41 dens.push_back(fCF->GetDen());
42 for (int i = fBinStart; i <= fBinStop; i++) {
43 CopyData1D2(nums, dens, i, dir);
44 }
45 }
46
47 void FemtoSerializationInterface1D::ConvertSliceSimple(ECopyDir dir) {
48 ExpandArrayIfSerialize(2, dir);
49 CopyDataPair(fSlice->fNum[fBinLow], fSlice->fDen[fBinLow], dir);
50 }
51
52} /* namespace Hal */