diff --git a/tree/treeplayer/src/TTreeProcessorMT.cxx b/tree/treeplayer/src/TTreeProcessorMT.cxx index 4aa6239b49db3b282bcd00e7cfb00a302e6c202a..65bbb626fe2e1f783385157e14d2dfff91d66d40 100644 --- a/tree/treeplayer/src/TTreeProcessorMT.cxx +++ b/tree/treeplayer/src/TTreeProcessorMT.cxx @@ -83,12 +83,15 @@ TTreeView::MakeReaderWithEntryList(TEntryList &globalList, Long64_t start, Long6 // TEntryList and SetEntriesRange do not work together (the former has precedence). // We need to construct a TEntryList that contains only those entry numbers in our desired range. auto localList = std::make_unique<TEntryList>(); + // We call GetEntry twice: workaround for ROOT-10113 (the return value for 1 call only could be -1) + globalList.GetEntry(0); Long64_t entry = globalList.GetEntry(0); do { - if (entry >= end) + if (entry >= end) { break; - else if (entry >= start) + } else if (entry >= start) { localList->Enter(entry); + } } while ((entry = globalList.Next()) >= 0); auto reader = std::make_unique<TTreeReader>(fChain.get(), localList.get());