CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/EventFilter/CSCRawToDigi/interface/CSCDDUEventData.h

Go to the documentation of this file.
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   uint16_t trailer0() const {return theDDUTrailer0;}
00039 
00040   CSCDCCHeader dccHeader() const {return theDCCHeader;}
00041   CSCDCCTrailer dccTrailer() const {return theDCCTrailer;}
00042 
00043 
00045     void add(CSCEventData &, int dmbId, int dduInput);
00046 
00048   long unsigned int errorstat;
00049 
00050   bool check() const;
00051 
00054   void decodeStatus(int status) const;
00055   void decodeStatus() const;
00056   int sizeInWords() const {return theSizeInWords;}
00057   int size() const {return theSizeInWords*16;} 
00058 
00060   boost::dynamic_bitset<> pack();
00061 
00062   
00063   static bool debug;
00064   static unsigned int errMask;
00065 
00067 protected:
00068   void unpack_data(unsigned short * buf, CSCDCCExaminer* examiner=NULL);
00069   CSCDCCHeader theDCCHeader;
00070   CSCDDUHeader theDDUHeader;
00071   // CSCData is unpacked and stored in this vector
00072   std::vector<CSCEventData> theData;
00073   CSCDDUTrailer theDDUTrailer;
00074   CSCDCCTrailer theDCCTrailer;
00075   uint16_t theDDUTrailer0;
00076   int theSizeInWords;
00077 };
00078 
00079 #endif