00001 #ifndef DataFormats_SiPixelRawDataError_h 00002 #define DataFormats_SiPixelRawDataError_h 00003 00004 //--------------------------------------------------------------------------- 00012 //--------------------------------------------------------------------------- 00013 00014 #include "FWCore/Utilities/interface/typedefs.h" 00015 00016 #include <string> 00017 #include <stdint.h> 00018 00019 class SiPixelRawDataError { 00020 public: 00021 00023 SiPixelRawDataError(); 00025 SiPixelRawDataError(cms_uint32_t errorWord32, const int errorType, int fedId); 00027 SiPixelRawDataError(cms_uint64_t errorWord64, const int errorType, int fedId); 00029 ~SiPixelRawDataError(); 00030 00031 void setWord32(cms_uint32_t errorWord32); // function to allow user to input the error word (if 32-bit) after instantiation 00032 void setWord64(cms_uint64_t errorWord64); // function to allow user to input the error word (if 64-bit) after instantiation 00033 void setType(int errorType); // function to allow user to input the error type after instantiation 00034 void setFedId(int fedId); // function to allow user to input the fedID after instantiation 00035 void setMessage(); // function to create an error message based on errorType 00036 00037 inline cms_uint32_t getWord32() const {return errorWord32_;} // the 32-bit word that contains the error information 00038 inline cms_uint64_t getWord64() const {return errorWord64_;} // the 64-bit word that contains the error information 00039 inline int getType() const {return errorType_;} // the number associated with the error type (26-31 for ROC number errors, 32-33 for calibration errors) 00040 inline int getFedId() const {return fedId_;} // the fedId where the error occured 00041 inline std::string getMessage() const {return errorMessage_;} // the error message to be displayed with the error 00042 00043 private: 00044 00045 cms_uint32_t errorWord32_; 00046 cms_uint64_t errorWord64_; 00047 int errorType_; 00048 int fedId_; 00049 std::string errorMessage_; 00050 00051 }; 00052 00053 // Comparison operators 00054 inline bool operator<( const SiPixelRawDataError& one, const SiPixelRawDataError& other) { 00055 return one.getFedId() < other.getFedId(); 00056 } 00057 00058 #endif