6 #include "cetlib/container_algorithms.h" 7 #include "cetlib/filepath_maker.h" 26 auto const& process_name = raw_config.
get<std::string>(
"process_name");
27 if (process_name.empty()) {
29 <<
"Empty process_name not permitted.";
30 }
else if (process_name.find(
'_') != std::string::npos) {
32 <<
"Underscores not permitted in process_name: illegal value \"" 33 << process_name <<
"\"";
36 std::cerr <<
"INFO: using default process_name of \"DUMMY\".\n";
37 raw_config.
put(
"process_name",
"DUMMY");
44 std::string
const services{
"services"};
45 std::string
const service_provider{
"service_provider"};
46 auto ciProvider =
fhicl_key(services,
"CatalogInterface", service_provider);
47 auto ftProvider =
fhicl_key(services,
"FileTransfer", service_provider);
49 raw_config.
put(ciProvider,
"TrivialFileDelivery");
52 raw_config.
put(ftProvider,
"TrivialFileTransfer");
61 if (raw_config.
get<std::string>(
"source.module_type") ==
"EmptyEvent") {
63 <<
"Error: source files specified for EmptyEvent source.";
66 raw_config.
put(
"source.module_type",
"RootInput");
69 raw_config.
put(
"source.module_type",
"EmptyEvent");
71 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);
172 raw_config.
update(
"trigger_paths.trigger_paths") =
173 raw_config.
find(
"physics.trigger_paths");
176 addModuleLabels(raw_config);
177 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
shims::map< std::string, extended_value > table_t
std::enable_if_t< std::is_convertible< T, std::string >::value, std::string > fhicl_key(T const &name)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
cet::coded_exception< error, detail::translate > exception