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 
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) {
36  theDDUData = new CSCDDUEventData(*(i.theDDUData));
37  }
38  } else {
39  theDDUData = i.theDDUData;
40  }
41 }
42 
44  if (theDataIsOwnedByMe && theDDUData != i.theDDUData) {
45  delete theDDUData;
46  if (i.theDDUData != nullptr) {
47  theDDUData = new CSCDDUEventData(*(i.theDDUData));
48  }
49  } else {
50  theDDUData = i.theDDUData;
51  }
52 
53  theDDUData = i.theDDUData;
54  theCurrentCSC = i.theCurrentCSC;
55  theNumberOfCSCs = i.theNumberOfCSCs;
56  theDataIsOwnedByMe = i.theDataIsOwnedByMe;
57 }
58 
60 
63  return theDDUData->cscData()[theCurrentCSC];
64 }
mps_fire.i
i
Definition: mps_fire.py:428
CSCEventData
Definition: CSCEventData.h:29
MessageLogger.h
funct::false
false
Definition: Factorize.h:29
CSCDDUEventData::cscData
const std::vector< CSCEventData > & cscData() const
accessor to data
Definition: CSCDDUEventData.h:33
CSCDDUHeader::check
bool check() const
Definition: CSCDDUHeader.cc:43
CSCDDUDataItr::theDDUData
const CSCDDUEventData * theDDUData
Definition: CSCDDUDataItr.h:35
CSCDDUHeader
Definition: CSCDDUHeader.h:11
cms::cuda::assert
assert(be >=bs)
CSCDDUEventData.h
CSCDDUDataItr::next
bool next()
Definition: CSCDDUDataItr.cc:59
CSCDDUDataItr::theCurrentCSC
int theCurrentCSC
Definition: CSCDDUDataItr.h:36
CSCDDUDataItr
Definition: CSCDDUDataItr.h:13
CSCDDUDataItr::theDataIsOwnedByMe
bool theDataIsOwnedByMe
Definition: CSCDDUDataItr.h:38
funct::true
true
Definition: Factorize.h:173
CSCDDUDataItr::operator*
const CSCEventData & operator*()
Definition: CSCDDUDataItr.cc:61
CSCDDUDataItr::CSCDDUDataItr
CSCDDUDataItr()
default constructor
Definition: CSCDDUDataItr.cc:7
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCDDUEventData
Definition: CSCDDUEventData.h:19
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
CSCDDUDataItr.h
CSCDDUDataItr::theNumberOfCSCs
int theNumberOfCSCs
Definition: CSCDDUDataItr.h:37
CSCDDUDataItr::operator=
void operator=(const CSCDDUDataItr &)
Definition: CSCDDUDataItr.cc:43
CSCDDUDataItr::~CSCDDUDataItr
~CSCDDUDataItr()
Definition: CSCDDUDataItr.cc:27
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443