Skip to content

Commit

Permalink
Add a readFrame method
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Jan 18, 2024
1 parent 9e0c210 commit 267f2c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/podio/Reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Reader {
~Reader();

podio::Frame readNextFrame(const std::string& name);
podio::Frame readFrame(const std::string& name, size_t index);

size_t getEntries(const std::string& name);

Expand Down
4 changes: 4 additions & 0 deletions src/Reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ podio::Frame Reader::readNextFrame(const std::string& name) {
}
}

podio::Frame Reader::readFrame(const std::string& name, size_t index) {
return m_reader->readEntry(name, index);
}

size_t Reader::getEntries(const std::string& name) {
return m_reader->getEntries(name);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/root_io/read_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int read_frames(const std::string& filename, std::unique_ptr<podio::IROOTFrameRe
auto frame = podio::Frame(reader->readEntry(podio::Category::Event, 4).value());
processEvent(frame, 4, reader->currentFileVersion());
// Reading the next entry after jump, continues from after the jump
auto nextFrame = podio::Frame(reader->readNextEntry(podio::Category::Event).value());
auto nextFrame = podio::Frame(reader->readNextEntry(podio::Category::Event).value());
processEvent(nextFrame, 5, reader->currentFileVersion());

auto otherFrame = podio::Frame(reader->readEntry("other_events", 4).value());
Expand Down

0 comments on commit 267f2c2

Please sign in to comment.