59 LOG(
debug) <<
"entries in incoming data = " << nd;
60 std::vector<int> ord(nd);
61 std::iota(ord.begin(), ord.end(), 0);
62 std::sort(ord.begin(), ord.end(), [&
data](
int i,
int j) { return data[i].getCH() < data[j].getCH(); });
63 int chPrev = 0, offsPrev = 0;
64 for (
int i = 0;
i < nd;
i++) {
65 const auto& dti =
data[ord[
i]];
66 auto ch = dti.getCH();
67 auto dch = dti.getDCH();
68 auto dt = dti.getDT();
69 auto tot1 = dti.getTOT1();
70 auto tot2 = dti.getTOT2();
85 offset += std::accumulate(mEntriesSlot.begin() + chPrev, mEntriesSlot.begin() + ch, 0);
100 LOG(
debug) <<
"Merging two slots with entries: current slot -> " << mTOFCollectedCalibInfoSlot.size() <<
" , previous slot -> " << prev->mTOFCollectedCalibInfoSlot.size();
102 int offset = 0, offsetPrev = 0;
103 std::vector<o2::dataformats::CalibInfoTOF> tmpVector;
105 if (mEntriesSlot[ch] != 0) {
107 tmpVector.emplace_back(mTOFCollectedCalibInfoSlot[
i]);
109 offset += mEntriesSlot[ch];
111 if (prev->mEntriesSlot[ch] != 0) {
112 for (
int i = offsetPrev;
i < offsetPrev + prev->mEntriesSlot[ch];
i++) {
113 tmpVector.emplace_back(prev->mTOFCollectedCalibInfoSlot[
i]);
115 offsetPrev += prev->mEntriesSlot[ch];
116 mEntriesSlot[ch] += prev->mEntriesSlot[ch];
119 mTOFCollectedCalibInfoSlot.swap(tmpVector);
120 LOG(
debug) <<
"After merging the size is " << mTOFCollectedCalibInfoSlot.size();