otsdaq  v1_01_02
 All Classes Namespaces Functions
DataDecoder.h
1 #ifndef _ots_DataDecoder_h_
2 #define _ots_DataDecoder_h_
3 
4 #include "otsdaq-core/DataDecoders/TriggerData.h"
5 #include "otsdaq-core/DataDecoders/BCOData.h"
6 #include "otsdaq-core/DataDecoders/DetectorDataBase.h"
7 #include "otsdaq-core/DataDecoders/FSSRData.h"
8 #include "otsdaq-core/DataDecoders/VIPICData.h"
9 #include "otsdaq-core/DataDecoders/PSI46DigData.h"
10 #include "otsdaq-core/DataDecoders/PSI46Data.h"
11 #include <string>
12 #include <queue>
13 #include <stdint.h>
14 
15 namespace ots
16 {
17 
19 {
20 public:
21  DataDecoder(void);
22  virtual ~DataDecoder(void);
23 
24  void convertBuffer (const std::string& buffer,std::queue<uint32_t>& convertedBuffer, bool invert);
25  uint32_t convertBuffer (const std::string& buffer,unsigned int bufferIndex, bool invert);
26  bool isBCOHigh (uint32_t data);
27  bool isBCOLow (uint32_t data);
28  bool isTriggerLow (uint32_t data);
29  bool isTriggerHigh (uint32_t data);
30  bool isFSSRData (uint32_t data);
31  bool isVIPICData (uint32_t data);
32  bool isPSI46DigData (uint32_t data);
33  bool isPSI46Data (uint32_t data);
34  uint64_t mergeBCOHighAndLow (uint32_t dataBCOHigh, uint32_t dataBCOLow);
35  uint64_t mergeTriggerHighAndLow(uint32_t dataBCOHigh, uint32_t dataBCOLow);
36  void insertBCOHigh (uint64_t& bco, uint32_t dataBCOHigh);
37  void insertBCOLow (uint64_t& bco, uint32_t dataBCOLow);
38  void decodeData (uint32_t data, DetectorDataBase** decodedData);
39 
40 protected:
41  std::string name_;
42  TriggerData triggerDataDecoder_;
43  BCOData bcoDataDecoder_;
44  FSSRData FSSRDataDecoder_;
45  VIPICData VIPICDataDecoder_;
46  PSI46DigData PSI46DigDataDecoder_;
47  PSI46Data PSI46DataDecoder_;
48 
49 };
50 
51 }
52 
53 #endif