1 #include "artdaq/Application/EventBuilderApp.hh"
16 external_request_status_ =
true;
23 if (event_builder_ptr_.get() == 0)
26 external_request_status_ = event_builder_ptr_->initialize(pset);
28 if (! external_request_status_)
30 report_string_ =
"Error initializing an EventBuilderCore named";
31 report_string_.append(app_name +
" with ");
32 report_string_.append(
"ParameterSet = \"" + pset.to_string() +
"\".");
35 return external_request_status_;
41 external_request_status_ = event_builder_ptr_->start(
id);
42 if (! external_request_status_)
44 report_string_ =
"Error starting ";
45 report_string_.append(app_name +
" for run ");
46 report_string_.append(
"number ");
47 report_string_.append(boost::lexical_cast<std::string>(
id.run()));
48 report_string_.append(
".");
51 return external_request_status_;
57 external_request_status_ = event_builder_ptr_->stop();
58 if (! external_request_status_)
60 report_string_ =
"Error stopping ";
61 report_string_.append(app_name +
".");
63 return external_request_status_;
69 external_request_status_ = event_builder_ptr_->pause();
70 if (! external_request_status_)
72 report_string_ =
"Error pausing ";
73 report_string_.append(app_name +
".");
76 return external_request_status_;
82 external_request_status_ = event_builder_ptr_->resume();
83 if (! external_request_status_)
85 report_string_ =
"Error resuming ";
86 report_string_.append(app_name +
".");
89 return external_request_status_;
95 external_request_status_ = event_builder_ptr_->shutdown();
96 if (! external_request_status_)
98 report_string_ =
"Error shutting down ";
99 report_string_.append(app_name +
".");
101 return external_request_status_;
107 external_request_status_ = event_builder_ptr_->soft_initialize(pset);
108 if (! external_request_status_)
110 report_string_ =
"Error soft-initializing ";
111 report_string_.append(app_name +
" with ");
112 report_string_.append(
"ParameterSet = \"" + pset.to_string() +
"\".");
114 return external_request_status_;
120 external_request_status_ = event_builder_ptr_->reinitialize(pset);
121 if (! external_request_status_)
123 report_string_ =
"Error reinitializing ";
124 report_string_.append(app_name +
" with ");
125 report_string_.append(
"ParameterSet = \"" + pset.to_string() +
"\".");
127 return external_request_status_;
132 TLOG_DEBUG(app_name +
"App") <<
"Booted state entry action called." << TLOG_ENDL;
143 std::string resultString;
146 if (which ==
"transition_status")
148 if (report_string_.length() > 0) {
return report_string_; }
149 else {
return "Success"; }
161 if (event_builder_ptr_.get() !=
nullptr)
163 resultString.append(event_builder_ptr_->report(which));
167 resultString.append(
"This EventBuilder has not yet been initialized and ");
168 resultString.append(
"therefore can not provide reporting.");
bool do_resume(uint64_t, uint64_t) override
Resume the EventBuilderCore.
void BootedEnter() override
Action taken upon entering the "Booted" state.
std::string report(std::string const &which) const override
If which is "transition_status", report the status of the last transition. Otherwise pass through to ...
bool do_reinitialize(fhicl::ParameterSet const &pset, uint64_t, uint64_t) override
Reinitialize the EventBuilderCore.
bool do_shutdown(uint64_t) override
Shutdown the EventBuilderCore.
bool do_pause(uint64_t, uint64_t) override
Pause the EventBuilderCore.
bool do_soft_initialize(fhicl::ParameterSet const &pset, uint64_t, uint64_t) override
Soft-Initialize the EventBuilderCore.
EventBuilderApp(int rank, std::string name)
EventBuilderApp Constructor.
bool do_initialize(fhicl::ParameterSet const &pset, uint64_t, uint64_t) override
Initialize the EventBuilderCore.
bool do_start(art::RunID id, uint64_t, uint64_t) override
Start the EventBuilderCore.
EventBuilderCore implements the state machine for the EventBuilder artdaq application. EventBuilderCore receives Fragment objects from the DataReceiverManager, and sends them to the EventStore.
bool do_stop(uint64_t, uint64_t) override
Stop the EventBuilderCore.