#include "BasicSourceOptionsHandler.h"
Definition at line 14 of file BasicSourceOptionsHandler.h.
art::BasicSourceOptionsHandler::BasicSourceOptionsHandler |
( |
bpo::options_description & |
desc | ) |
|
|
explicit |
Definition at line 12 of file BasicSourceOptionsHandler.cc.
15 bpo::options_description source_options{
"Source options"};
17 source_options.add_options()
19 bpo::value<std::vector<std::string>>()->composing(),
20 "Source data file (multiple OK); precludes -S.")
22 bpo::value<std::string>(),
23 "file containing a list of source files to read, one per line; " 26 bpo::value<std::string>(),
27 "EventID of first event to process (e.g. '1:2:4' starts event " 28 "processing at run 1, subrun2, event 4).")
29 (
"nevts,n", bpo::value<int>(),
"Number of events to process.")
30 (
"nskip", bpo::value<unsigned long>(),
"Number of events to skip.");
32 desc.add(source_options);
int art::OptionsHandler::checkOptions |
( |
bpo::variables_map const & |
vm | ) |
|
|
inherited |
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 42 of file BasicSourceOptionsHandler.cc.
References art::detail::event_start(), processSourceListArg_(), and fhicl::intermediate_table::put().
46 std::vector<std::string> source_list;
47 if (vm.count(
"source")) {
48 source_list = vm[
"source"].as<std::vector<std::string>>();
52 if (source_list.size() > 0 || have_source_list_file) {
54 raw_config.
put(
"source.fileNames", source_list);
56 if (vm.count(
"nevts")) {
57 raw_config.
put(
"source.maxEvents", vm[
"nevts"].as<int>());
59 if (vm.count(
"estart")) {
60 auto const [run, subRun,
event] =
62 raw_config.
put(
"source.firstRun", run);
63 raw_config.
put(
"source.firstSubRun", subRun);
64 raw_config.
put(
"source.firstEvent",
event);
66 if (vm.count(
"nskip")) {
67 raw_config.
put(
"source.skipEvents", vm[
"nskip"].as<unsigned long>());
std::tuple< RunNumber_t, SubRunNumber_t, EventNumber_t > event_start(std::string const &str_num)
Event finding and building.
bool processSourceListArg_(bpo::variables_map const &vm, std::vector< std::string > &source_list)
Definition at line 60 of file OptionsHandler.cc.
References art::OptionsHandler::doProcessOptions().
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 73 of file BasicSourceOptionsHandler.cc.
References art::errors::Configuration, and art::detail::fillSourceList().
Referenced by doProcessOptions().
77 bool result = !!vm.count(
"source-list");
79 if (!source_list.empty()) {
81 <<
"--source-list (-S) and --source (-s) or non-option arguments are " 82 <<
"incompatible due to ordering ambiguities.\n";
84 auto const filename = vm[
"source-list"].as<std::string>();
85 std::ifstream flist{filename};
88 <<
"Specified source-list file \"" << filename
89 <<
"\" 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: