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