CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
ErrorCheckerBase Class Referenceabstract

#include <ErrorCheckerBase.h>

Inheritance diagram for ErrorCheckerBase:
ErrorChecker ErrorCheckerPhase0

Public Member Functions

bool checkCRC (bool &errorsInEvent, int fedId, const Word64 *trailer, SiPixelFormatterErrors &errors) const
 
bool checkHeader (bool &errorsInEvent, int fedId, const Word64 *header, SiPixelFormatterErrors &errors) const
 
virtual bool checkROC (bool &errorsInEvent, int fedId, const SiPixelFrameConverter *converter, const SiPixelFedCabling *theCablingTree, Word32 &errorWord, SiPixelFormatterErrors &errors) const =0
 
bool checkTrailer (bool &errorsInEvent, int fedId, unsigned int nWords, const Word64 *trailer, SiPixelFormatterErrors &errors) const
 
void conversionError (int fedId, const SiPixelFrameConverter *converter, int status, Word32 &errorWord, SiPixelFormatterErrors &errors) const
 
 ErrorCheckerBase ()
 
void setErrorStatus (bool ErrorStatus)
 
virtual ~ErrorCheckerBase ()=default
 

Protected Member Functions

void addErrorToCollectionDummy (int errorType, int fedId, Word64 word, SiPixelFormatterErrors &errors) const
 
virtual cms_uint32_t errorDetId (const SiPixelFrameConverter *converter, int errorType, const Word32 &word) const =0
 
int getConversionErrorTypeAndIssueLogMessage (int status, int fedId) const
 

Protected Attributes

bool includeErrors_
 

Detailed Description

Definition at line 14 of file ErrorCheckerBase.h.

Constructor & Destructor Documentation

ErrorCheckerBase::ErrorCheckerBase ( )

Definition at line 21 of file ErrorCheckerBase.cc.

21 : includeErrors_(false) {}
virtual ErrorCheckerBase::~ErrorCheckerBase ( )
virtualdefault

Member Function Documentation

void ErrorCheckerBase::addErrorToCollectionDummy ( int  errorType,
int  fedId,
Word64  word,
SiPixelFormatterErrors errors 
) const
protected

Definition at line 25 of file ErrorCheckerBase.cc.

References sipixelconstants::dummyDetId, relativeConstraints::error, and includeErrors_.

Referenced by checkCRC(), checkHeader(), and checkTrailer().

28  {
29  if (includeErrors_) {
30  SiPixelRawDataError error(word, errorType, fedId);
31  errors[sipixelconstants::dummyDetId].push_back(error);
32  }
33 }
constexpr cms_uint32_t dummyDetId
uint64_t word
Pixel error – collection of errors and error information.
bool ErrorCheckerBase::checkCRC ( bool &  errorsInEvent,
int  fedId,
const Word64 trailer,
SiPixelFormatterErrors errors 
) const

Definition at line 35 of file ErrorCheckerBase.cc.

References addErrorToCollectionDummy(), sipixelconstants::CRC_mask, and sipixelconstants::CRC_shift.

Referenced by SiPixelRawToClusterCUDA::acquire().

38  {
39  const int CRC_BIT = (*trailer >> CRC_shift) & CRC_mask;
40  const bool isCRCcorrect = (CRC_BIT == 0);
41  if (!isCRCcorrect)
42  addErrorToCollectionDummy(39, fedId, *trailer, errors);
43  errorsInEvent = (errorsInEvent || !isCRCcorrect);
44  return isCRCcorrect;
45 }
constexpr uint64_t CRC_mask
constexpr uint32_t CRC_shift
void addErrorToCollectionDummy(int errorType, int fedId, Word64 word, SiPixelFormatterErrors &errors) const
bool ErrorCheckerBase::checkHeader ( bool &  errorsInEvent,
int  fedId,
const Word64 header,
SiPixelFormatterErrors errors 
) const

Definition at line 47 of file ErrorCheckerBase.cc.

References addErrorToCollectionDummy(), FEDHeader::check(), l1tstage2_dqm_sourceclient-live_cfg::fedId, LogDebug, FEDHeader::moreHeaders(), and FEDHeader::sourceID().

Referenced by SiPixelRawToClusterCUDA::acquire().

50  {
51  FEDHeader fedHeader(reinterpret_cast<const unsigned char*>(header));
52  const bool fedHeaderCorrect = fedHeader.check();
53  // if not fedHeaderCorrect throw exception?
54  if (fedHeaderCorrect && (fedHeader.sourceID() != fedId)) {
55  int errorType = 32;
56  addErrorToCollectionDummy(errorType, fedId, *header, errors);
57  LogDebug("PixelDataFormatter::interpretRawData, fedHeader.sourceID() != fedId")
58  << ", sourceID = " << fedHeader.sourceID() << ", fedId = " << fedId << ", errorType = " << errorType;
59  errorsInEvent = true;
60  }
61  return fedHeaderCorrect && fedHeader.moreHeaders();
62 }
void addErrorToCollectionDummy(int errorType, int fedId, Word64 word, SiPixelFormatterErrors &errors) const
#define LogDebug(id)
virtual bool ErrorCheckerBase::checkROC ( bool &  errorsInEvent,
int  fedId,
const SiPixelFrameConverter converter,
const SiPixelFedCabling theCablingTree,
Word32 errorWord,
SiPixelFormatterErrors errors 
) const
pure virtual

Implemented in ErrorChecker, and ErrorCheckerPhase0.

bool ErrorCheckerBase::checkTrailer ( bool &  errorsInEvent,
int  fedId,
unsigned int  nWords,
const Word64 trailer,
SiPixelFormatterErrors errors 
) const

Definition at line 64 of file ErrorCheckerBase.cc.

References addErrorToCollectionDummy(), FEDTrailer::check(), FEDTrailer::fragmentLength(), and FEDTrailer::moreTrailers().

Referenced by SiPixelRawToClusterCUDA::acquire().

65  {
66  FEDTrailer fedTrailer(reinterpret_cast<const unsigned char*>(trailer));
67  const bool fedTrailerCorrect = fedTrailer.check();
68  if (!fedTrailerCorrect) {
69  int errorType = 33;
70  addErrorToCollectionDummy(errorType, fedId, *trailer, errors);
71  LogError("FedTrailerCheck") << "fedTrailer.check failed, Fed: " << fedId << ", errorType = " << errorType;
72  errorsInEvent = true;
73  } else if (fedTrailer.fragmentLength() != nWords) {
74  int errorType = 34;
75  addErrorToCollectionDummy(errorType, fedId, *trailer, errors);
76  LogError("FedTrailerLenght") << "fedTrailer.fragmentLength()!= nWords !! Fed: " << fedId
77  << ", errorType = " << errorType;
78  errorsInEvent = true;
79  }
80  return fedTrailerCorrect && fedTrailer.moreTrailers();
81 }
Log< level::Error, false > LogError
void addErrorToCollectionDummy(int errorType, int fedId, Word64 word, SiPixelFormatterErrors &errors) const
void ErrorCheckerBase::conversionError ( int  fedId,
const SiPixelFrameConverter converter,
int  status,
Word32 errorWord,
SiPixelFormatterErrors errors 
) const

Definition at line 83 of file ErrorCheckerBase.cc.

References relativeConstraints::error, errorDetId(), getConversionErrorTypeAndIssueLogMessage(), and includeErrors_.

87  {
89  // errorType == 0 means unexpected error, in this case we don't include it in the error collection
90  if (errorType && includeErrors_) {
91  SiPixelRawDataError error(errorWord, errorType, fedId);
92  cms_uint32_t detId = errorDetId(converter, errorType, errorWord);
93  errors[detId].push_back(error);
94  }
95 }
list status
Definition: mps_update.py:107
virtual cms_uint32_t errorDetId(const SiPixelFrameConverter *converter, int errorType, const Word32 &word) const =0
unsigned int cms_uint32_t
Definition: typedefs.h:15
int getConversionErrorTypeAndIssueLogMessage(int status, int fedId) const
Pixel error – collection of errors and error information.
virtual cms_uint32_t ErrorCheckerBase::errorDetId ( const SiPixelFrameConverter converter,
int  errorType,
const Word32 word 
) const
protectedpure virtual

Implemented in ErrorChecker, and ErrorCheckerPhase0.

Referenced by conversionError().

int ErrorCheckerBase::getConversionErrorTypeAndIssueLogMessage ( int  status,
int  fedId 
) const
protected

Definition at line 97 of file ErrorCheckerBase.cc.

References LogDebug, mps_update::status, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by conversionError().

97  {
98  int errorType = 0;
99  std::string debugMessage;
100  switch (status) {
101  case (1): {
102  debugMessage = "invalid channel Id";
103  errorType = 35;
104  break;
105  }
106  case (2): {
107  debugMessage = "invalid ROC Id";
108  errorType = 36;
109  break;
110  }
111  case (3): {
112  debugMessage = "invalid dcol/pixel value";
113  errorType = 37;
114  break;
115  }
116  case (4): {
117  debugMessage = "dcol/pixel read out of order";
118  errorType = 38;
119  break;
120  }
121  };
122  if (errorType) {
123  LogDebug("ErrorChecker::conversionError") << "Fed:" << fedId << debugMessage << "(errorType =" << errorType << ")";
124  } else {
125  LogDebug("ErrorChecker::conversionError") << "cabling check returned unexpected result, status =" << status;
126  }
127  return errorType;
128 }
list status
Definition: mps_update.py:107
#define LogDebug(id)
void ErrorCheckerBase::setErrorStatus ( bool  ErrorStatus)

Definition at line 23 of file ErrorCheckerBase.cc.

References includeErrors_.

23 { includeErrors_ = ErrorStatus; }

Member Data Documentation

bool ErrorCheckerBase::includeErrors_
protected