40 LogTrace(
"CSCDCCEventData|CSCRawToDigi") <<
"CSCDCCEventData::unpack_data() is called";
44 LogTrace(
"CSCDCCEventData|CSCRawToDigi") <<
"unpacking dcc header...";
52 while ((
buf[7] == 0x8000) && (
buf[6] == 0x0001) && (
buf[5] == 0x8000)) {
57 LogTrace(
"CSCDCCEventData|CSCRawToDigi") <<
" checking ddu data integrity ";
58 if (dduEventData.
check()) {
63 LogTrace(
"CSCDCCEventData|CSCRawToDigi") <<
"DDU Data Check failed! ";
69 LogTrace(
"CSCDCCEventData|CSCRawToDigi") <<
"unpacking dcc trailer ";
70 LogTrace(
"CSCDCCEventData|CSCRawToDigi") << std::hex <<
buf[3] <<
" " <<
buf[2] <<
" " <<
buf[1] <<
" " <<
buf[0];
75 LogTrace(
"CSCDCCEventData|CSCRawToDigi") <<
"decoding DCC trailer";
96 CSCEventData&
chamber,
int dduID,
int dduSlot,
int dduInput,
int dmbID, uint16_t format_version) {
100 for (
int i = 0; dduIndex == -1 &&
i < nDDUs; ++
i) {
106 unsigned ddu_fmt_version = 0x6;
107 if (format_version >= 2013)
108 ddu_fmt_version = 0x7;
110 if (dduIndex == -1) {
113 dccHeader().getCDFBunchCounter(),
dccHeader().getCDFEventNumber(), dduID, ddu_fmt_version);
CSCDCCHeader theDCCHeader
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
CSCDCCTrailer theDCCTrailer
boost::dynamic_bitset pack()
packs data into bits
static std::atomic< bool > debug
void unpack_data(const uint16_t *buf, CSCDCCExaminer *examiner=nullptr)
std::vector< CSCDDUEventData > theDDUData
bool check() const
for making events. Sets the bxnum and lvl1num inside the chamber event
void addChamber(CSCEventData &chamber, int dduID, int dduSlot, int dduInput, int dmbID, uint16_t format_version=2005)
CSCDCCEventData(int sourceId, int nDDUs, int bx, int l1a)
CSCDCCTrailer dccTrailer() const
void setFromBuffer(uint16_t const *buf)
static unsigned sizeInWords()
boost::dynamic_bitset ushortToBitset(const unsigned int numberOfBits, unsigned short *buf)
this method takes numberOfBits bits from unsigned short * array and returns them in the bitset obj...
CSCDCCHeader dccHeader() const