Belle II Software  release-08-01-10
StorageStreamHelper.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 #include <framework/pcore/zmq/utils/StreamHelper.h>
10 #include <framework/pcore/zmq/messages/ZMQNoIdMessage.h>
11 #include <framework/datastore/StoreObjPtr.h>
12 #include <framework/datastore/StoreArray.h>
13 
14 #include <rawdata/dataobjects/RawFTSW.h>
15 #include <rawdata/dataobjects/RawTLU.h>
16 #include <rawdata/dataobjects/RawCDC.h>
17 #include <rawdata/dataobjects/RawSVD.h>
18 #include <rawdata/dataobjects/RawECL.h>
19 #include <rawdata/dataobjects/RawARICH.h>
20 #include <rawdata/dataobjects/RawTOP.h>
21 #include <rawdata/dataobjects/RawKLM.h>
22 #include <rawdata/dataobjects/RawTRG.h>
23 #include <rawdata/dataobjects/RawCOPPER.h>
24 #include <rawdata/dataobjects/RawPXD.h>
25 #include <tracking/dataobjects/ROIpayload.h>
26 #include <tracking/dataobjects/ROIid.h>
27 #include <framework/dataobjects/EventMetaData.h>
28 #include <mdst/dataobjects/SoftwareTriggerResult.h>
29 #include <hlt/softwaretrigger/dataobjects/SoftwareTriggerVariables.h>
30 #include <mdst/dataobjects/TRGSummary.h>
31 
32 #include <string>
33 #include <memory>
34 
35 #include <framework/pcore/DataStoreStreamer.h>
36 #include <daq/storage/BinData.h>
37 
38 #include <framework/dataobjects/EventT0.h>
39 #include <hlt/dataobjects/OnlineEventT0.h>
40 
41 namespace Belle2 {
49  public:
51  void initialize();
52 
53  /*
55  std::unique_ptr<ZMQNoIdMessage> stream(bool addPersistentDurability, bool streamTransientObjects);
56 
58  std::unique_ptr<ZMQNoIdMessage> streamRaw();
59 
61  std::unique_ptr<ZMQNoIdMessage> streamHistograms(bool compressed = true);
62  */
63 
65  void read(std::unique_ptr<ZMQNoIdMessage> message);
66 
68  void registerStoreObjects(bool addExpressRecoObjects);
69 
70  private:
73  DataStoreStreamer* m_streamer;
74 
77  BinData m_data_hlt;
78  BinData m_data_pxd;
79  int* m_buf;
80  int m_eb2 = 1;
81 
102 
105 
108 
121 
123  std::vector<char> m_outputBuffer;
125  unsigned int m_maximalCompressedSize = 100'000'000;
126 
127  /*
129  zmq::message_t getROIMessageIfViable() const;
130  */
131  };
133 }
Stream/restore DataStore objects to/from EvtMessage.
Helper class for data store serialization.
StoreArray< RawCDC > m_rawCDCs
Store Objects for HLT use.
StoreObjPtr< EventT0 > m_eventT0
StoreArray of EventT0.
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.
std::vector< char > m_outputBuffer
Temporary buffer for storing the compressed result.
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.
unsigned int m_maximalCompressedSize
Maximal size of the compression buffer.
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.
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Helper class for data store serialization.
Definition: StreamHelper.h:23
Abstract base class for different kinds of events.