Skip to content

Commit c7d24b2

Browse files
committed
Add detailed printing
1 parent 183481d commit c7d24b2

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

tools/src/podio-dump.cpp

+22-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ void getParameterOverview(const podio::Frame& frame, std::vector<std::tuple<std:
153153
}
154154

155155
void printFrameOverview(const podio::Frame& frame) {
156-
157156
fmt::print("Collections:\n");
158157
const auto collNames = frame.getAvailableCollections();
159158

@@ -176,6 +175,27 @@ void printFrameOverview(const podio::Frame& frame) {
176175
printTable(paramRows, {"Name", "Type", "Elements"});
177176
}
178177

178+
template <typename... Args>
179+
void print_flush(fmt::format_string<Args...> fmtstr, Args&&... args) {
180+
fmt::print(fmtstr, std::forward<Args>(args)...);
181+
std::fflush(stdout);
182+
}
183+
184+
void printFrameDetailed(const podio::Frame& frame) {
185+
fmt::print("Collections:\n");
186+
const auto collNames = frame.getAvailableCollections();
187+
for (const auto& name : podio::utils::sortAlphabeticaly(collNames)) {
188+
const auto coll = frame.get(name);
189+
print_flush("{}\n", name);
190+
coll->print();
191+
print_flush("\n");
192+
}
193+
194+
print_flush("\nParameters\n:");
195+
frame.getParameters().print();
196+
print_flush("\n");
197+
}
198+
179199
void printGeneralInfo(const podio::Reader& reader, const std::string& filename) {
180200
fmt::print("input file: {}\n", filename);
181201
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)
191211
void printFrame(const podio::Frame& frame, const std::string& category, size_t iEntry, bool detailed) {
192212
fmt::print("{:#^82}\n", fmt::format(" {}: {} ", category, iEntry));
193213
if (detailed) {
194-
214+
printFrameDetailed(frame);
195215
} else {
196216
printFrameOverview(frame);
197217
}

0 commit comments

Comments
 (0)