51 flush_value(
char const level)
62 <<
"Action specifying flush or throw value does not correspond to " 69 throw_value(
char const level)
71 return flush_value(level) - 1;
77 if (
std::count(action.begin(), action.end(),
':') != 1u) {
79 <<
"The specified action for \"" << action <<
"\" must\n" 80 <<
"contain only one ':'.";
82 auto const level = action.substr(0, 1);
83 auto const symbol = action.substr(2);
86 <<
"The symbol for \"" << action <<
"\" is empty.\n" 87 <<
"Please provide a positive number, or the character 'f' or 't'.\n";
91 if (std::isalpha(symbol[0])) {
92 if (symbol.size() != 1ull) {
94 <<
"There must be only one character after the colon in \"" << action
96 <<
"Please either the character 'f' or 't'.\n";
100 return flush_value(level[0]);
102 return throw_value(level[0]);
105 <<
"The character specified for a symbol must be 'f' or 't'.\n";
110 return std::stoul(action.substr(2));
128 ,
pc_{isd.moduleDescription.processConfiguration()}
129 ,
fileNames_{
ps.get<std::vector<std::string>>(
"fileNames")}
132 std::unique_ptr<art::FileBlock>
136 return std::make_unique<art::FileBlock>(
153 if (action[0] ==
'r') {
154 auto const r = number(action);
159 }
else if (action[0] ==
's') {
160 auto const sr = number(action);
165 }
else if (action[0] ==
'e') {
166 auto const e = number(action);
176 <<
"Test pattern \"" << action <<
"\" not recognized.";
186 std::unique_ptr<art::RunPrincipal>
189 if (
run_.
run() == throw_value(
'r')) {
192 "There was an exception while reading a run from the input file."};
196 auto rp = std::make_unique<art::RunPrincipal>(aux,
pc_,
nullptr);
200 std::unique_ptr<art::SubRunPrincipal>
206 "There was an exception while reading a subrun from the input file."};
210 auto srp = std::make_unique<art::SubRunPrincipal>(aux,
pc_,
nullptr);
211 srp->setRunPrincipal(rp);
215 std::unique_ptr<art::EventPrincipal>
221 "There was an exception while reading an event from the input file."};
225 auto ep = std::make_unique<art::EventPrincipal>(aux,
pc_,
nullptr);
226 ep->setSubRunPrincipal(srp);
230 std::unique_ptr<art::RangeSetHandler>
233 return std::make_unique<art::OpenRangeSetHandler>(
run_.
run());
236 std::unique_ptr<art::RangeSetHandler>
239 return std::make_unique<art::OpenRangeSetHandler>(
subRun_.
run());
static constexpr EventID flushEvent() noexcept
std::unique_ptr< art::RunPrincipal > readRun() override
std::unique_ptr< art::SubRunPrincipal > readSubRun(cet::exempt_ptr< art::RunPrincipal const > rp) override
std::unique_ptr< art::RangeSetHandler > subRunRangeSetHandler() override
std::unique_ptr< art::RangeSetHandler > runRangeSetHandler() override
art::ProcessConfiguration const pc_
static constexpr RunID flushRun() noexcept
std::unique_ptr< art::EventPrincipal > readEvent(cet::exempt_ptr< art::SubRunPrincipal const > srp) override
std::vector< std::string > fileNames_
EventProcessorTestSource(fhicl::ParameterSet const &ps, art::InputSourceDescription &isd)
static constexpr double ps
void closeFile() override
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
static constexpr SubRunID flushSubRun() noexcept
decltype(auto) constexpr cbegin(T &&obj)
ADL-aware version of std::cbegin.
std::unique_ptr< art::FileBlock > readFile() override
EventNumber_t event() const
SubRunNumber_t subRun() const
static constexpr double sr
art::input::ItemType nextItemType() override