Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:59

0001 #ifndef EventFilter_SiPixelRawToDigi_interface_ErrorCheckerBase_h
0002 #define EventFilter_SiPixelRawToDigi_interface_ErrorCheckerBase_h
0003 /** \class ErrorCheckerBase
0004  *
0005  *  
0006  */
0007 
0008 #include "DataFormats/SiPixelDigi/interface/SiPixelDigiConstants.h"
0009 #include "DataFormats/SiPixelRawData/interface/SiPixelFormatterErrors.h"
0010 
0011 class SiPixelFrameConverter;
0012 class SiPixelFedCabling;
0013 
0014 class ErrorCheckerBase {
0015 public:
0016   ErrorCheckerBase();
0017 
0018   virtual ~ErrorCheckerBase() = default;
0019 
0020   void setErrorStatus(bool ErrorStatus);
0021 
0022   bool checkCRC(bool& errorsInEvent, int fedId, const Word64* trailer, SiPixelFormatterErrors& errors) const;
0023 
0024   bool checkHeader(bool& errorsInEvent, int fedId, const Word64* header, SiPixelFormatterErrors& errors) const;
0025 
0026   bool checkTrailer(
0027       bool& errorsInEvent, int fedId, unsigned int nWords, const Word64* trailer, SiPixelFormatterErrors& errors) const;
0028 
0029   void conversionError(int fedId,
0030                        const SiPixelFrameConverter* converter,
0031                        int status,
0032                        Word32& errorWord,
0033                        SiPixelFormatterErrors& errors) const;
0034 
0035   virtual bool checkROC(bool& errorsInEvent,
0036                         int fedId,
0037                         const SiPixelFrameConverter* converter,
0038                         const SiPixelFedCabling* theCablingTree,
0039                         Word32& errorWord,
0040                         SiPixelFormatterErrors& errors) const = 0;
0041 
0042 protected:
0043   bool includeErrors_;
0044   int getConversionErrorTypeAndIssueLogMessage(int status, int fedId) const;
0045   void addErrorToCollectionDummy(int errorType, int fedId, Word64 word, SiPixelFormatterErrors& errors) const;
0046   virtual cms_uint32_t errorDetId(const SiPixelFrameConverter* converter, int errorType, const Word32& word) const = 0;
0047 };
0048 
0049 #endif  // EventFilter_SiPixelRawToDigi_interface_ErrorCheckerBase_h