9 #include <dqm/analysis/modules/DQMHistAnalysisOutputNSM.h>
11 #include <daq/slc/nsm/NSMNotConnectedException.h>
12 #include <daq/slc/runcontrol/RCNode.h>
14 #include <daq/slc/system/PThread.h>
16 #include <daq/slc/base/ConfigFile.h>
17 #include <daq/slc/base/StringUtil.h>
35 const std::string& rcnodename)
50 printf(
"node %s is not online\n",
m_rcnode.getName().c_str());
52 printf(
"NSM error %s\n", e.what());
83 addParam(
"NSMNodeName", m_nodename,
"NSM node name for DQM Hist analyser",
string(
"DQMH"));
84 addParam(
"RunControlName", m_rcnodename,
"NSM node name of the run control",
string(
""));
85 B2DEBUG(1,
"DQMHistAnalysisOutputNSM: Constructor done.");
89 DQMHistAnalysisOutputNSMModule::~DQMHistAnalysisOutputNSMModule() { }
91 void DQMHistAnalysisOutputNSMModule::initialize()
94 if (m_callback !=
nullptr)
delete m_callback;
96 int port = config.getInt(
"nsm.port");
97 std::string host = config.get(
"nsm.host");
100 B2INFO(
"DQMHistAnalysisOutputNSM: initialized.");
103 void DQMHistAnalysisOutputNSMModule::beginRun()
108 void DQMHistAnalysisOutputNSMModule::event()
110 static bool initialized =
false;
116 for (ParamTypeList::iterator i = parnames.begin(); i != parnames.end(); ++i) {
117 std::string pname = i->first;
118 std::string vname = StringUtil::replace(pname,
"/",
".");
121 m_callback->add(
new NSMVHandlerInt(vname,
true,
false, vints[pname]));
127 m_callback->add(
new NSMVHandlerText(vname,
true,
false, texts[pname]));
133 for (ParamTypeList::iterator i = parnames.begin(); i != parnames.end(); ++i) {
134 std::string pname = i->first;
135 std::string vname = StringUtil::replace(pname,
"/",
".");
138 m_callback->set(vname, vints[pname]);
141 m_callback->set(vname, vfloats[pname]);
144 m_callback->set(vname, texts[pname]);
151 void DQMHistAnalysisOutputNSMModule::endRun()
153 B2INFO(
"DQMHistAnalysisOutputNSM : endRun called");
157 void DQMHistAnalysisOutputNSMModule::terminate()
159 B2INFO(
"terminate called");
The class for the NSM callback.
DQMHistAnalysisCallback(const std::string &nodename, const std::string &rcnodename)
The constructor.
virtual void timouet(NSMCommunicator &)
The timeout function for the NSM communication.
RCNode m_rcnode
The RC NSM node.
std::map< std::string, int > IntValueList
The type of list of integer module parameter.
std::map< std::string, float > FloatValueList
The type of list of float module parameter.
std::map< std::string, EParamType > ParamTypeList
The type of list of module parameter types.
std::map< std::string, std::string > TextList
The type of list of string module parameter.
Class definition for the output module of Sequential ROOT I/O.
The module to output values to NSM network.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.