00001 #ifndef RTMREADOUTFORMAT_RTMTRAITS_H 00002 #define RTMREADOUTFORMAT_RTMTRAITS_H 00003 00004 #include "DaqReadoutFormat/DaqTraits.h" 00005 00006 namespace DybDaq { 00007 00008 class RtmTraits : public DaqTraits 00009 { 00010 00011 public : 00012 00013 // The data component for this format. 00014 static const unsigned int kData; 00015 00016 // The RTM marker value 00017 static const unsigned int kRtmMarkerValue; 00018 00019 00020 // The field for RTM marker 00021 static const unsigned int kRtmMarker; 00022 00023 // The field for CF(Control FPGA) ID 00024 static const unsigned int kRpcCFId; 00025 00026 // The field for serial transfer error flag 00027 static const unsigned int kTransErr; 00028 00029 // The field for ROM almost full flag 00030 static const unsigned int kRomAlmostFull; 00031 00032 // The field for RTM almost full flag 00033 static const unsigned int kRtmAlmostFull; 00034 00035 // The field for RTM buffer full flag 00036 static const unsigned int kFullFlag; 00037 00038 // The field for GPS valid flag 00039 static const unsigned int kValidGPS; 00040 00041 // The field for Clock System Valid flag 00042 static const unsigned int kValidCLK; 00043 00044 // The field for Time Stamp type: UNIX or UTC 00045 static const unsigned int kUsingUTC; 00046 00047 // The field for time: second 00048 static const unsigned int kSecond; 00049 00050 // The field for time: nanosecond 00051 static const unsigned int kNanoSecond; 00052 00053 // The field for accumulation 00054 static const unsigned int kAccumulation; 00055 00056 // The field for the trigger form ROT 00057 static const unsigned int kTriggerRot; 00058 00059 // The field for the full trigger map 00060 static const unsigned int kTriggerMap; 00061 00062 00063 // Get the default Traits for a particular format 00064 static const RtmTraits& defaultTraits(); 00065 00066 // Get the suitable Traits for a particular format 00067 static const RtmTraits* readTraits(const char*& buffer); 00068 00069 // Get the Traits with a version number 00070 static const RtmTraits* getTraits(const unsigned int version); 00071 00072 // Destructor 00073 virtual ~RtmTraits(); 00074 00075 // Returns the size of RtmData 00076 virtual unsigned int rtmSize() const = 0; 00077 00078 // Initialize the RtmData buffer 00079 virtual void initializeRtm(char* buffer) const = 0; 00080 00081 // Returns the index value for an illegal header or field 00082 virtual unsigned int illegalMarker() const; 00083 virtual unsigned int illegalField() const; 00084 00085 00086 protected : 00087 00088 // Default constructor 00089 RtmTraits(); 00090 00091 00092 private : 00093 00094 // Suppressed by default 00095 RtmTraits(const RtmTraits&); 00096 RtmTraits& operator=(const RtmTraits&); 00097 00098 }; 00099 00100 } 00101 00102 #endif