CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions
ErrorCheckerPhase0 Class Reference

#include <ErrorCheckerPhase0.h>

Inheritance diagram for ErrorCheckerPhase0:
ErrorCheckerBase

Public Member Functions

bool checkROC (bool &errorsInEvent, int fedId, const SiPixelFrameConverter *converter, const SiPixelFedCabling *theCablingTree, Word32 &errorWord, SiPixelFormatterErrors &errors) const override
 
 ErrorCheckerPhase0 ()
 
- Public Member Functions inherited from ErrorCheckerBase
bool checkCRC (bool &errorsInEvent, int fedId, const Word64 *trailer, SiPixelFormatterErrors &errors) const
 
bool checkHeader (bool &errorsInEvent, int fedId, const Word64 *header, SiPixelFormatterErrors &errors) const
 
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

cms_uint32_t errorDetId (const SiPixelFrameConverter *converter, int errorType, const Word32 &word) const override
 
- Protected Member Functions inherited from ErrorCheckerBase
void addErrorToCollectionDummy (int errorType, int fedId, Word64 word, SiPixelFormatterErrors &errors) const
 
int getConversionErrorTypeAndIssueLogMessage (int status, int fedId) const
 

Additional Inherited Members

- Protected Attributes inherited from ErrorCheckerBase
bool includeErrors_
 

Detailed Description

Definition at line 12 of file ErrorCheckerPhase0.h.

Constructor & Destructor Documentation

◆ ErrorCheckerPhase0()

ErrorCheckerPhase0::ErrorCheckerPhase0 ( )

Definition at line 21 of file ErrorCheckerPhase0.cc.

21 : ErrorCheckerBase(){};

Member Function Documentation

◆ checkROC()

bool ErrorCheckerPhase0::checkROC ( bool &  errorsInEvent,
int  fedId,
const SiPixelFrameConverter converter,
const SiPixelFedCabling theCablingTree,
Word32 errorWord,
SiPixelFormatterErrors errors 
) const
overridevirtual

Implements ErrorCheckerBase.

Definition at line 23 of file ErrorCheckerPhase0.cc.

28  {
29  int errorType = (errorWord >> ROC_shift) & ERROR_mask;
30  if LIKELY (errorType < 25)
31  return true;
32 
33  switch (errorType) {
34  case (25): {
35  LogDebug("") << " invalid ROC=25 found (errorType=25)";
36  errorsInEvent = true;
37  break;
38  }
39  case (26): {
40  return false;
41  }
42  case (27): {
43  return false;
44  }
45  case (28): {
46  LogDebug("") << " error fifo nearly full (errorType=28)";
47  errorsInEvent = true;
48  break;
49  }
50  case (29): {
51  LogDebug("") << " timeout on a channel (errorType=29)";
52  errorsInEvent = true;
53  if ((errorWord >> OMIT_ERR_shift) & OMIT_ERR_mask) {
54  LogDebug("") << " ...first errorType=29 error, this gets masked out";
55  return false;
56  }
57  break;
58  }
59  case (30): {
60  LogDebug("") << " TBM error trailer (errorType=30)";
61  errorsInEvent = true;
62  break;
63  }
64  case (31): {
65  LogDebug("") << " event number error (errorType=31)";
66  errorsInEvent = true;
67  break;
68  }
69  default:
70  return true;
71  };
72 
73  if (includeErrors_) {
74  // check to see if overflow error for type 30, change type to 40 if so
75  if (errorType == 30) {
76  int StateMach_bits = 4;
77  int StateMach_shift = 8;
78  uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
79  int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
80  if (StateMach == 4 || StateMach == 9)
81  errorType = 40;
82  }
83 
84  // store error
85  SiPixelRawDataError error(errorWord, errorType, fedId);
86  cms_uint32_t detId;
87  detId = errorDetId(converter, errorType, errorWord);
88  errors[detId].push_back(error);
89  }
90  return false;
91 }

References relativeConstraints::error, sipixelconstants::ERROR_mask, errorDetId(), l1tstage2_dqm_sourceclient-live_cfg::fedId, ErrorCheckerBase::includeErrors_, LIKELY, LogDebug, sipixelconstants::OMIT_ERR_mask, sipixelconstants::OMIT_ERR_shift, and sipixelconstants::ROC_shift.

◆ errorDetId()

cms_uint32_t ErrorCheckerPhase0::errorDetId ( const SiPixelFrameConverter converter,
int  errorType,
const Word32 word 
) const
overrideprotectedvirtual

Implements ErrorCheckerBase.

Definition at line 94 of file ErrorCheckerPhase0.cc.

96  {
97  if (!converter)
98  return dummyDetId;
99 
100  ElectronicIndex cabling;
101 
102  switch (errorType) {
103  case 25:
104  case 30:
105  case 31:
106  case 36:
107  case 40: {
108  // set dummy values for cabling just to get detId from link if in Barrel
109  cabling.dcol = 0;
110  cabling.pxid = 2;
111  cabling.roc = 1;
112  cabling.link = (word >> LINK_shift) & LINK_mask;
113 
114  DetectorIndex detIdx;
115  int status = converter->toDetector(cabling, detIdx);
116  if (status)
117  break;
118  if (DetId(detIdx.rawId).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel))
119  return detIdx.rawId;
120  break;
121  }
122  case 29: {
123  int chanNmbr = 0;
124  const int DB0_shift = 0;
125  const int DB1_shift = DB0_shift + 1;
126  const int DB2_shift = DB1_shift + 1;
127  const int DB3_shift = DB2_shift + 1;
128  const int DB4_shift = DB3_shift + 1;
129  const cms_uint32_t DataBit_mask = ~(~cms_uint32_t(0) << 1);
130 
131  int CH1 = (word >> DB0_shift) & DataBit_mask;
132  int CH2 = (word >> DB1_shift) & DataBit_mask;
133  int CH3 = (word >> DB2_shift) & DataBit_mask;
134  int CH4 = (word >> DB3_shift) & DataBit_mask;
135  int CH5 = (word >> DB4_shift) & DataBit_mask;
136  int BLOCK_bits = 3;
137  int BLOCK_shift = 8;
138  cms_uint32_t BLOCK_mask = ~(~cms_uint32_t(0) << BLOCK_bits);
139  int BLOCK = (word >> BLOCK_shift) & BLOCK_mask;
140  int localCH = 1 * CH1 + 2 * CH2 + 3 * CH3 + 4 * CH4 + 5 * CH5;
141  if (BLOCK % 2 == 0)
142  chanNmbr = (BLOCK / 2) * 9 + localCH;
143  else
144  chanNmbr = ((BLOCK - 1) / 2) * 9 + 4 + localCH;
145  if ((chanNmbr < 1) || (chanNmbr > 36))
146  break; // signifies unexpected result
147 
148  // set dummy values for cabling just to get detId from link if in Barrel
149  cabling.dcol = 0;
150  cabling.pxid = 2;
151  cabling.roc = 1;
152  cabling.link = chanNmbr;
153  DetectorIndex detIdx;
154  int status = converter->toDetector(cabling, detIdx);
155  if (status)
156  break;
157  if (DetId(detIdx.rawId).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel))
158  return detIdx.rawId;
159  break;
160  }
161  case 37:
162  case 38: {
163  cabling.dcol = 0;
164  cabling.pxid = 2;
165  cabling.roc = (word >> ROC_shift) & ROC_mask;
166  cabling.link = (word >> LINK_shift) & LINK_mask;
167 
168  DetectorIndex detIdx;
169  int status = converter->toDetector(cabling, detIdx);
170  if (status)
171  break;
172 
173  return detIdx.rawId;
174  break;
175  }
176  default:
177  break;
178  };
179  return dummyDetId;
180 }

References sipixelobjects::ElectronicIndex::dcol, sipixelconstants::dummyDetId, sipixelobjects::ElectronicIndex::link, sipixelconstants::LINK_mask, sipixelconstants::LINK_shift, PixelSubdetector::PixelBarrel, sipixelobjects::ElectronicIndex::pxid, sipixelobjects::DetectorIndex::rawId, sipixelobjects::ElectronicIndex::roc, sipixelconstants::ROC_mask, sipixelconstants::ROC_shift, mps_update::status, and DetId::subdetId().

Referenced by checkROC().

cms_uint32_t
unsigned int cms_uint32_t
Definition: typedefs.h:15
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
SiPixelRawDataError
Pixel error – collection of errors and error information.
Definition: SiPixelRawDataError.h:19
ErrorCheckerBase::includeErrors_
bool includeErrors_
Definition: ErrorCheckerBase.h:43
mps_update.status
status
Definition: mps_update.py:68
converter
Definition: CandidateProducer.h:25
sipixelconstants::dummyDetId
constexpr cms_uint32_t dummyDetId
Definition: SiPixelDigiConstants.h:11
sipixelconstants::LINK_shift
constexpr uint32_t LINK_shift
Definition: SiPixelDigiConstants.h:27
sipixelobjects::ElectronicIndex::dcol
int dcol
Definition: ElectronicIndex.h:8
mathSSE::return
return((rh ^ lh) &mask)
relativeConstraints.error
error
Definition: relativeConstraints.py:53
sipixelconstants::LINK_mask
constexpr uint32_t LINK_mask
Definition: SiPixelDigiConstants.h:32
sipixelconstants::ROC_shift
constexpr uint32_t ROC_shift
Definition: SiPixelDigiConstants.h:26
Phase2TrackerMonitorDigi_cff.switch
switch
Definition: Phase2TrackerMonitorDigi_cff.py:13
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
DetId
Definition: DetId.h:17
errors
Definition: errors.py:1
sipixelconstants::OMIT_ERR_shift
constexpr uint32_t OMIT_ERR_shift
Definition: SiPixelDigiConstants.h:28
sipixelconstants::OMIT_ERR_mask
constexpr uint32_t OMIT_ERR_mask
Definition: SiPixelDigiConstants.h:34
sipixelobjects::ElectronicIndex::pxid
int pxid
Definition: ElectronicIndex.h:9
sipixelobjects::ElectronicIndex
Definition: ElectronicIndex.h:5
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
sipixelobjects::ElectronicIndex::link
int link
Definition: ElectronicIndex.h:6
funct::true
true
Definition: Factorize.h:173
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
sipixelconstants::ERROR_mask
constexpr uint32_t ERROR_mask
Definition: SiPixelDigiConstants.h:31
sipixelconstants::ROC_mask
constexpr uint32_t ROC_mask
Definition: SiPixelDigiConstants.h:33
ErrorCheckerBase::ErrorCheckerBase
ErrorCheckerBase()
Definition: ErrorCheckerBase.cc:21
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:89
ErrorCheckerPhase0::errorDetId
cms_uint32_t errorDetId(const SiPixelFrameConverter *converter, int errorType, const Word32 &word) const override
Definition: ErrorCheckerPhase0.cc:94
LIKELY
#define LIKELY(x)
Definition: Likely.h:20
sipixelobjects::DetectorIndex::rawId
uint32_t rawId
Definition: DetectorIndex.h:7
sipixelobjects::DetectorIndex
Definition: DetectorIndex.h:6
sipixelobjects::ElectronicIndex::roc
int roc
Definition: ElectronicIndex.h:7