4 #include "cetlib/HorizontalRule.h" 6 #include "range/v3/view.hpp" 12 constexpr cet::HorizontalRule header_rule{50};
18 std::string
const& header)
21 std::cout << header <<
": " <<
size(names) <<
'\n';
30 " -> 'trigger_paths' specified\n" :
34 " -> 'end_paths' specified\n" :
44 << header_rule(
'=') <<
'\n' 45 <<
"Trigger paths: " <<
size(trigger_paths) <<
'\n' 47 " -> 'trigger_paths' specified\n\n" :
49 if (
empty(trigger_paths)) {
53 std::string column_0{
"Path ID"};
54 std::string column_1{
"Path name"};
55 std::string column_2{
"Path size"};
57 auto column_0_width =
size(column_0);
58 auto column_1_width =
size(column_1);
59 for (
auto const& spec : trigger_paths | ::ranges::views::keys) {
60 column_1_width = std::max(column_1_width,
size(spec.name));
63 std::cout << column_0 <<
" " <<
std::left << std::setw(column_1_width)
64 << column_1 <<
" " << column_2 <<
'\n' 65 << std::string(column_0_width,
'-') <<
" " 66 << std::string(column_1_width,
'-') <<
" " 67 << std::string(
size(column_2),
'-') <<
'\n';
70 std::cout <<
std::right << std::setw(column_0_width)
73 <<
size(entries) <<
'\n';
78 auto const& end_paths = enabled_modules.
end_paths();
81 << header_rule(
'=') <<
'\n' 82 <<
"End paths: " <<
size(end_paths) <<
'\n' 84 " -> 'end_paths' specified\n\n" :
87 if (
empty(end_paths)) {
91 std::string column_1{
"Path name"};
92 std::string column_2{
"Path size"};
93 auto column_1_width =
size(column_1);
94 for (
auto const& spec : end_paths | ::ranges::views::keys) {
95 column_1_width = std::max(column_1_width,
size(spec.name));
98 std::cout <<
std::left << std::setw(column_1_width) << column_1 <<
" " 100 << std::string(column_1_width,
'-') <<
" " 101 << std::string(
size(column_2),
'-') <<
'\n';
102 for (
auto const& [
path_spec, entries] : end_paths) {
104 <<
" " <<
size(entries) <<
'\n';
112 std::cout <<
'\n' << header_rule(
'=') <<
'\n';
118 std::string column_1{
"Service name"};
119 auto column_1_width =
size(column_1);
120 auto column_2_width = std::string::size_type{};
121 for (
auto const& name : names) {
122 auto const service_provider =
123 pset.
get<std::string>(
fhicl_key(name,
"service_provider"), {});
124 column_1_width = std::max(column_1_width,
size(name));
125 column_2_width = std::max(column_2_width,
size(service_provider));
128 cet::HorizontalRule
const rule_1{column_1_width};
129 if (column_2_width == 0ull) {
130 std::cout << column_1 <<
'\n' << rule_1(
'-') <<
'\n';
131 for (
auto const& name : names) {
132 std::cout <<
std::left << std::setw(column_1_width) << name <<
'\n';
135 std::string
const column_2{
"service_provider"};
136 cet::HorizontalRule
const rule_2{std::max(column_2_width,
size(column_2))};
137 std::cout <<
std::left << std::setw(column_1_width) << column_1 <<
" " 139 << rule_1(
'-') <<
" " << rule_2(
'-') <<
'\n';
140 for (
auto const& name : names) {
141 auto const service_provider =
142 pset.
get<std::string>(
fhicl_key(name,
"service_provider"),
"-");
143 std::cout <<
std::left << std::setw(column_1_width) << name <<
" " 144 << service_provider <<
'\n';
151 std::string
const& header)
153 std::cout <<
'\n' << header_rule(
'=') <<
'\n';
162 std::string column_1{
"Module label"};
163 std::string column_2{
"module_type"};
164 auto column_1_width =
size(column_1);
165 auto column_2_width =
size(column_2);
166 for (
auto const& name : names) {
169 column_1_width = std::max(column_1_width,
size(name));
173 cet::HorizontalRule
const rule_1{column_1_width};
174 cet::HorizontalRule
const rule_2{column_2_width};
175 std::cout <<
std::left << std::setw(column_1_width) << column_1 <<
" " 177 << rule_1(
'-') <<
" " << rule_2(
'-') <<
'\n';
178 for (
auto const& name : names) {
181 std::cout <<
std::left << std::setw(column_1_width) << name <<
" " 188 std::string
const& verbosity,
191 auto const process_name = pset.
get<std::string>(
"process_name");
192 auto const source = pset.
get<std::string>(
"source.module_type");
200 std::cout <<
"Process name: " << process_name <<
'\n' 201 <<
"Source module: " << source <<
'\n';
202 if (verbosity ==
"brief") {
210 }
else if (verbosity ==
"detailed") {
212 std::cout <<
'\n' << header_rule(
'=') <<
'\n' <<
"Physics modules\n\n";
219 }
else if (verbosity ==
"full") {
229 <<
"Unrecognized configuration-summary verbosity level: '" << verbosity
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
void print_config_summary(fhicl::ParameterSet const &pset, std::string const &verbosity, EnabledModules const &enabled_modules)
void print_service_types(fhicl::ParameterSet const &pset)
void print_module_types(fhicl::ParameterSet const &pset, std::string const &header)
ModuleType module_type(std::string const &full_key)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
void print_table_numbers(fhicl::ParameterSet const &pset, std::string const &header)
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
module_entries_for_ordered_path_t end_paths() const noexcept
T get(std::string const &key) const
std::enable_if_t< std::is_convertible_v< T, std::string >, std::string > fhicl_key(T const &name)
module_entries_for_ordered_path_t const & trigger_path_specs() const noexcept
bool end_paths_override() const noexcept
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
bool trigger_paths_override() const noexcept
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
std::vector< std::string > get_names() const
void print_path_numbers(EnabledModules const &enabled_modules)
PathSpec path_spec(std::string const &path_spec)
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
void print_path_names(EnabledModules const &enabled_modules)