8 #include "daq/storage/ONSENBinData.h"
10 #include <arpa/inet.h>
14 ONSENBinData::ONSENBinData(
void* buf) :
BinData(buf)
19 ONSENBinData::~ONSENBinData() throw()
24 unsigned int ONSENBinData::getTrigger()
const
26 return (ntohs(m_start_frame->trigger_hi) << 16)
27 + ntohs(m_start_frame->trigger_lo);
30 unsigned int ONSENBinData::getTimetag()
const
33 ((uint64_t)ntohs(m_start_frame->time_tag_hi) << 32)
34 | ((uint64_t)ntohs(m_start_frame->time_tag_mid) << 16)
35 | (uint64_t)ntohs(m_start_frame->time_tag_lo_and_type);
39 unsigned int ONSENBinData::getEventNumber()
const
41 unsigned int nframe = getFrameNumber();
42 if (nframe > MAX_PXD_FRAMES)
return 0;
43 m_start_frame =
reinterpret_cast<sose_frame_t*
>(m_body + nframe + 2);
47 unsigned int ONSENBinData::getTriggerType()
const
49 return (ntohs(m_start_frame->time_tag_lo_and_type) & 0xF);
52 unsigned int ONSENBinData::getFrameNumber()
const
54 return ntohl(m_body[1]);
57 unsigned int ONSENBinData::getFrameByteSize()
const
59 const unsigned int nframe = getFrameNumber();
60 unsigned int nbyte = 0;
61 for (
unsigned int i = 0; i < nframe; i++) {
62 nbyte += ntohl(m_body[2 + i]);
64 if (m_body[2 + nframe] != ntohs(0x3000)) {
71 unsigned int ONSENBinData::getONSENMagic()
const
73 return ntohl(m_body[0]);
Abstract base class for different kinds of events.