00001 #ifndef _ots_DataDecoder_h_ 00002 #define _ots_DataDecoder_h_ 00003 00004 #include "otsdaq-core/DataDecoders/TriggerData.h" 00005 #include "otsdaq-core/DataDecoders/BCOData.h" 00006 #include "otsdaq-core/DataDecoders/DetectorDataBase.h" 00007 #include "otsdaq-core/DataDecoders/FSSRData.h" 00008 #include "otsdaq-core/DataDecoders/VIPICData.h" 00009 #include "otsdaq-core/DataDecoders/PSI46DigData.h" 00010 #include "otsdaq-core/DataDecoders/PSI46Data.h" 00011 #include <string> 00012 #include <queue> 00013 #include <stdint.h> 00014 00015 namespace ots 00016 { 00017 00018 class DataDecoder 00019 { 00020 public: 00021 DataDecoder(void); 00022 virtual ~DataDecoder(void); 00023 00024 void convertBuffer (const std::string& buffer,std::queue<uint32_t>& convertedBuffer, bool invert); 00025 uint32_t convertBuffer (const std::string& buffer,unsigned int bufferIndex, bool invert); 00026 bool isBCOHigh (uint32_t data); 00027 bool isBCOLow (uint32_t data); 00028 bool isTriggerLow (uint32_t data); 00029 bool isTriggerHigh (uint32_t data); 00030 bool isFSSRData (uint32_t data); 00031 bool isVIPICData (uint32_t data); 00032 bool isPSI46DigData (uint32_t data); 00033 bool isPSI46Data (uint32_t data); 00034 uint64_t mergeBCOHighAndLow (uint32_t dataBCOHigh, uint32_t dataBCOLow); 00035 uint64_t mergeTriggerHighAndLow(uint32_t dataBCOHigh, uint32_t dataBCOLow); 00036 void insertBCOHigh (uint64_t& bco, uint32_t dataBCOHigh); 00037 void insertBCOLow (uint64_t& bco, uint32_t dataBCOLow); 00038 void decodeData (uint32_t data, DetectorDataBase** decodedData); 00039 00040 protected: 00041 std::string name_; 00042 TriggerData triggerDataDecoder_; 00043 BCOData bcoDataDecoder_; 00044 FSSRData FSSRDataDecoder_; 00045 VIPICData VIPICDataDecoder_; 00046 PSI46DigData PSI46DigDataDecoder_; 00047 PSI46Data PSI46DataDecoder_; 00048 00049 }; 00050 00051 } 00052 00053 #endif