33 LOG(info) <<
"FV0CalibInfoSlot::fill entries in incoming data = " << nd;
34 std::vector<int> ord(nd);
35 std::iota(ord.begin(), ord.end(), 0);
36 std::sort(ord.begin(), ord.end(), [&
data](
int i,
int j) { return data[i].getChannelIndex() < data[j].getChannelIndex(); });
37 int chPrev = 0, offsPrev = 0;
38 for (
int i = 0;
i < nd;
i++) {
42 const auto& dti =
data[ord[
i]];
43 auto ch = dti.getChannelIndex();
46 offset += std::accumulate(mEntriesSlot.begin() + chPrev, mEntriesSlot.begin() + ch, 0);
50 auto it = mFV0CollectedCalibInfoSlot.emplace(mFV0CollectedCalibInfoSlot.begin() +
offset,
data[ord[
i]].getChannelIndex(),
data[ord[
i]].getTime(),
data[ord[
i]].getCharge(),
data[ord[
i]].getTimeStamp());
59 LOG(info) <<
"Merging two slots with entries: current slot -> " << mFV0CollectedCalibInfoSlot.size() <<
" , previous slot -> " << prev->mFV0CollectedCalibInfoSlot.size();
61 int offset = 0, offsetPrev = 0;
62 std::vector<o2::fv0::FV0CalibrationInfoObject> tmpVector;
64 if (mEntriesSlot[ch] != 0) {
66 tmpVector.emplace_back(mFV0CollectedCalibInfoSlot[
i]);
68 offset += mEntriesSlot[ch];
70 if (prev->mEntriesSlot[ch] != 0) {
71 for (
int i = offsetPrev;
i < offsetPrev + prev->mEntriesSlot[ch];
i++) {
72 tmpVector.emplace_back(prev->mFV0CollectedCalibInfoSlot[
i]);
74 offsetPrev += prev->mEntriesSlot[ch];
75 mEntriesSlot[ch] += prev->mEntriesSlot[ch];
78 mFV0CollectedCalibInfoSlot.swap(tmpVector);
79 LOG(
debug) <<
"After merging the size is " << mFV0CollectedCalibInfoSlot.size();