8#include "daq/storage/modules/DataStorePackage.h"
9#include "daq/storage/ONSENBinData.h"
11#include <framework/logging/Logger.h>
13#include <framework/datastore/StoreArray.h>
14#include <rawdata/dataobjects/RawPXD.h>
20bool DataStorePackage::restore()
23 int nboard = m_data.getNBoard();
24 if (m_eb2 == 0 && nboard == 1) {
25 m_data_hlt.setBuffer(m_data.getBuffer());
26 }
else if (m_eb2 > 0 || nboard > 1) {
27 m_data_hlt.setBuffer(m_data.getBody());
30 if (m_data_hlt.getBuffer() == NULL || m_data_hlt.getTrailerMagic() != BinData::TRAILER_MAGIC) {
32 B2FATAL(
"Bad tarailer magic for HLT = " << m_data_hlt.getTrailerMagic()
33 <<
" count = " << count);
36 if (msg->
type() == MSG_TERMINATE) {
37 B2INFO(
"Got Termination message");
45 unsigned int offset = m_data_hlt.getWordSize() + m_data.getHeaderWordSize();
46 for (
int i = 0; i < nboard - 1; ++i) {
47 m_data_pxd.setBuffer(m_data.getBuffer() + offset);
48 offset += m_data_pxd.getWordSize();
49 if (m_data_pxd.getBody()[0] != ONSENBinData::MAGIC) {
50 B2FATAL(
"Bad ONSEN magic for PXD = " << m_data_pxd.getTrailerMagic());
52 }
else if (m_data_pxd.getTrailerMagic() != BinData::TRAILER_MAGIC) {
53 B2FATAL(
"Bad tarailer magic for PXD = " << m_data_pxd.getTrailerMagic());
56 if (m_data_pxd.getBuffer() != NULL) {
57 m_rawpxdary.appendNew((
int*)m_data_pxd.getBody(), m_data_pxd.getBodyByteSize());
62 m_data_pxd.setBuffer(NULL);
int restoreDataStore(EvtMessage *msg)
Restore DataStore objects from EvtMessage.
Class to manage streamed object.
ERecordType type() const
Get record type.
Abstract base class for different kinds of events.