9 #include <daq/expreco/modules/ReceiveEvent.h>
32 setDescription(
"Receive Event from ExpReco");
35 addParam(
"Host", m_host,
"Receiver host",
string(
"expreco"));
36 addParam(
"Port", m_port,
"Receiver Port", 7111);
38 m_compressionLevel = 0;
41 B2INFO(
"Rx: Constructor done.");
45 ReceiveEventModule::~ReceiveEventModule()
49 void ReceiveEventModule::initialize()
52 gSystem->Load(
"libdataobjects");
63 B2FATAL(
"Did not receive any data, stopping initialization.");
66 m_streamer->restoreDataStore(msg);
73 B2INFO(
"Rx initialized.");
77 void ReceiveEventModule::beginRun()
79 B2INFO(
"beginRun called.");
83 void ReceiveEventModule::event()
87 if (m_nrecv == 0)
return;
92 printf(
"Connection is closed. Reconnecting.\n");
95 int rstat = (m_recv->sock())->reconnect(nrepeat);
103 B2INFO(
"Rx: got an event from Socket, size=" << msg->
size());
105 if (msg->
type() == MSG_TERMINATE) {
106 B2INFO(
"Rx: got termination message. Exitting....");
113 m_streamer->restoreDataStore(msg);
114 B2INFO(
"Rx: DataStore Restored!!");
122 void ReceiveEventModule::endRun()
126 B2INFO(
"endRun done.");
130 void ReceiveEventModule::terminate()
132 B2INFO(
"terminate called");
Stream/restore DataStore objects to/from EvtMessage.
Class to manage streamed object.
ERecordType type() const
Get record type.
int size() const
Get size of message including headers.
A class definition of an input module for Sequential ROOT I/O.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.