16 #include "cetlib/lpad.h" 17 #include "cetlib/rpad.h" 19 #include "range/v3/view.hpp" 50 return "PROCESS NAME";
57 "PRODUCT INSTANCE NAME",
59 "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) {
83 i = std::max(i, (
pi.*pim).size());
104 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,
168 template <
typename P>
176 size_t not_present{0};
177 std::map<std::string, std::vector<detail::ProductInfo>> products;
179 auto const& dinfo = dummyInfo();
181 products[dummyProcess()].emplace_back(dinfo);
184 auto const& pd = g.productDescription();
187 EDProduct const* product = oh.isValid() ? oh.wrapper() :
nullptr;
188 bool const productPresent = product !=
nullptr && product->
isPresent();
190 if (productPresent) {
198 pd.productInstanceName(),
199 pd.producedClassName(),
200 pd.friendlyClassName(),
202 product_size(product, productPresent)};
203 products[pd.processName()].emplace_back(std::move(
pi));
210 std::vector<std::size_t>
const widths{
211 columnWidthFirst(products, dummyProcess()),
225 for (
auto const& processConfig : p.processHistory()) {
226 auto const&
processName = processConfig.processName();
232 std::cout <<
"\nTotal products (present, not present): " 233 <<
present + not_present <<
" (" <<
present <<
", " << not_present
242 std::ostringstream oss;
243 oss << cet::rpad(processName, widths[0],
'.') <<
" | " 247 oss << cet::rpad(pi.
product_type, widths[3],
'.') <<
" | ";
253 oss << cet::rpad(pi.
product_id, widths[5],
'.') <<
" | ";
255 oss << cet::lpad(pi.
str_size, widths[6],
'.');
256 std::cout << oss.str() <<
'\n';
std::string instance_name
std::string const & processName() const
bool const wantResolveProducts_
void write(EventPrincipal &e) override
std::size_t columnWidth(T const &coll, std::string const Elem::*cp, std::string const &header)
FileDumperOutput(Parameters const &)
void printPrincipal(P const &p)
#define DEFINE_ART_MODULE(klass)
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
void printProductInfo(std::vector< std::size_t > const &columnWidths, std::string const &processName, detail::ProductInfo const &pi) const
bool const wantProductID_
decltype(auto) values(Coll &&coll)
Range-for loop helper iterating across the values of the specified collection.
bool const wantPresentOnly_
bool const wantProductFullClassName_
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
constexpr ProductStatus present() noexcept
std::string friendly_type
bool const wantProductFriendlyClassName_