Skip to content

Commit 4b69b26

Browse files
committed
[ntuple] Update chain processing tutorial
1 parent 3f6310d commit 4b69b26

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tutorials/io/ntuple/ntpl012_processor_chain.C

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ void Read(const std::vector<RNTupleOpenSpec> &ntuples)
7474
// Access to the entry values in this case can be achieved through RNTupleProcessor::GetEntry() or through its
7575
// iterator.
7676
auto processor = RNTupleProcessor::CreateChain(ntuples, std::move(model));
77+
int prevProcessorNumber{-1};
7778

7879
for (const auto &entry : *processor) {
7980
// The RNTupleProcessor provides some additional bookkeeping information. The local entry number is reset each
8081
// a new ntuple in the chain is opened for processing.
81-
if (processor->GetLocalEntryNumber() == 0) {
82-
std::cout << "Processing " << ntuples.at(processor->GetCurrentNTupleNumber()).fNTupleName << " ("
82+
if (static_cast<int>(processor->GetCurrentProcessorNumber()) > prevProcessorNumber) {
83+
prevProcessorNumber = processor->GetCurrentProcessorNumber();
84+
std::cout << "Processing " << ntuples.at(prevProcessorNumber).fNTupleName << " ("
8385
<< processor->GetNEntriesProcessed() << " total entries processed so far)" << std::endl;
8486
}
8587

0 commit comments

Comments
 (0)