Belle II Software  release-08-01-10
DataStorePackage.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 #ifndef DATASTOREPACKAGE_H
9 #define DATASTOREPACKAGE_H
10 
11 #include <framework/datastore/StoreArray.h>
12 #include <framework/pcore/DataStoreStreamer.h>
13 
14 #include <daq/slc/system/Mutex.h>
15 #include <rawdata/dataobjects/RawPXD.h>
16 
17 #include "daq/storage/BinData.h"
18 
19 namespace Belle2 {
26 
27  public:
28  static const unsigned int MAX_BUFFER_WORDS = 10000000;
29 
30  private:
31  static Mutex g_mutex;
32  static bool g_init;
33  enum ETObjectBits {
34  c_IsTransient = BIT(19),
35  c_IsNull = BIT(20)
36  };
37 
38  public:
39  DataStorePackage(DataStoreStreamer* streamer, int eb2, unsigned int serial = 0)
40  : m_serial(serial)
41  {
42  m_streamer = streamer;
43  m_buf = new int [MAX_BUFFER_WORDS];
44  m_data.setBuffer(m_buf);
45  m_data_hlt.setBuffer(NULL);
46  m_data_pxd.setBuffer(NULL);
47  m_eb2 = eb2;
48  }
50  {
51  delete[] m_buf;
52  }
53 
54  public:
55  bool restore();
56  unsigned int getSerial() const { return m_serial; }
57  void setSerial(unsigned int serial) { m_serial = serial; }
58  const BinData& getData() const { return m_data; }
59  const BinData& getHLTData() const { return m_data_hlt; }
60  const BinData& getPXDData() const { return m_data_pxd; }
61 
62  private:
63  unsigned int m_serial;
64  BinData m_data;
65  BinData m_data_hlt;
66  BinData m_data_pxd;
67  int* m_buf;
68  int m_eb2;
69  //DataStoreStreamer m_streamer;
70  DataStoreStreamer* m_streamer;
71  StoreArray<RawPXD> m_rawpxdary;
72  //StoreArray<SndHdrTemp> m_sndhdrary;
73 
74  };
75 
77 }
78 
79 #endif
Stream/restore DataStore objects to/from EvtMessage.
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Abstract base class for different kinds of events.