Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DataFormats_RPCDigi_ReadoutError_H
0002 #define DataFormats_RPCDigi_ReadoutError_H
0003 
0004 #include "CondFormats/RPCObjects/interface/LinkBoardElectronicIndex.h"
0005 #include <string>
0006 
0007 namespace rpcrawtodigi {
0008   class ReadoutError {
0009   public:
0010     enum ReadoutErrorType {
0011       NoProblem = 0,
0012       HeaderCheckFail = 1,
0013       InconsitentFedId = 2,
0014       TrailerCheckFail = 3,
0015       InconsistentDataSize = 4,
0016       InvalidLB = 5,
0017       EmptyPackedStrips = 6,
0018       InvalidDetId = 7,
0019       InvalidStrip = 8,
0020       EOD = 9
0021     };
0022 
0023     explicit ReadoutError(unsigned int rawCode = 0) : theError(rawCode) {}
0024 
0025     ReadoutError(const LinkBoardElectronicIndex&, const ReadoutErrorType&);
0026 
0027     ReadoutErrorType type() const;
0028     LinkBoardElectronicIndex where() const;
0029 
0030     static std::string name(const ReadoutErrorType& code);
0031 
0032     std::string name() const { return name(type()); }
0033 
0034     unsigned int rawCode() const { return theError; }
0035 
0036   private:
0037     unsigned int theError;
0038   };
0039 
0040 }  // namespace rpcrawtodigi
0041 #endif