6 #include "cetlib/filepath_maker.h" 23 auto const& process_name = raw_config.
get<std::string>(
"process_name");
24 if (process_name.empty()) {
26 <<
"Empty process_name not permitted.";
27 }
else if (process_name.find(
'_') != std::string::npos) {
29 <<
"Underscores not permitted in process_name: illegal value \"" 30 << process_name <<
"\"";
33 std::cerr <<
"INFO: using default process_name of \"DUMMY\".\n";
34 raw_config.
put(
"process_name",
"DUMMY");
41 std::string
const services{
"services"};
42 std::string
const service_provider{
"service_provider"};
43 auto const ciProvider =
44 fhicl_key(services,
"CatalogInterface", service_provider);
45 auto const ftProvider =
46 fhicl_key(services,
"FileTransfer", service_provider);
48 raw_config.
put(ciProvider,
"TrivialFileDelivery");
51 raw_config.
put(ftProvider,
"TrivialFileTransfer");
60 if (raw_config.
get<std::string>(
"source.module_type") ==
"EmptyEvent") {
62 <<
"Error: source files specified for EmptyEvent source.";
65 raw_config.
put(
"source.module_type",
"RootInput");
68 raw_config.
put(
"source.module_type",
"EmptyEvent");
70 if (raw_config.
get<std::string>(
"source.module_type") ==
"EmptyEvent" &&
74 raw_config.
put(
"source.maxEvents", 1);
80 std::string
const& table_spec)
82 if (!int_table.
exists(table_spec)) {
85 auto& top_table_val = int_table.
update(table_spec);
88 <<
"Unexpected non-table " << table_spec <<
".\n";
90 auto& table = int_table.
get<
table_t&>(table_spec);
91 for (
auto const& tval : table) {
92 if (tval.first.find(
'_') != std::string::npos) {
94 <<
"Module parameter set label \"" << tval.first <<
"\" is illegal: " 95 <<
"underscores are not permitted in module names.";
97 auto& table_val = int_table.
update(table_spec +
'.' + tval.first);
100 <<
"Unexpected non-table " << tval.first <<
" found in " << table_spec
103 int_table.
put(table_spec +
'.' + tval.first +
".module_label",
112 raw_config.
put(
"source.module_label",
"source");
114 injectModuleLabels(raw_config,
"outputs");
115 injectModuleLabels(raw_config,
"physics.producers");
116 injectModuleLabels(raw_config,
"physics.filters");
117 injectModuleLabels(raw_config,
"physics.analyzers");
122 std::string
const& table_spec,
123 std::vector<std::string>
const& excluded = {})
128 auto& top_table_val = raw_config.
update(table_spec);
131 <<
"Unexpected non-table " << table_spec <<
".\n";
133 auto& table = raw_config.
get<
table_t&>(table_spec);
134 for (
auto const& tval : table) {
135 auto& table_val = raw_config.
update(table_spec +
'.' + tval.first);
138 <<
"Unexpected non-table " << tval.first <<
" found in " << table_spec
141 if (std::find(excluded.cbegin(), excluded.cend(), tval.first) ==
143 raw_config.
put(table_spec +
'.' + tval.first +
".service_type",
152 std::vector<std::string>
const excluded{
"message",
"scheduler"};
153 injectServiceType(raw_config,
"services", excluded);
167 verifyProcessName(raw_config);
168 verifyInterfaces(raw_config);
169 verifySourceConfig(raw_config);
171 addModuleLabels(raw_config);
172 addServiceType(raw_config);
int doCheckOptions(bpo::variables_map const &vm) override
bool exists_outside_prolog(fhicl::intermediate_table const &config, std::string const &key)
int doProcessOptions(bpo::variables_map const &vm, fhicl::intermediate_table &raw_config) override
std::enable_if_t< std::is_convertible_v< T, std::string >, std::string > fhicl_key(T const &name)
shims::map< std::string, extended_value > table_t
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
cet::coded_exception< error, detail::translate > exception