CMS 3D CMS Logo

CSCDDUDataItr.cc
Go to the documentation of this file.
4 
5 // theCurrentCSC starts at -1, since user is expected to next() before he dereferences
6 // for the first time
7 CSCDDUDataItr::CSCDDUDataItr() : theDDUData(nullptr), theCurrentCSC(-1), theNumberOfCSCs(0), theDataIsOwnedByMe(true) {}
8 
11  // check if it's OK first
12  const CSCDDUHeader *dduHeader = reinterpret_cast<const CSCDDUHeader *>(buf);
13  if (dduHeader->check()) {
14  theDDUData = new CSCDDUEventData((const uint16_t *)buf);
16  } else {
17  LogTrace("CSCDDUDataItr|CSCRawToDigi") << "Failed DDU header check.";
18  }
19 }
20 
22  : theDDUData(dduData),
23  theCurrentCSC(-1),
24  theNumberOfCSCs(theDDUData->cscData().size()),
26 
29  delete theDDUData;
30 }
31 
34  if (theDataIsOwnedByMe) {
35  if (i.theDDUData != nullptr) {
37  }
38  } else {
40  }
41 }
42 
45  delete theDDUData;
46  if (i.theDDUData != nullptr) {
48  }
49  } else {
51  }
52 
57 }
58 
60 
63  return theDDUData->cscData()[theCurrentCSC];
64 }
size
Write out results.
bool check() const
Definition: CSCDDUHeader.cc:43
void operator=(const CSCDDUDataItr &)
#define nullptr
const CSCDDUEventData * theDDUData
Definition: CSCDDUDataItr.h:35
CSCDDUDataItr()
default constructor
Definition: CSCDDUDataItr.cc:7
const std::vector< CSCEventData > & cscData() const
accessor to data
#define LogTrace(id)
bool theDataIsOwnedByMe
Definition: CSCDDUDataItr.h:38
const CSCEventData & operator*()