File indexing completed on 2024-04-06 12:04:01
0001 #ifndef DataFormats_CTPPSPixelDataError_h
0002 #define DataFormats_CTPPSPixelDataError_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "FWCore/Utilities/interface/typedefs.h"
0013
0014 #include <string>
0015 #include <array>
0016 #include <cstdint>
0017
0018 class CTPPSPixelDataError {
0019 public:
0020
0021 CTPPSPixelDataError();
0022
0023 CTPPSPixelDataError(uint32_t errorWord32, const int errorType, int fedId);
0024
0025 CTPPSPixelDataError(uint64_t errorWord64, const int errorType, int fedId);
0026
0027 ~CTPPSPixelDataError();
0028
0029
0030 inline uint32_t errorWord32() const { return errorWord32_; }
0031
0032 inline uint64_t errorWord64() const { return errorWord64_; }
0033
0034 inline int errorType() const { return errorType_; }
0035
0036 inline int fedId() const { return fedId_; }
0037
0038 inline const std::string& errorMessage() const {
0039 if (errorType_ >= 25 && errorType_ <= 37)
0040 return errorMessages_[errorType_ - 24];
0041 return errorMessages_[0];
0042 }
0043
0044 private:
0045 static const std::array<std::string, 14> errorMessages_;
0046
0047 uint64_t errorWord64_;
0048 uint32_t errorWord32_;
0049 int errorType_;
0050 int fedId_;
0051 };
0052
0053
0054 inline bool operator<(const CTPPSPixelDataError& one, const CTPPSPixelDataError& other) {
0055 return one.fedId() < other.fedId();
0056 }
0057
0058 #endif