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
RPixErrorChecker::dummyDetId
static constexpr Word32 dummyDetId
Definition: RPixErrorChecker.h:39
RPixErrorChecker::Word64
uint64_t Word64
Definition: RPixErrorChecker.h:20
RPixErrorChecker::includeErrors_
bool includeErrors_
Definition: RPixErrorChecker.h:61
RPixErrorChecker::DCOL_bits
static constexpr int DCOL_bits
Definition: RPixErrorChecker.h:27
Unknown
Definition: RPixErrorChecker.h:15
RPixErrorChecker::PXID_bits
static constexpr int PXID_bits
Definition: RPixErrorChecker.h:28
RPixErrorChecker::ROC_shift
static constexpr int ROC_shift
Definition: RPixErrorChecker.h:36
RPixErrorChecker::setErrorStatus
void setErrorStatus(bool errorStatus)
Definition: RPixErrorChecker.cc:14
FEDRawData
Definition: FEDRawData.h:19
RPixErrorChecker::OMIT_ERR_bits
static constexpr int OMIT_ERR_bits
Definition: RPixErrorChecker.h:30
RPixErrorChecker::conversionError
void conversionError(int fedId, uint32_t iD, const State &state, const Word32 &errorWord, Errors &errors) const
Definition: RPixErrorChecker.cc:134
errors
Definition: errors.py:1
RPixErrorChecker::PXID_shift
static constexpr int PXID_shift
Definition: RPixErrorChecker.h:34
RPixErrorChecker::CRC_bits
static constexpr int CRC_bits
Definition: RPixErrorChecker.h:25
InvalidPixelId
Definition: RPixErrorChecker.h:15
InvalidLinkId
Definition: RPixErrorChecker.h:15
RPixErrorChecker::CRC_shift
static constexpr int CRC_shift
Definition: RPixErrorChecker.h:32
CTPPSPixelDataError.h
RPixErrorChecker::ERROR_mask
static constexpr Word32 ERROR_mask
Definition: RPixErrorChecker.h:42
RPixErrorChecker::checkHeader
bool checkHeader(bool &errorsInEvent, int fedId, const Word64 *header, Errors &errors) const
Definition: RPixErrorChecker.cc:29
RPixErrorChecker::CRC_mask
static constexpr Word64 CRC_mask
Definition: RPixErrorChecker.h:41
InvalidROCId
Definition: RPixErrorChecker.h:15
RPixErrorChecker::RPixErrorChecker
RPixErrorChecker()
Definition: RPixErrorChecker.cc:12
State
State
Definition: RPixErrorChecker.h:15
RPixErrorChecker::ROC_bits
static constexpr int ROC_bits
Definition: RPixErrorChecker.h:26
RPixErrorChecker::OMIT_ERR_shift
static constexpr int OMIT_ERR_shift
Definition: RPixErrorChecker.h:37
RPixErrorChecker::ADC_bits
static constexpr int ADC_bits
Definition: RPixErrorChecker.h:29
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:89
RPixErrorChecker
Definition: RPixErrorChecker.h:17
RPixErrorChecker::checkROC
bool checkROC(bool &errorsInEvent, int fedId, uint32_t iD, const Word32 &errorWord, Errors &errors) const
Definition: RPixErrorChecker.cc:68
RPixErrorChecker::checkCRC
bool checkCRC(bool &errorsInEvent, int fedId, const Word64 *trailer, Errors &errors) const
Definition: RPixErrorChecker.cc:16
RPixErrorChecker::DCOL_shift
static constexpr int DCOL_shift
Definition: RPixErrorChecker.h:35
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
RPixErrorChecker::OMIT_ERR_mask
static constexpr Word32 OMIT_ERR_mask
Definition: RPixErrorChecker.h:43
RPixErrorChecker::Word32
uint32_t Word32
Definition: RPixErrorChecker.h:19
RPixErrorChecker::ADC_shift
static constexpr int ADC_shift
Definition: RPixErrorChecker.h:33
RPixErrorChecker::DetErrors
std::vector< CTPPSPixelDataError > DetErrors
Definition: RPixErrorChecker.h:22
RPixErrorChecker::checkTrailer
bool checkTrailer(bool &errorsInEvent, int fedId, unsigned int nWords, const Word64 *trailer, Errors &errors) const
Definition: RPixErrorChecker.cc:45
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:291
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
RPixErrorChecker::Errors
std::map< uint32_t, DetErrors > Errors
Definition: RPixErrorChecker.h:23