CMS 3D CMS Logo

RPixErrorChecker.h
Go to the documentation of this file.
1 #ifndef CTPPS_CTPPSRawToDigi_RPixErrorChecker_h
2 #define CTPPS_CTPPSRawToDigi_RPixErrorChecker_h
3 
9 
10 #include <vector>
11 #include <map>
12 
13 class FEDRawData;
14 
16 
18 public:
19  typedef uint32_t Word32;
20  typedef uint64_t Word64;
21 
22  typedef std::vector<CTPPSPixelDataError> DetErrors;
23  typedef std::map<uint32_t, DetErrors> Errors;
24 
25  static constexpr int CRC_bits = 1;
26  static constexpr int ROC_bits = 5;
27  static constexpr int DCOL_bits = 5;
28  static constexpr int PXID_bits = 8;
29  static constexpr int ADC_bits = 8;
30  static constexpr int OMIT_ERR_bits = 1;
31 
32  static constexpr int CRC_shift = 2;
33  static constexpr int ADC_shift = 0;
34  static constexpr int PXID_shift = ADC_shift + ADC_bits;
35  static constexpr int DCOL_shift = PXID_shift + PXID_bits;
36  static constexpr int ROC_shift = DCOL_shift + DCOL_bits;
37  static constexpr int OMIT_ERR_shift = 20;
38 
39  static constexpr Word32 dummyDetId = 0xffffffff;
40 
41  static constexpr Word64 CRC_mask = ~(~RPixErrorChecker::Word64(0) << CRC_bits);
42  static constexpr Word32 ERROR_mask = ~(~RPixErrorChecker::Word32(0) << ROC_bits);
44 
45 public:
47 
48  void setErrorStatus(bool errorStatus);
49 
50  bool checkCRC(bool& errorsInEvent, int fedId, const Word64* trailer, Errors& errors) const;
51 
52  bool checkHeader(bool& errorsInEvent, int fedId, const Word64* header, Errors& errors) const;
53 
54  bool checkTrailer(bool& errorsInEvent, int fedId, unsigned int nWords, const Word64* trailer, Errors& errors) const;
55 
56  bool checkROC(bool& errorsInEvent, int fedId, uint32_t iD, const Word32& errorWord, Errors& errors) const;
57 
58  void conversionError(int fedId, uint32_t iD, const State& state, const Word32& errorWord, Errors& errors) const;
59 
60 private:
62 };
63 
64 #endif
bool checkHeader(bool &errorsInEvent, int fedId, const Word64 *header, Errors &errors) const
static constexpr int OMIT_ERR_shift
static constexpr int CRC_shift
static constexpr int DCOL_shift
bool checkCRC(bool &errorsInEvent, int fedId, const Word64 *trailer, Errors &errors) const
bool checkTrailer(bool &errorsInEvent, int fedId, unsigned int nWords, const Word64 *trailer, Errors &errors) const
static constexpr int ROC_bits
bool checkROC(bool &errorsInEvent, int fedId, uint32_t iD, const Word32 &errorWord, Errors &errors) const
static constexpr int ADC_bits
std::map< uint32_t, DetErrors > Errors
static constexpr Word32 OMIT_ERR_mask
std::vector< CTPPSPixelDataError > DetErrors
static constexpr int ADC_shift
static constexpr int DCOL_bits
static constexpr int PXID_bits
void setErrorStatus(bool errorStatus)
unsigned long long uint64_t
Definition: Time.h:13
static constexpr int OMIT_ERR_bits
void conversionError(int fedId, uint32_t iD, const State &state, const Word32 &errorWord, Errors &errors) const
static constexpr Word32 dummyDetId
static constexpr int CRC_bits
static constexpr Word32 ERROR_mask
Definition: errors.py:1
static constexpr Word64 CRC_mask
static constexpr int ROC_shift
static constexpr int PXID_shift