From 6b34936e6d917a6a6e78e61058abc4704ef6b15f Mon Sep 17 00:00:00 2001 From: tmadlener Date: Mon, 10 Jun 2024 11:36:54 +0200 Subject: [PATCH] Add detailed printing --- tools/src/podio-dump.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tools/src/podio-dump.cpp b/tools/src/podio-dump.cpp index 9d312efdf..9220eb717 100644 --- a/tools/src/podio-dump.cpp +++ b/tools/src/podio-dump.cpp @@ -153,7 +153,6 @@ void getParameterOverview(const podio::Frame& frame, std::vector +void print_flush(fmt::format_string fmtstr, Args&&... args) { + fmt::print(fmtstr, std::forward(args)...); + std::fflush(stdout); +} + +void printFrameDetailed(const podio::Frame& frame) { + fmt::print("Collections:\n"); + const auto collNames = frame.getAvailableCollections(); + for (const auto& name : podio::utils::sortAlphabeticaly(collNames)) { + const auto coll = frame.get(name); + print_flush("{}\n", name); + coll->print(); + print_flush("\n"); + } + + print_flush("\nParameters\n:"); + frame.getParameters().print(); + print_flush("\n"); +} + void printGeneralInfo(const podio::Reader& reader, const std::string& filename) { fmt::print("input file: {}\n", filename); fmt::print("datamodel model definitions stored in this file: {}\n\n", reader.getAvailableDatamodels()); @@ -191,7 +211,7 @@ void printGeneralInfo(const podio::Reader& reader, const std::string& filename) void printFrame(const podio::Frame& frame, const std::string& category, size_t iEntry, bool detailed) { fmt::print("{:#^82}\n", fmt::format(" {}: {} ", category, iEntry)); if (detailed) { - + printFrameDetailed(frame); } else { printFrameOverview(frame); }