1 #include "artdaq/DAQdata/Globals.hh"
2 #include "artdaq-core/Data/Fragment.hh"
3 #include "artdaq-core/Utilities/ExceptionHandler.hh"
5 #include "artdaq-utilities/Plugins/MetricManager.hh"
6 #include "cetlib/container_algorithms.h"
7 #include "cetlib/filepath_maker.h"
8 #include "fhiclcpp/ParameterSet.h"
9 #include "fhiclcpp/make_ParameterSet.h"
10 #include <boost/program_options.hpp>
16 #include "artdaq/Application/DispatcherApp.hh"
17 #include "artdaq/ExternalComms/MakeCommanderPlugin.hh"
18 #include "artdaq/Application/LoadParameterSet.hh"
19 #include "artdaq/BuildInfo/GetPackageBuildInfo.hh"
21 int main(
int argc,
char * argv[])
23 artdaq::configureMessageFacility(
"datalogger");
25 fhicl::ParameterSet config = LoadParameterSet(argc, argv);
27 std::string name = config.get<std::string>(
"application_name",
"Dispatcher");
28 auto rank = config.get<
int>(
"rank", 0);
29 TLOG_DEBUG(name +
"Main") <<
"Setting application name to " << name << TLOG_ENDL;
31 TLOG_DEBUG(name +
"Main") <<
"artdaq version " <<
36 artdaq::setMsgFacAppName(name, config.get<
int>(
"id"));
41 auto auto_run = config.get<
bool>(
"auto_run",
false);
43 int run = config.get<
int>(
"run_number", 101);
44 uint64_t timeout = config.get<uint64_t>(
"transition_timeout", 30);
45 uint64_t timestamp = 0;
47 dl_app.do_initialize(config, timeout, timestamp);
48 dl_app.do_start(art::RunID(run), timeout, timestamp);
50 TLOG_INFO(name) <<
"Running XMLRPC Commander. To stop, either Control-C or " << std::endl
51 <<
"xmlrpc http://`hostname`:" << config.get<
int>(
"id") <<
"/RPC2 daq.stop" << std::endl
52 <<
"xmlrpc http://`hostname`:" << config.get<
int>(
"id") <<
"/RPC2 daq.shutdown" << TLOG_ENDL;
56 commander->run_server();
DispatcherApp is an artdaq::Commandable derived class which controls the DispatcherCore.
static artdaq::PackageBuildInfo getPackageBuildInfo()
Gets the version number and build timestmap for artdaq.
std::unique_ptr< artdaq::CommanderInterface > MakeCommanderPlugin(const fhicl::ParameterSet &commander_pset, artdaq::Commandable &commandable)
Load a CommanderInterface plugin.