CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSCChamberDataItr.cc
Go to the documentation of this file.
3 
4 CSCChamberDataItr::CSCChamberDataItr(const char *buf) : theDCCData(nullptr), theCurrentDDU(0) {
5  // first try if it's DCC data.
6  const CSCDCCHeader *dccHeader = reinterpret_cast<const CSCDCCHeader *>(buf);
7  if (dccHeader->check()) {
8  theDCCData = new CSCDCCEventData((const uint16_t *)buf);
11  } else {
12  // it's DDU data, with only one DDU
13  theDDUItr = new CSCDDUDataItr(buf);
14  theNumberOfDDUs = 1;
15  }
16 }
17 
19  // safe, even if it's zero
20  delete theDCCData;
21 }
22 
24  bool result = true;
25  if (!theDDUItr->next()) {
26  if (++theCurrentDDU >= theNumberOfDDUs) {
27  result = false;
28  } else {
29  // the next DDU exists, so initialize an itr
30  assert(theDCCData != nullptr);
31  delete theDDUItr;
33  }
34  }
35  return result;
36 }
37 
01/20/05 A.Tumanov
const CSCDCCEventData * theDCCData
make a new vector of DDUs (length 1).
const std::vector< CSCDDUEventData > & dduData() const
accessor to dduData
const CSCEventData & operator*()
assert(be >=bs)
tuple result
Definition: mps_fire.py:311
CSCDDUDataItr * theDDUItr
CSCChamberDataItr(const char *buf)
bool check() const
Definition: CSCDCCHeader.h:27