00001 #ifndef CSCDDUEventData_h 00002 #define CSCDDUEventData_h 00003 00010 #include <vector> 00011 #include "EventFilter/CSCRawToDigi/interface/CSCEventData.h" 00012 #include "EventFilter/CSCRawToDigi/interface/CSCDDUHeader.h" 00013 #include "EventFilter/CSCRawToDigi/interface/CSCDDUTrailer.h" 00014 #include "EventFilter/CSCRawToDigi/interface/CSCDCCHeader.h" 00015 #include "EventFilter/CSCRawToDigi/interface/CSCDCCTrailer.h" 00016 #include "EventFilter/CSCRawToDigi/interface/CSCDCCExaminer.h" 00017 #include <boost/dynamic_bitset.hpp> 00018 00019 class CSCDDUEventData { 00020 public: 00021 00022 explicit CSCDDUEventData(const CSCDDUHeader &); 00023 00024 // buf may need to stay pinned in memory as long 00025 // as this data is used. Not sure 00026 explicit CSCDDUEventData(unsigned short *buf, CSCDCCExaminer* examiner=NULL); 00027 00028 ~CSCDDUEventData(); 00029 00030 static void setDebug(bool value) {debug = value;} 00031 static void setErrorMask(unsigned int value) {errMask = value;} 00032 00034 const std::vector<CSCEventData> & cscData() const {return theData;} 00035 00036 CSCDDUHeader header() const {return theDDUHeader;} 00037 CSCDDUTrailer trailer() const {return theDDUTrailer;} 00038 00039 CSCDCCHeader dccHeader() const {return theDCCHeader;} 00040 CSCDCCTrailer dccTrailer() const {return theDCCTrailer;} 00041 00042 00044 void add(CSCEventData &, int dmbId); 00045 00047 long unsigned int errorstat; 00048 00049 bool check() const; 00050 00053 void decodeStatus(int status) const; 00054 void decodeStatus() const; 00055 int sizeInWords() const {return theSizeInWords;} 00056 int size() const {return theSizeInWords*16;} 00057 00059 boost::dynamic_bitset<> pack(); 00060 00061 00062 static bool debug; 00063 static unsigned int errMask; 00064 00066 protected: 00067 void unpack_data(unsigned short * buf, CSCDCCExaminer* examiner=NULL); 00068 CSCDCCHeader theDCCHeader; 00069 CSCDDUHeader theDDUHeader; 00070 // CSCData is unpacked and stored in this vector 00071 std::vector<CSCEventData> theData; 00072 CSCDDUTrailer theDDUTrailer; 00073 CSCDCCTrailer theDCCTrailer; 00074 int theSizeInWords; 00075 }; 00076 00077 #endif