CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCChamberDataItr.cc
Go to the documentation of this file.
3 
5  theDCCData(0),
6  theCurrentDDU(0)
7 {
8  // first try if it's DCC data.
9  const CSCDCCHeader * dccHeader
10  = reinterpret_cast<const CSCDCCHeader *>(buf);
11  if(dccHeader->check())
12  {
13  theDCCData = new CSCDCCEventData((unsigned short *)buf);
16  }
17  else
18  {
19  // it's DDU data, with only one DDU
20  theDDUItr = new CSCDDUDataItr(buf);
21  theNumberOfDDUs = 1;
22  }
23 }
24 
25 
27 {
28  // safe, even if it's zero
29  delete theDCCData;
30 }
31 
32 
34 {
35  bool result = true;
36  if(!theDDUItr->next())
37  {
39  {
40  result = false;
41  }
42  else
43  {
44  // the next DDU exists, so initialize an itr
45  assert(theDCCData != 0);
46  delete theDDUItr;
48  }
49  }
50  return result;
51 }
52 
53 
55 {
56  return **theDDUItr;
57 }
58 
59 
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*()
CSCDDUDataItr * theDDUItr
CSCChamberDataItr(const char *buf)
tuple result
Definition: query.py:137
bool check() const
Definition: CSCDCCHeader.h:24