1 #include "artdaq/Application/DataLoggerApp.hh"
2 #include "artdaq/Application/DataLoggerCore.hh"
3 #include "artdaq-core/Utilities/ExceptionHandler.hh"
21 if (DataLogger_ptr_.get() == 0)
25 external_request_status_ = DataLogger_ptr_->initialize(pset);
26 if (!external_request_status_)
28 report_string_ =
"Error initializing ";
29 report_string_.append(name_ +
" ");
30 report_string_.append(
"with ParameterSet = \"" + pset.to_string() +
"\".");
33 return external_request_status_;
39 external_request_status_ = DataLogger_ptr_->start(
id);
40 if (!external_request_status_)
42 report_string_ =
"Error starting ";
43 report_string_.append(name_ +
" ");
44 report_string_.append(
"for run 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_ = DataLogger_ptr_->stop();
56 if (!external_request_status_)
58 report_string_ =
"Error stopping ";
59 report_string_.append(name_ +
".");
62 return external_request_status_;
68 external_request_status_ = DataLogger_ptr_->pause();
69 if (!external_request_status_)
71 report_string_ =
"Error pausing ";
72 report_string_.append(name_ +
".");
75 return external_request_status_;
81 external_request_status_ = DataLogger_ptr_->resume();
82 if (!external_request_status_)
84 report_string_ =
"Error resuming ";
85 report_string_.append(name_ +
".");
88 return external_request_status_;
94 external_request_status_ = DataLogger_ptr_->shutdown();
95 if (!external_request_status_)
97 report_string_ =
"Error shutting down ";
98 report_string_.append(name_ +
".");
101 return external_request_status_;
116 std::string resultString;
119 if (which ==
"transition_status")
121 if (report_string_.length() > 0) {
return report_string_; }
122 else {
return "Success"; }
134 if (DataLogger_ptr_.get() != 0)
136 resultString.append(DataLogger_ptr_->report(which));
140 resultString.append(
"This DataLogger has not yet been initialized and ");
141 resultString.append(
"therefore can not provide reporting.");
bool do_initialize(fhicl::ParameterSet const &pset, uint64_t, uint64_t) override
Initialize the DataLoggerCore.
bool do_shutdown(uint64_t) override
Shutdown the DataLoggerCore.
bool do_soft_initialize(fhicl::ParameterSet const &, uint64_t, uint64_t) override
Soft-initialize the DataLoggerCore. No-Op.
bool do_resume(uint64_t, uint64_t) override
Resume the DataLoggerCore.
bool do_pause(uint64_t, uint64_t) override
Pause the DataLoggerCore.
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 &, uint64_t, uint64_t) override
Reinitialize the DataLoggerCore. No-Op.
DataLoggerApp(int rank, std::string name)
DataLoggerApp Constructor.
bool do_start(art::RunID id, uint64_t, uint64_t) override
Start the DataLoggerCore.
bool do_stop(uint64_t, uint64_t) override
Stop the DataLoggerCore.
DataLoggerCore implements the state machine for the DataLogger artdaq application. DataLoggerCore processes incoming events in one of three roles: Data Logger, Online Monitor, or Dispatcher.