Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:41

0001 #include "DataFormats/SiPixelRawData/interface/SiPixelRawDataError.h"
0002 
0003 //---------------------------------------------------------------------------

0004 //!  \class SiPixelRawDataError

0005 //!  \brief Pixel error -- collection of errors and error information

0006 //!

0007 //!  Class to contain and store all information about errors

0008 //!

0009 //!

0010 //!  \author Andrew York, University of Tennessee

0011 //---------------------------------------------------------------------------

0012 
0013 //Constructors

0014 
0015 SiPixelRawDataError::SiPixelRawDataError() {}
0016 
0017 SiPixelRawDataError::SiPixelRawDataError(cms_uint32_t errorWord32, const int errorType, int fedId)
0018     : errorWord32_(errorWord32), errorType_(errorType), fedId_(fedId) {
0019   setMessage();
0020 }
0021 
0022 SiPixelRawDataError::SiPixelRawDataError(cms_uint64_t errorWord64, const int errorType, int fedId)
0023     : errorWord64_(errorWord64), errorType_(errorType), fedId_(fedId) {
0024   setMessage();
0025 }
0026 
0027 //Destructor

0028 
0029 SiPixelRawDataError::~SiPixelRawDataError() {}
0030 
0031 //functions to get error words and types

0032 
0033 void SiPixelRawDataError::setWord32(cms_uint32_t errorWord32) { errorWord32_ = errorWord32; }
0034 
0035 void SiPixelRawDataError::setWord64(cms_uint64_t errorWord64) { errorWord64_ = errorWord64; }
0036 
0037 void SiPixelRawDataError::setType(int errorType) {
0038   errorType_ = errorType;
0039   setMessage();
0040 }
0041 
0042 void SiPixelRawDataError::setFedId(int fedId) { fedId_ = fedId; }
0043 
0044 void SiPixelRawDataError::setMessage() {
0045   switch (errorType_) {
0046     case (25): {
0047       errorMessage_ = "Error: Disabled FED channel (ROC=25)";
0048       break;
0049     }
0050     case (26): {
0051       errorMessage_ = "Error: Gap word";
0052       break;
0053     }
0054     case (27): {
0055       errorMessage_ = "Error: Dummy word";
0056       break;
0057     }
0058     case (28): {
0059       errorMessage_ = "Error: FIFO nearly full";
0060       break;
0061     }
0062     case (29): {
0063       errorMessage_ = "Error: Timeout";
0064       break;
0065     }
0066     case (30): {
0067       errorMessage_ = "Error: Trailer";
0068       break;
0069     }
0070     case (31): {
0071       errorMessage_ = "Error: Event number mismatch";
0072       break;
0073     }
0074     case (32): {
0075       errorMessage_ = "Error: Invalid or missing header";
0076       break;
0077     }
0078     case (33): {
0079       errorMessage_ = "Error: Invalid or missing trailer";
0080       break;
0081     }
0082     case (34): {
0083       errorMessage_ = "Error: Size mismatch";
0084       break;
0085     }
0086     case (35): {
0087       errorMessage_ = "Error: Invalid channel";
0088       break;
0089     }
0090     case (36): {
0091       errorMessage_ = "Error: Invalid ROC number";
0092       break;
0093     }
0094     case (37): {
0095       errorMessage_ = "Error: Invalid dcol/pixel address";
0096       break;
0097     }
0098     default:
0099       errorMessage_ = "Error: Unknown error type";
0100   };
0101 }