Skip to content

Commit 75745f8

Browse files
committed
[ntuple] Update chain processing tutorial
1 parent 0648445 commit 75745f8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tutorials/io/ntuple/ntpl012_processor.C renamed to tutorials/io/ntuple/ntpl012_processor_chain.C

Lines changed: 5 additions & 3 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

@@ -93,7 +95,7 @@ void Read(const std::vector<RNTupleOpenSpec> &ntuples)
9395
hPx.DrawCopy();
9496
}
9597

96-
void ntpl012_processor()
98+
void ntpl012_processor_chain()
9799
{
98100
// The ntuples to generate and subsequently process. The model of the first ntuple will be used to construct the
99101
// entry used by the processor.

0 commit comments

Comments
 (0)