Belle II Software  release-08-01-10
ONSENBinData.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 _Belle2_ONSENBinData_h
9 #define _Belle2_ONSENBinData_h
10 
11 #include "daq/storage/BinData.h"
12 
13 namespace Belle2 {
19  class ONSENBinData : public BinData {
20 
21  private:
22  struct sose_frame_t {
23  unsigned short start; /* should be 0x5800 (no error), 0xD800 (error) */
24  unsigned short trigger_lo;
25  unsigned short trigger_hi;
26  unsigned short time_tag_lo_and_type;
27  unsigned short time_tag_mid;
28  unsigned short time_tag_hi;
29  unsigned short frame_counter;
30  unsigned int crc32;
31  };
32 
33  public:
34  static const unsigned int MAX_PXD_FRAMES = 256;
35  static const unsigned int MAGIC = 0xBEBAFECA;
36 
37  public:
38  ONSENBinData(void* buf);
39  ~ONSENBinData() throw();
40 
41  public:
42  unsigned int getTrigger() const;
43  unsigned int getTimetag() const;
44  unsigned int getTriggerType() const;
45  unsigned int getEventNumber() const;
46  unsigned int getFrameNumber() const;
47  unsigned int getFrameByteSize() const;
48  unsigned int getONSENMagic() const;
49 
50  private:
51  unsigned int* m_magic;
52  unsigned int* m_framenr;
53  unsigned int* m_length_of_frame;
54  mutable sose_frame_t* m_start_frame;
55 
56  };
57 
59 }
60 
61 #endif
Abstract base class for different kinds of events.