8#include "daq/storage/ONSENBinData.h"
14ONSENBinData::ONSENBinData(
void* buf) :
BinData(buf)
19ONSENBinData::~ONSENBinData() throw()
24unsigned int ONSENBinData::getTrigger()
const
26 return (ntohs(m_start_frame->trigger_hi) << 16)
27 + ntohs(m_start_frame->trigger_lo);
30unsigned 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);
39unsigned 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);
47unsigned int ONSENBinData::getTriggerType()
const
49 return (ntohs(m_start_frame->time_tag_lo_and_type) & 0xF);
52unsigned int ONSENBinData::getFrameNumber()
const
54 return ntohl(m_body[1]);
57unsigned 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)) {
71unsigned int ONSENBinData::getONSENMagic()
const
73 return ntohl(m_body[0]);
Abstract base class for different kinds of events.