9 #include <daq/rawdata/modules/DeSerializerPXD.h>
27 setDescription(
"Receives PXD-Data from ONSEN (or a simulator) and stores it as RawPXD in Data Store");
30 addParam(
"Ports", m_ports,
"default port number");
31 addParam(
"Hosts", m_hosts,
"default host names");
33 m_compressionLevel = 0;
34 m_buffer =
new int[MAXEVTSIZE];
37 B2DEBUG(0,
"DeSerializerPXDModule: Constructor done.");
41 DeSerializerPXDModule::~DeSerializerPXDModule()
46 void DeSerializerPXDModule::initialize()
48 if (m_hosts.size() != m_ports.size()) {
49 B2ERROR(
"DeSerializerPXDModule: Parameter error. Hosts and Ports need the same number of entries!");
50 DeSerializerPXDModule::terminate();
55 for (
int i = 0; i < (int)(m_hosts.size()); i++) {
60 m_eventMetaDataPtr.registerInDataStore();
63 rawpxdary.registerInDataStore();
65 B2DEBUG(0,
"DeSerializerPXDModule: initialized.");
68 void DeSerializerPXDModule::beginRun()
70 B2DEBUG(0,
"beginRun called.");
73 void DeSerializerPXDModule::event()
78 for (
auto& it : m_recvs) {
80 stat = it->recv_pxd_buffer((
char*)m_buffer);
82 B2INFO(
"DeserializerPXD Socket failed: stat = " << stat);
83 DeSerializerPXDModule::endRun();
84 DeSerializerPXDModule::terminate();
90 rawpxdary.appendNew(m_buffer, stat);
97 m_eventMetaDataPtr.create();
98 m_eventMetaDataPtr->setExperiment(1);
99 m_eventMetaDataPtr->setRun(1);
100 m_eventMetaDataPtr->setEvent(m_nEvents);
107 void DeSerializerPXDModule::endRun()
111 B2DEBUG(0,
"endRun done.");
115 void DeSerializerPXDModule::terminate()
117 B2INFO(
"terminate called");
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.