1 #include "artdaq/Application/EventBuilderApp.hh"
14 external_request_status_ =
true;
21 if (event_builder_ptr_.get() == 0)
24 external_request_status_ = event_builder_ptr_->initialize(pset);
26 if (! external_request_status_)
28 report_string_ =
"Error initializing an EventBuilderCore named";
29 report_string_.append(name_ +
" with ");
30 report_string_.append(
"ParameterSet = \"" + pset.to_string() +
"\".");
33 return external_request_status_;
39 external_request_status_ = event_builder_ptr_->start(
id);
40 if (! external_request_status_)
42 report_string_ =
"Error starting ";
43 report_string_.append(name_ +
" for run ");
44 report_string_.append(
"number ");
45 report_string_.append(boost::lexical_cast<std::string>(
id.run()));
46 report_string_.append(
".");
49 return external_request_status_;
55 external_request_status_ = event_builder_ptr_->stop();
56 if (! external_request_status_)
58 report_string_ =
"Error stopping ";
59 report_string_.append(name_ +
".");
61 return external_request_status_;
67 external_request_status_ = event_builder_ptr_->pause();
68 if (! external_request_status_)
70 report_string_ =
"Error pausing ";
71 report_string_.append(name_ +
".");
74 return external_request_status_;
80 external_request_status_ = event_builder_ptr_->resume();
81 if (! external_request_status_)
83 report_string_ =
"Error resuming ";
84 report_string_.append(name_ +
".");
87 return external_request_status_;
93 external_request_status_ = event_builder_ptr_->shutdown();
94 if (! external_request_status_)
96 report_string_ =
"Error shutting down ";
97 report_string_.append(name_ +
".");
99 return external_request_status_;
105 external_request_status_ = event_builder_ptr_->soft_initialize(pset);
106 if (! external_request_status_)
108 report_string_ =
"Error soft-initializing ";
109 report_string_.append(name_ +
" with ");
110 report_string_.append(
"ParameterSet = \"" + pset.to_string() +
"\".");
112 return external_request_status_;
118 external_request_status_ = event_builder_ptr_->reinitialize(pset);
119 if (! external_request_status_)
121 report_string_ =
"Error reinitializing ";
122 report_string_.append(name_ +
" with ");
123 report_string_.append(
"ParameterSet = \"" + pset.to_string() +
"\".");
125 return external_request_status_;
130 TLOG_DEBUG(name_ +
"App") <<
"Booted state entry action called." << TLOG_ENDL;
141 std::string resultString;
144 if (which ==
"transition_status")
146 if (report_string_.length() > 0) {
return report_string_; }
147 else {
return "Success"; }
159 if (event_builder_ptr_.get() !=
nullptr)
161 resultString.append(event_builder_ptr_->report(which));
165 resultString.append(
"This EventBuilder has not yet been initialized and ");
166 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.