CMS 3D CMS Logo

CSCDDUEventData.h
Go to the documentation of this file.
1 #ifndef CSCDDUEventData_h
2 #define CSCDDUEventData_h
3 
10 #include <vector>
17 #include <boost/dynamic_bitset.hpp>
18 
20 public:
21 
22  explicit CSCDDUEventData(const CSCDDUHeader &);
23 
24  // buf may need to stay pinned in memory as long
25  // as this data is used. Not sure
26  explicit CSCDDUEventData(unsigned short *buf, CSCDCCExaminer* examiner=NULL);
27 
29 
30  static void setDebug(bool value) {debug = value;}
31  static void setErrorMask(unsigned int value) {errMask = value;}
32 
34  const std::vector<CSCEventData> & cscData() const {return theData;}
35 
36  CSCDDUHeader header() const {return theDDUHeader;}
38  uint16_t trailer0() const {return theDDUTrailer0;}
39 
42 
43 
45  void add(CSCEventData &, int dmbId, int dduInput, unsigned int format_version = 2005);
46 
48  long unsigned int errorstat;
49 
50  bool check() const;
51 
54  void decodeStatus(int status) const;
55  void decodeStatus() const;
56  int sizeInWords() const {return theSizeInWords;}
57  int size() const {return theSizeInWords*16;}
58 
60  boost::dynamic_bitset<> pack();
61 
62 #ifdef LOCAL_UNPACK
63  static bool debug;
64  static unsigned int errMask;
65 #else
66  static std::atomic<bool> debug;
67  static std::atomic<unsigned int> errMask;
68 #endif
69 
71 protected:
72  void unpack_data(unsigned short * buf, CSCDCCExaminer* examiner=NULL);
75  // CSCData is unpacked and stored in this vector
76  std::vector<CSCEventData> theData;
79  uint16_t theDDUTrailer0;
81  uint16_t theFormatVersion;
82 };
83 
84 #endif
CSCDDUEventData(const CSCDDUHeader &)
void unpack_data(unsigned short *buf, CSCDCCExaminer *examiner=NULL)
a good test routine would be to unpack data, then pack it again.
uint16_t theFormatVersion
CSCDDUHeader header() const
CSCDCCTrailer dccTrailer() const
static void setDebug(bool value)
CSCDDUHeader theDDUHeader
#define NULL
Definition: scimark2.h:8
uint16_t trailer0() const
static void setErrorMask(unsigned int value)
CSCDCCTrailer theDCCTrailer
Definition: value.py:1
const std::vector< CSCEventData > & cscData() const
accessor to data
static std::atomic< unsigned int > errMask
uint16_t theDDUTrailer0
int size() const
void add(CSCEventData &, int dmbId, int dduInput, unsigned int format_version=2005)
for making events. Sets the bxnum and lvl1num inside the chamber event
CSCDDUTrailer trailer() const
std::vector< CSCEventData > theData
bool check() const
void decodeStatus() const
CSCDDUTrailer theDDUTrailer
static std::atomic< bool > debug
long unsigned int errorstat
trailer info
CSCDCCHeader dccHeader() const
boost::dynamic_bitset pack()
Alex check this 16 or 64.
CSCDCCHeader theDCCHeader
int sizeInWords() const