14#include <dqm/analysis/modules/DQMHistAnalysisOutputRelayMsg.h>
41 B2DEBUG(20,
"DQMHistAnalysisOutputRelayMsg: Constructor done.");
51 B2DEBUG(20,
"DQMHistAnalysisOutputRelayMsg: initialized.");
57 B2DEBUG(20,
"DQMHistAnalysisOutputRelayMsg: beginRun called.");
63 B2DEBUG(20,
"DQMHistAnalysisOutputRelayMsg: event called.");
64 TMessage mess(kMESS_OBJECT);
66 TSeqCollection* seq = gROOT->GetListOfCanvases();
72 strftime(mbstr,
sizeof(mbstr),
"%F %T", localtime(&now));
75 int sent_canvases = 0;
77 B2INFO(
"[" << mbstr <<
"] before sending " << seq->GetEntries() <<
" objects.");
78 bool first_try =
true;
79 while ((obj = (TObject*)nextkey())) {
80 if (obj->IsA()->InheritsFrom(
"TCanvas")) {
81 TCanvas* c = (TCanvas*) obj;
84 auto it = clist.find(c->GetName());
85 if (it != clist.end()) {
86 process_canvas = it->second;
88 if (!process_canvas)
continue;
93 if (
m_sock->Send(mess) < 0) {
103 if (
m_sock->Send(mess) < 0) {
111 strftime(mbstr,
sizeof(mbstr),
"%F %T", localtime(&now));
112 B2INFO(
"[" << mbstr <<
"] after sending " << sent_canvases <<
" of " << seq->GetEntries() <<
" objects.");
117 B2DEBUG(20,
"DQMHistAnalysisOutputRelayMsg: endRun called");
123 B2DEBUG(20,
"DQMHistAnalysisOutputRelayMsg: terminate called");
The base class for the histogram analysis module.
static const CanvasUpdatedList & getCanvasUpdatedList()
Get the list of the canvas update status.
void initialize() override final
Initializer.
~DQMHistAnalysisOutputRelayMsgModule()
Destructor.
TSocket * m_sock
The socket to the canvas server.
DQMHistAnalysisOutputRelayMsgModule()
Constructor.
int m_port
The port of the canvas server.
void terminate() override final
This method is called at the end of the event processing.
void event() override final
This method is called for each event.
bool m_canvasSendDefault
Send untagged canvas by default.
void endRun() override final
This method is called if the current run ends.
void beginRun() override final
Called when entering a new run.
std::string m_hostname
The hostname of the canvas server.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.