35 using namespace fhicl;
46 drisi_config().maxEvents()};
48 drisi_config().maxSubRuns()};
55 Name(
"timestampPlugin"),
57 "The 'timestampPlugin' parameter must be a FHiCL table\n" 59 " timestampPlugin: {\n" 60 " plugin_type: <plugin specification>\n" 63 "See the notes in art/Framework/Core/EmptyEventTimestampPlugin.h\n" 64 "for more details.")};
70 return {
"module_label"};
82 return numberEventsInRun_;
87 return numberEventsInSubRun_;
92 return eventCreationDelay_;
97 return numberEventsInThisRun_;
102 return numberEventsInThisSubRun_;
107 void setRunAndEventInfo();
108 std::unique_ptr<EventPrincipal> readEvent_()
override;
109 std::unique_ptr<SubRunPrincipal> readSubRun_()
override;
110 std::unique_ptr<RunPrincipal> readRun_()
override;
112 std::unique_ptr<RangeSetHandler> runRangeSetHandler()
override;
113 std::unique_ptr<RangeSetHandler> subRunRangeSetHandler()
override;
116 void rewind_()
override;
119 void endJob()
override;
121 void reallyReadEvent(
bool const lastEventInSubRun);
123 std::unique_ptr<EmptyEventTimestampPlugin> makePlugin_(
130 unsigned int numberEventsInThisRun_{};
131 unsigned int numberEventsInThisSubRun_{};
135 bool newSubRun_{
true};
136 bool subRunSet_{
false};
137 bool eventSet_{
false};
138 bool skipEventIncrement_{
true};
140 std::unique_ptr<EventPrincipal> ep_{};
143 std::unique_ptr<EmptyEventTimestampPlugin>
plugin_;
144 bool parentageEnabled_{
true};
145 bool rangesEnabled_{
true};
158 config().numberEventsInSubRun())}
169 bool haveFirstSubRun =
config().firstSubRun(firstSubRun);
171 bool haveFirstEvent =
config().firstEvent(firstEvent);
173 SubRunID firstSubRunID = haveFirstSubRun ?
183 std::unique_ptr<RunPrincipal>
191 auto rp_ptr = std::make_unique<RunPrincipal>(
200 std::unique_ptr<RangeSetHandler>
204 return std::make_unique<OpenRangeSetHandler>(
eventID_.
run());
207 std::unique_ptr<SubRunPrincipal>
211 return std::unique_ptr<SubRunPrincipal>{
nullptr};
216 auto srp_ptr = std::make_unique<SubRunPrincipal>(subRunAux,
230 std::unique_ptr<RangeSetHandler>
234 return std::make_unique<OpenRangeSetHandler>(
eventID_.
run());
237 std::unique_ptr<EventPrincipal>
241 return std::move(
ep_);
270 ep_ = std::make_unique<EventPrincipal>(eventAux,
275 std::make_shared<History>(),
276 std::make_unique<BranchMapper>(),
277 std::make_unique<NoDelayedReader>(),
281 std::unique_ptr<art::EmptyEventTimestampPlugin>
284 std::unique_ptr<art::EmptyEventTimestampPlugin>
result;
297 <<
"unrecognized plugin type " << pluginType <<
"for plugin " 304 <<
"Exception caught while processing plugin spec.\n";
312 for (; offset < 0; ++
offset) {
315 for (; offset > 0; --
offset) {
349 if (
ep_.get() !=
nullptr)
383 bool const lastEventInSubRun =
386 if (
ep_.get() ==
nullptr) {
std::unique_ptr< EventPrincipal > readEvent_() override
std::unique_ptr< EmptyEventTimestampPlugin > plugin_
EmptyEvent(Parameters const &config, InputSourceDescription &desc)
RunID const & runID() const
TableFragment< DRISI::Config > drisi_config
unsigned int numberEventsInThisRun_
void reallyReadEvent(bool const lastEventInSubRun)
std::unique_ptr< RunPrincipal > readRun_() override
static EventID firstEvent()
std::unique_ptr< EmptyEventTimestampPlugin > makePlugin_(OptionalDelegatedParameter const &maybeConfig)
std::string pluginType(std::string const &libspec)
static cet::exempt_ptr< Consumer > non_module_context()
EventID nextSubRun(EventNumber_t first=IDNumber< Level::Event >::first()) const
::xsd::cxx::tree::exception< char > exception
void setRunAndEventInfo()
unsigned int numberEventsInSubRun() const
std::unique_ptr< EventPrincipal > ep_
unsigned int numberEventsInThisRun() const
unsigned int numberEventsInRun_
unsigned int numberEventsInRun() const
std::unique_ptr< SubRunPrincipal > readSubRun_() override
SubRunID const & subRunID() const
std::unique_ptr< RangeSetHandler > runRangeSetHandler() override
T get(std::string const &key) const
std::unique_ptr< RangeSetHandler > subRunRangeSetHandler() override
cet::BasicPluginFactory pluginFactory_
IDNumber_t< Level::SubRun > SubRunNumber_t
void skip(int offset) override
unsigned int eventCreationDelay_
static SubRunID firstSubRun()
static constexpr Timestamp invalidTimestamp()
EventNumber_t event() const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
SubRunNumber_t subRun() const
bool get_if_present(T &t) const
std::set< std::string > operator()() const
std::enable_if_t<!std::is_function< RESULT_TYPE >::value, RESULT_TYPE > makePlugin(std::string const &libspec, ARGS &&...args)
IDNumber_t< Level::Event > EventNumber_t
assert(nhit_max >=nhit_nbins)
unsigned int eventCreationDelay() const
unsigned int numberEventsInThisSubRun() const
Service to store calibration data products (CDP) in the SQLite3 metadatabase of a file...
SubRunNumber_t subRun() const
unsigned int numberEventsInThisSubRun_
unsigned int numberEventsInSubRun_
art::input::ItemType getNextItemType() override
IDNumber_t< Level::Run > RunNumber_t