CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
10  : theDDUData(nullptr), theCurrentCSC(-1), theNumberOfCSCs(0), theDataIsOwnedByMe(true) {
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()),
25  theDataIsOwnedByMe(false) {}
26 
29  delete theDDUData;
30 }
31 
33  : theCurrentCSC(i.theCurrentCSC), theNumberOfCSCs(i.theNumberOfCSCs), theDataIsOwnedByMe(i.theDataIsOwnedByMe) {
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 }
bool check() const
Definition: CSCDDUHeader.cc:43
void operator=(const CSCDDUDataItr &)
const CSCDDUEventData * theDDUData
Definition: CSCDDUDataItr.h:35
assert(be >=bs)
#define LogTrace(id)
CSCDDUDataItr()
default constructor
Definition: CSCDDUDataItr.cc:7
const std::vector< CSCEventData > & cscData() const
accessor to data
bool theDataIsOwnedByMe
Definition: CSCDDUDataItr.h:38
const CSCEventData & operator*()
tuple size
Write out results.