CMS 3D CMS Logo

CSCDDUEventData.h
Go to the documentation of this file.
1 #ifndef EventFilter_CSCRawToDigi_CSCDDUEventData_h
2 #define EventFilter_CSCRawToDigi_CSCDDUEventData_h
3 
10 #include <vector>
17 #include <boost/dynamic_bitset.hpp>
18 
20 public:
21  explicit CSCDDUEventData(const CSCDDUHeader &);
22 
23  // buf may need to stay pinned in memory as long
24  // as this data is used. Not sure
25  explicit CSCDDUEventData(const uint16_t *buf, CSCDCCExaminer *examiner = nullptr);
26 
28 
29  static void setDebug(bool value) { debug = value; }
30  static void setErrorMask(unsigned int value) { errMask = value; }
31 
33  const std::vector<CSCEventData> &cscData() const { return theData; }
34 
35  CSCDDUHeader header() const { return theDDUHeader; }
36  CSCDDUTrailer trailer() const { return theDDUTrailer; }
37  uint16_t trailer0() const { return theDDUTrailer0; }
38 
39  CSCDCCHeader dccHeader() const { return theDCCHeader; }
41 
43  void add(CSCEventData &, int dmbId, int dduInput, unsigned int format_version = 2005);
44 
46  long unsigned int errorstat;
47 
48  bool check() const;
49 
52  void decodeStatus(int status) const;
53  void decodeStatus() const;
54  int sizeInWords() const { return theSizeInWords; }
55  int size() const { return theSizeInWords * 16; }
56 
58  boost::dynamic_bitset<> pack();
59 
60 #ifdef LOCAL_UNPACK
61  static bool debug;
62  static unsigned int errMask;
63 #else
64  static std::atomic<bool> debug;
65  static std::atomic<unsigned int> errMask;
66 #endif
67 
69 protected:
70  void unpack_data(const uint16_t *buf, CSCDCCExaminer *examiner = nullptr);
73  // CSCData is unpacked and stored in this vector
74  std::vector<CSCEventData> theData;
77  uint16_t theDDUTrailer0;
79  uint16_t theFormatVersion;
80 };
81 
82 #endif
CSCDDUEventData(const CSCDDUHeader &)
uint16_t theFormatVersion
static void setDebug(bool value)
CSCDDUHeader theDDUHeader
uint16_t trailer0() const
int sizeInWords() const
bool check() const
const std::vector< CSCEventData > & cscData() const
accessor to data
static void setErrorMask(unsigned int value)
CSCDCCTrailer theDCCTrailer
Definition: value.py:1
void unpack_data(const uint16_t *buf, CSCDCCExaminer *examiner=nullptr)
a good test routine would be to unpack data, then pack it again.
void decodeStatus() const
static std::atomic< unsigned int > errMask
uint16_t theDDUTrailer0
CSCDDUHeader header() const
CSCDCCTrailer dccTrailer() const
CSCDCCHeader dccHeader() const
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
std::vector< CSCEventData > theData
CSCDDUTrailer theDDUTrailer
static std::atomic< bool > debug
long unsigned int errorstat
trailer info
boost::dynamic_bitset pack()
Alex check this 16 or 64.
CSCDCCHeader theDCCHeader
CSCDDUTrailer trailer() const