1 #include "daq/storage/ONSENBinData.h"
7 ONSENBinData::ONSENBinData(
void* buf) :
BinData(buf)
12 ONSENBinData::~ONSENBinData() throw()
17 unsigned int ONSENBinData::getTrigger()
const
19 return (ntohs(m_start_frame->trigger_hi) << 16)
20 + ntohs(m_start_frame->trigger_lo);
23 unsigned int ONSENBinData::getTimetag()
const
26 ((uint64_t)ntohs(m_start_frame->time_tag_hi) << 32)
27 | ((uint64_t)ntohs(m_start_frame->time_tag_mid) << 16)
28 | (uint64_t)ntohs(m_start_frame->time_tag_lo_and_type);
32 unsigned int ONSENBinData::getEventNumber()
const
34 unsigned int nframe = getFrameNumber();
35 if (nframe > MAX_PXD_FRAMES)
return 0;
36 m_start_frame = (sose_frame_t*)(m_body + nframe + 2);
40 unsigned int ONSENBinData::getTriggerType()
const
42 return (ntohs(m_start_frame->time_tag_lo_and_type) & 0xF);
45 unsigned int ONSENBinData::getFrameNumber()
const
47 return ntohl(m_body[1]);
50 unsigned int ONSENBinData::getFrameByteSize()
const
52 const unsigned int nframe = getFrameNumber();
53 unsigned int nbyte = 0;
54 for (
unsigned int i = 0; i < nframe; i++) {
55 nbyte += ntohl(m_body[2 + i]);
57 if (m_body[2 + nframe] != ntohs(0x3000)) {
64 unsigned int ONSENBinData::getONSENMagic()
const
66 return ntohl(m_body[0]);