Skip to content

Commit 167e91b

Browse files
authored
DPL Analysis: fix for malformed slice for the last entry in grouping (#5452)
1 parent fc0e348 commit 167e91b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Framework/Core/include/Framework/Kernels.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ auto sliceByColumn(char const* key,
7676
}
7777
}
7878
makeSlice(counts.Value(size - 1));
79+
offset += counts.Value(size - 1);
7980

8081
if (values.Value(size - 1) < fullSize - 1) {
8182
for (auto v = values.Value(size - 1) + 1; v < fullSize; ++v) {

Framework/Core/test/test_GroupSlicer.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ BOOST_AUTO_TEST_CASE(GroupSlicerMismatchedGroups)
207207
TableBuilder builderT;
208208
auto trksWriter = builderT.cursor<aod::TrksX>();
209209
for (auto i = 0; i < 20; ++i) {
210-
if (i == 3 || i == 10 || i == 12 || i == 16) {
210+
if (i == 3 || i == 10 || i == 12 || i == 16 || i == 19) {
211211
continue;
212212
}
213213
for (auto j = 0.f; j < 5; j += 0.5f) {
@@ -218,7 +218,7 @@ BOOST_AUTO_TEST_CASE(GroupSlicerMismatchedGroups)
218218
aod::Events e{evtTable};
219219
aod::TrksX t{trkTable};
220220
BOOST_CHECK_EQUAL(e.size(), 20);
221-
BOOST_CHECK_EQUAL(t.size(), 10 * (20 - 4));
221+
BOOST_CHECK_EQUAL(t.size(), 10 * (20 - 5));
222222

223223
auto tt = std::make_tuple(t);
224224
o2::framework::AnalysisDataProcessorBuilder::GroupSlicer g(e, tt);
@@ -229,7 +229,7 @@ BOOST_AUTO_TEST_CASE(GroupSlicerMismatchedGroups)
229229
auto gg = slice.groupingElement();
230230
BOOST_CHECK_EQUAL(gg.globalIndex(), count);
231231
auto trks = std::get<aod::TrksX>(as);
232-
if (count == 3 || count == 10 || count == 12 || count == 16) {
232+
if (count == 3 || count == 10 || count == 12 || count == 16 || count == 19) {
233233
BOOST_CHECK_EQUAL(trks.size(), 0);
234234
} else {
235235
BOOST_CHECK_EQUAL(trks.size(), 10);

0 commit comments

Comments
 (0)