00001 #ifndef ErrorChecker_H 00002 #define ErrorChecker_H 00003 00008 #include "DataFormats/SiPixelRawData/interface/SiPixelRawDataError.h" 00009 00010 #include <boost/cstdint.hpp> 00011 #include <vector> 00012 #include <map> 00013 00014 class FEDRawData; 00015 00016 class SiPixelFrameConverter; 00017 00018 class ErrorChecker { 00019 00020 public: 00021 typedef unsigned int Word32; 00022 typedef long long Word64; 00023 typedef std::vector<SiPixelRawDataError> DetErrors; 00024 typedef std::map<uint32_t, DetErrors> Errors; 00025 00026 ErrorChecker(); 00027 00028 void setErrorStatus(bool ErrorStatus); 00029 00030 bool checkCRC(bool& errorsInEvent, int fedId, const Word64* trailer, Errors& errors); 00031 00032 bool checkHeader(bool& errorsInEvent, int fedId, const Word64* header, Errors& errors); 00033 00034 bool checkTrailer(bool& errorsInEvent, int fedId, int nWords, const Word64* trailer, Errors& errors); 00035 00036 bool checkROC(bool& errorsInEvent, int fedId, const SiPixelFrameConverter* converter, 00037 Word32& errorWord, Errors& errors); 00038 00039 void conversionError(int fedId, const SiPixelFrameConverter* converter, 00040 int status, Word32& errorWord, Errors& errors); 00041 00042 private: 00043 bool includeErrors; 00044 00045 uint32_t errorDetId(const SiPixelFrameConverter* converter, 00046 int errorType, const Word32 & word) const; 00047 00048 static const int LINK_bits, ROC_bits, DCOL_bits, PXID_bits, ADC_bits; 00049 static const int LINK_shift, ROC_shift, DCOL_shift, PXID_shift, ADC_shift; 00050 static const uint32_t dummyDetId; 00051 }; 00052 00053 #endif