8 {
10 try {
11 reader.openFile("example.root");
12 } catch (const std::runtime_error& e) {
13 std::cout << "File could not be opened, aborting." << std::endl;
14 return 1;
15 }
16
17 if (reader.currentFileVersion() != podio::version::build_version) {
18 std::cerr << "The podio build version could not be read back correctly. "
19 << "(expected:" << podio::version::build_version << ", actual: " << reader.currentFileVersion() << ")"
20 << std::endl;
21 return 1;
22 }
23
24 if (reader.getEntries("events") != 2000) {
25 std::cerr << "Could not read back the number of events correctly. "
26 << "(expected:" << 2000 << ", actual: " << reader.getEntries("events") << ")" << std::endl;
27 return 1;
28 }
29
30 for (size_t i = 0; i < reader.getEntries("events"); ++i) {
31 const auto frame =
podio::Frame(reader.readNextEntry(
"events"));
33 }
34
35
36 {
37 auto frame =
podio::Frame(reader.readEntry(
"events", 4));
39
40 auto nextFrame =
podio::Frame(reader.readNextEntry(
"events"));
42
43 auto previousFrame =
podio::Frame(reader.readEntry(
"events", 2));
44 processEvent(previousFrame, 2, reader.currentFileVersion());
45 }
46
47 return 0;
48}
void processEvent(StoreT &store, int eventNum, podio::version::Version fileVersion)