#include "BasicSourceOptionsHandler.h"
Definition at line 14 of file BasicSourceOptionsHandler.h.
art::BasicSourceOptionsHandler::BasicSourceOptionsHandler |
( |
bpo::options_description & |
desc | ) |
|
|
explicit |
Definition at line 15 of file BasicSourceOptionsHandler.cc.
References art::add_opt(), and fhicl::detail::atom::value().
18 bpo::options_description source_options{
"Source options"};
19 auto options = source_options.add_options();
22 bpo::value<std::vector<std::string>>()->composing(),
23 "Source data file (multiple OK); precludes -S.");
26 bpo::value<std::string>(),
27 "file containing a list of source files to read, one per line; " 31 bpo::value<unsigned long>(),
32 "Event # of first event to process.");
34 options,
"nevts,n", bpo::value<int>(),
"Number of events to process.");
36 options,
"nskip", bpo::value<unsigned long>(),
"Number of events to skip.");
37 desc.add(source_options);
void add_opt(T &t, Args &&...args)
std::string value(boost::any const &)
int art::OptionsHandler::checkOptions |
( |
bpo::variables_map const & |
vm | ) |
|
|
inherited |
Definition at line 51 of file OptionsHandler.cc.
53 std::string
const thisClass(cet::demangle_symbol(
typeid(*this).name()));
54 return exceptionCatcher([&vm,
this] {
return doCheckOptions(vm); },
55 thisClass +
"::doCheckOptions()",
virtual int doCheckOptions(bpo::variables_map const &vm)=0
int art::BasicSourceOptionsHandler::doCheckOptions |
( |
bpo::variables_map const & |
vm | ) |
|
|
overrideprivatevirtual |
int art::BasicSourceOptionsHandler::doProcessOptions |
( |
bpo::variables_map const & |
vm, |
|
|
fhicl::intermediate_table & |
raw_config |
|
) |
| |
|
overrideprivatevirtual |
Implements art::OptionsHandler.
Definition at line 47 of file BasicSourceOptionsHandler.cc.
References processSourceListArg_(), and fhicl::intermediate_table::put().
51 std::vector<std::string> source_list;
52 if (vm.count(
"source")) {
53 cet::copy_all(vm[
"source"].as<std::vector<std::string>>(),
54 std::back_inserter(source_list));
58 if (source_list.size() > 0 || have_source_list_file) {
60 raw_config.
put(
"source.fileNames", source_list);
62 if (vm.count(
"nevts")) {
63 raw_config.
put(
"source.maxEvents", vm[
"nevts"].as<int>());
65 if (vm.count(
"estart")) {
66 raw_config.
put(
"source.firstEvent", vm[
"estart"].as<unsigned long>());
68 if (vm.count(
"nskip")) {
69 raw_config.
put(
"source.skipEvents", vm[
"nskip"].as<unsigned long>());
bool processSourceListArg_(bpo::variables_map const &vm, std::vector< std::string > &source_list)
Definition at line 60 of file OptionsHandler.cc.
Referenced by art::run_art_string_config().
63 std::string
const thisClass(cet::demangle_symbol(
typeid(*this).name()));
64 return exceptionCatcher(
66 thisClass +
"::doProcessOptions()",
virtual int doProcessOptions(bpo::variables_map const &vm, fhicl::intermediate_table &raw_config)=0
bool art::BasicSourceOptionsHandler::processSourceListArg_ |
( |
bpo::variables_map const & |
vm, |
|
|
std::vector< std::string > & |
source_list |
|
) |
| |
|
private |
Definition at line 75 of file BasicSourceOptionsHandler.cc.
References art::errors::Configuration, and art::detail::fillSourceList().
Referenced by doProcessOptions().
79 bool result = !!vm.count(
"source-list");
81 if (source_list.size()) {
83 <<
"--source-list (-S) and --source (-s) or non-option arguments are " 84 <<
"incompatible due to ordering ambiguities.\n";
86 std::ifstream flist(vm[
"source-list"].as<std::string>().c_str());
89 <<
"Specified source-list file \"" 90 << vm[
"source-list"].as<std::string>() <<
"\" cannot be read.\n";
void fillSourceList(std::istream &ifs, std::vector< std::string > &source_list)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
The documentation for this class was generated from the following files: