8#include <daq/hbasf2/utils/StorageStreamHelper.h>
9#include <framework/pcore/zmq/messages/ZMQMessageFactory.h>
10#include <framework/pcore/MsgHandler.h>
11#include <daq/dataobjects/SendHeader.h>
12#include <daq/dataobjects/SendTrailer.h>
16#include <TDirectory.h>
21#include <TBufferJSON.h>
26#include <daq/storage/ONSENBinData.h>
34 m_buf =
new int [10000000];
36 m_data_hlt.setBuffer(NULL);
37 m_data_pxd.setBuffer(NULL);
56 if (addExpressRecoObjects) {
63 m_rois.registerInDataStore(
"ROIs");
71 if (message->isMessage(EMessageTypes::c_eventMessage)) {
72 B2DEBUG(10,
"EMessageTypes::c_eventMessage: begin");
74 B2DEBUG(10,
"EMessageTypes::c_eventMessage: end");
75 }
else if (message->isMessage(EMessageTypes::c_rawDataMessage)) {
76 B2DEBUG(10,
"EMessageTypes::c_rawDataMessage");
77 int* eventBuffer = message->getMessagePart<1>().data<int>();
79 m_data.setBuffer(eventBuffer);
81 int nboard =
m_data.getNBoard();
90 m_data_hlt.setBuffer(
m_data.getBody());
93 if (msg->
type() == MSG_TERMINATE) {
94 B2INFO(
"Got Termination message");
102 unsigned int offset = m_data_hlt.getWordSize() +
m_data.getHeaderWordSize();
103 for (
int i = 0; i < nboard - 1; i++) {
104 m_data_pxd.setBuffer(
m_data.getBuffer() + offset);
105 offset += m_data_pxd.getWordSize();
106 if (m_data_pxd.getBody()[0] != ONSENBinData::MAGIC) {
107 B2FATAL(
"Bad ONSEN magic for PXD = " << m_data_pxd.getTrailerMagic());
109 }
else if (m_data_pxd.getTrailerMagic() != BinData::TRAILER_MAGIC) {
110 B2FATAL(
"Bad tarailer magic for PXD = " << m_data_pxd.getTrailerMagic());
113 if (m_data_pxd.getBuffer() != NULL) {
114 m_rawPXDs.appendNew((
int*)m_data_pxd.getBody(), m_data_pxd.getBodyByteSize());
118 m_data_pxd.setBuffer(NULL);
Stream/restore DataStore objects to/from EvtMessage.
int restoreDataStore(EvtMessage *msg)
Restore DataStore objects from EvtMessage.
@ c_DontWriteOut
Object/array should be NOT saved by output modules.
Class to manage streamed object.
ERecordType type() const
Get record type.
StoreArray< RawCDC > m_rawCDCs
Store Objects for HLT use.
void initialize()
Initialize this class. Call this e.g. in the first event.
void read(std::unique_ptr< ZMQNoIdMessage > message)
Read in a ZMQ message and rebuilt the data store from it.
StoreArray< RawTOP > m_rawTOPs
Store Objects for HLT use.
StoreArray< RawKLM > m_rawKLMs
Store Objects for HLT use.
StoreArray< ROIid > m_rois
Additional Store Objects for ExpressReco use.
StoreArray< RawSVD > m_rawSVDs
Store Objects for HLT use.
BinData m_data
Decoding input.
StoreArray< RawPXD > m_rawPXDs
Additional Store Objects for ExpressReco use.
StoreObjPtr< EventMetaData > m_eventMetaData
Store Objects for HLT use.
StoreObjPtr< TRGSummary > m_triggerSummary
Additional Store Objects for ExpressReco use.
StoreArray< RawFTSW > m_rawFTSWs
Store Objects for HLT use.
StoreArray< OnlineEventT0 > m_onlineEventT0
StoreArray of OnlineEventT0.
void registerStoreObjects(bool addExpressRecoObjects)
Register all needed store objects, either only the raw data, ROIs and event meta data (for HLT) or ad...
StreamHelper m_streamHelper
We use the framework stream helper.
StoreArray< RawECL > m_rawECLs
Store Objects for HLT use.
StoreArray< RawTRG > m_rawTRGs
Store Objects for HLT use.
StoreArray< RawARICH > m_rawARICHs
Store Objects for HLT use.
StoreObjPtr< SoftwareTriggerResult > m_softwareTriggerResult
Additional Store Objects for ExpressReco use.
StoreObjPtr< RandomGenerator > m_randomGenerator
Additional Store Objects for ExpressReco use.
StoreObjPtr< SoftwareTrigger::SoftwareTriggerVariables > m_softwareTriggerVariables
Additional Store Objects for ExpressReco use.
StoreObjPtr< ROIpayload > m_roiPayload
Store Objects for HLT use.
void read(std::unique_ptr< ZMQNoIdMessage > message)
Read in a ZMQ message and rebuilt the data store from it.
Abstract base class for different kinds of events.