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
CSCDDUHeader.h
CSCDDUEventData::theDDUTrailer
CSCDDUTrailer theDDUTrailer
Definition: CSCDDUEventData.h:75
CSCDDUEventData::theDCCHeader
CSCDCCHeader theDCCHeader
Definition: CSCDDUEventData.h:71
CSCEventData
Definition: CSCEventData.h:26
CSCEventData.h
CSCDDUEventData::cscData
const std::vector< CSCEventData > & cscData() const
accessor to data
Definition: CSCDDUEventData.h:33
CSCDCCHeader.h
CSCDDUEventData::setErrorMask
static void setErrorMask(unsigned int value)
Definition: CSCDDUEventData.h:30
CSCDDUTrailer.h
mps_update.status
status
Definition: mps_update.py:68
CSCDDUHeader
Definition: CSCDDUHeader.h:11
CSCDDUEventData::CSCDDUEventData
CSCDDUEventData(const CSCDDUHeader &)
Definition: CSCDDUEventData.cc:24
CSCDDUTrailer
Definition: CSCDDUTrailer.h:12
CSCDCCTrailer
Definition: CSCDCCTrailer.h:14
CSCDDUEventData::debug
static std::atomic< bool > debug
Definition: CSCDDUEventData.h:64
CSCDCCHeader
Definition: CSCDCCHeader.h:13
CSCDDUEventData::setDebug
static void setDebug(bool value)
Definition: CSCDDUEventData.h:29
CSCDDUEventData::header
CSCDDUHeader header() const
Definition: CSCDDUEventData.h:35
CSCDDUEventData::size
int size() const
Definition: CSCDDUEventData.h:55
CSCDDUEventData::pack
boost::dynamic_bitset pack()
Alex check this 16 or 64.
Definition: CSCDDUEventData.cc:299
CSCDDUEventData::theSizeInWords
int theSizeInWords
Definition: CSCDDUEventData.h:78
CSCDDUEventData::theDCCTrailer
CSCDCCTrailer theDCCTrailer
Definition: CSCDDUEventData.h:76
CSCDDUEventData::trailer
CSCDDUTrailer trailer() const
Definition: CSCDDUEventData.h:36
CSCDDUEventData::errorstat
long unsigned int errorstat
trailer info
Definition: CSCDDUEventData.h:46
CSCDDUEventData::trailer0
uint16_t trailer0() const
Definition: CSCDDUEventData.h:37
CSCDDUEventData::dccTrailer
CSCDCCTrailer dccTrailer() const
Definition: CSCDDUEventData.h:40
CSCDCCExaminer
Definition: CSCDCCExaminer.h:15
value
Definition: value.py:1
CSCDDUEventData::unpack_data
void unpack_data(const uint16_t *buf, CSCDCCExaminer *examiner=nullptr)
a good test routine would be to unpack data, then pack it again.
Definition: CSCDDUEventData.cc:134
CSCDDUEventData::theDDUHeader
CSCDDUHeader theDDUHeader
Definition: CSCDDUEventData.h:72
visDQMUpload.buf
buf
Definition: visDQMUpload.py:160
CSCDDUEventData::theDDUTrailer0
uint16_t theDDUTrailer0
Definition: CSCDDUEventData.h:77
CSCDDUEventData::errMask
static std::atomic< unsigned int > errMask
Definition: CSCDDUEventData.h:65
CSCDDUEventData::~CSCDDUEventData
~CSCDDUEventData()
Definition: CSCDDUEventData.cc:28
CSCDDUEventData
Definition: CSCDDUEventData.h:19
CSCDDUEventData::dccHeader
CSCDCCHeader dccHeader() const
Definition: CSCDDUEventData.h:39
CSCDCCExaminer.h
CSCDDUEventData::theFormatVersion
uint16_t theFormatVersion
Definition: CSCDDUEventData.h:79
relativeConstraints.value
value
Definition: relativeConstraints.py:53
CSCDDUEventData::add
void add(CSCEventData &, int dmbId, int dduInput, unsigned int format_version=2005)
for making events. Sets the bxnum and lvl1num inside the chamber event
Definition: CSCDDUEventData.cc:30
CSCDCCTrailer.h
CSCDDUEventData::check
bool check() const
Definition: CSCDDUEventData.cc:289
CSCDDUEventData::decodeStatus
void decodeStatus() const
Definition: CSCDDUEventData.cc:41
CSCDDUEventData::sizeInWords
int sizeInWords() const
Definition: CSCDDUEventData.h:54
CSCDDUEventData::theData
std::vector< CSCEventData > theData
Definition: CSCDDUEventData.h:74