Skip to content

Commit

Permalink
[ntuple] Update chain processing tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
enirolf committed Jan 10, 2025
1 parent 646524f commit 8d818f5
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ void Read(const std::vector<RNTupleOpenSpec> &ntuples)
// Access to the entry values in this case can be achieved through RNTupleProcessor::GetEntry() or through its
// iterator.
auto processor = RNTupleProcessor::CreateChain(ntuples, std::move(model));
int prevProcessorNumber{-1};

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

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

void ntpl012_processor()
void ntpl012_processor_chain()
{
// The ntuples to generate and subsequently process. The model of the first ntuple will be used to construct the
// entry used by the processor.
Expand Down

0 comments on commit 8d818f5

Please sign in to comment.