Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:12

0001 #ifndef DataFormats_SiPixelRawDataError_h
0002 #define DataFormats_SiPixelRawDataError_h
0003 
0004 //---------------------------------------------------------------------------

0005 //!  \class SiPixelRawDataError

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

0007 //!

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

0009 //!

0010 //!

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

0012 //---------------------------------------------------------------------------

0013 
0014 #include "FWCore/Utilities/interface/typedefs.h"
0015 
0016 #include <string>
0017 #include <cstdint>
0018 
0019 class SiPixelRawDataError {
0020 public:
0021   /// Default constructor

0022   SiPixelRawDataError();
0023   /// Constructor for 32-bit error word

0024   SiPixelRawDataError(cms_uint32_t errorWord32, const int errorType, int fedId);
0025   /// Constructor with 64-bit error word and type included (header or trailer word)

0026   SiPixelRawDataError(cms_uint64_t errorWord64, const int errorType, int fedId);
0027   /// Destructor

0028   ~SiPixelRawDataError();
0029 
0030   void setWord32(
0031       cms_uint32_t errorWord32);  // function to allow user to input the error word (if 32-bit) after instantiation

0032   void setWord64(
0033       cms_uint64_t errorWord64);  // function to allow user to input the error word (if 64-bit) after instantiation

0034   void setType(int errorType);    // function to allow user to input the error type after instantiation

0035   void setFedId(int fedId);       // function to allow user to input the fedID after instantiation

0036   void setMessage();              // function to create an error message based on errorType

0037 
0038   inline cms_uint32_t getWord32() const { return errorWord32_; }  // the 32-bit word that contains the error information

0039   inline cms_uint64_t getWord64() const { return errorWord64_; }  // the 64-bit word that contains the error information

0040   inline int getType() const {
0041     return errorType_;
0042   }  // the number associated with the error type (26-31 for ROC number errors, 32-33 for calibration errors)

0043   inline int getFedId() const { return fedId_; }                   // the fedId where the error occured

0044   inline std::string getMessage() const { return errorMessage_; }  // the error message to be displayed with the error

0045 
0046 private:
0047   cms_uint32_t errorWord32_;
0048   cms_uint64_t errorWord64_;
0049   int errorType_;
0050   int fedId_;
0051   std::string errorMessage_;
0052 };
0053 
0054 // Comparison operators

0055 inline bool operator<(const SiPixelRawDataError& one, const SiPixelRawDataError& other) {
0056   return one.getFedId() < other.getFedId();
0057 }
0058 
0059 #endif