17 #include "cetlib/column_width.h" 18 #include "cetlib/lpad.h" 19 #include "cetlib/rpad.h" 52 return "PROCESS NAME";
58 "PRODUCT INSTANCE NAME",
60 "PRODUCT FRIENDLY TYPE",
64 using ProductInfos = std::vector<art::detail::ProductInfo>;
66 columnWidthFirst(std::map<std::string, ProductInfos>
const& m,
67 std::string
const& title)
69 std::size_t i{title.size()};
71 m, [&i](
auto const& entry) { i =
std::max(i, entry.first.size()); });
76 columnWidth(std::map<std::string, ProductInfos>
const& m,
78 std::string
const& title)
80 std::size_t i{title.size()};
81 for (
auto const& entry : m) {
82 for (
auto const&
pi : entry.second) {
105 wantProductFullClassName()};
121 template <
typename P>
122 void printPrincipal(P
const& p);
124 void printProductInfo(std::vector<std::size_t>
const& columnWidths,
125 std::string
const& processName,
167 template <
typename P>
175 size_t not_present{0};
176 std::map<std::string, std::vector<detail::ProductInfo>> products;
178 auto const& dinfo = dummyInfo();
180 products[dummyProcess()].emplace_back(dinfo);
182 for (
auto const& pr : p) {
183 auto const& g = *pr.second;
187 EDProduct const* product = oh.isValid() ? oh.wrapper() :
nullptr;
188 bool const productPresent = product !=
nullptr && product->
isPresent();
190 if (productPresent) {
198 g.productInstanceName(),
199 g.productDescription().producedClassName(),
200 g.productDescription().friendlyClassName(),
201 product_size(product, productPresent)};
202 products[g.processName()].emplace_back(std::move(
pi));
209 std::vector<std::size_t>
const widths{
210 columnWidthFirst(products, dummyProcess()),
223 for (
auto const& processConfig : p.processHistory()) {
224 auto const&
processName = processConfig.processName();
230 std::cout <<
"\nTotal products (present, not present): " 231 <<
present + not_present <<
" (" <<
present <<
", " << not_present
240 std::ostringstream oss;
241 oss << cet::rpad(processName, widths[0],
'.') <<
" | " 245 oss << cet::rpad(pi.
product_type, widths[3],
'.') <<
" | ";
248 oss << cet::lpad(pi.
str_size, widths[5],
'.');
249 std::cout << oss.str() <<
'\n';
std::string instance_name
bool wantResolveProducts_
void write(EventPrincipal &e) override
auto const & get_PSet() const
std::size_t columnWidth(T const &coll, std::string const Elem::*cp, std::string const &header)
FileDumperOutput(Parameters const &)
void printPrincipal(P const &p)
bool wantProductFriendlyClassName_
#define DEFINE_ART_MODULE(klass)
bool wantProductFullClassName_
void printProductInfo(std::vector< std::size_t > const &columnWidths, std::string const &processName, detail::ProductInfo const &pi) const
std::string const & BranchTypeToString(BranchType const bt)
void writeRun(RunPrincipal &r) override
void readResults(ResultsPrincipal const &resp) override
fhicl::TableFragment< OutputModule::Config > omConfig
virtual std::string productSize() const
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
void writeSubRun(SubRunPrincipal &sr) override
std::string const & processName() const
std::string friendly_type