CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCChamberDataItr Class Reference

#include <CSCChamberDataItr.h>

Public Member Functions

 CSCChamberDataItr (const char *buf)
 
bool next ()
 
const CSCEventDataoperator* ()
 
 ~CSCChamberDataItr ()
 

Private Member Functions

void constructFromDCC (const CSCDCCEventData &)
 for DCC data. More...
 
void constructFromDDU (const CSCDDUEventData &)
 for DDU-only data More...
 
void initDDU ()
 sets theDDU & theNumberOfCSCs More...
 

Private Attributes

unsigned theCurrentDDU
 
const CSCDCCEventDatatheDCCData
 make a new vector of DDUs (length 1). More...
 
CSCDDUDataItrtheDDUItr
 
unsigned theNumberOfDDUs
 

Detailed Description

Definition at line 15 of file CSCChamberDataItr.h.

Constructor & Destructor Documentation

◆ CSCChamberDataItr()

CSCChamberDataItr::CSCChamberDataItr ( const char *  buf)

construct from data buffer. Will figure out whether it's DCC or DDU

Definition at line 4 of file CSCChamberDataItr.cc.

4  : 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
14  theNumberOfDDUs = 1;
15  }
16 }

References visDQMUpload::buf, CSCDCCHeader::check(), CSCDCCEventData::dduData(), theCurrentDDU, theDCCData, theDDUItr, and theNumberOfDDUs.

◆ ~CSCChamberDataItr()

CSCChamberDataItr::~CSCChamberDataItr ( )

Definition at line 18 of file CSCChamberDataItr.cc.

18  {
19  // safe, even if it's zero
20  delete theDCCData;
21 }

References theDCCData.

Member Function Documentation

◆ constructFromDCC()

void CSCChamberDataItr::constructFromDCC ( const CSCDCCEventData )
private

for DCC data.

◆ constructFromDDU()

void CSCChamberDataItr::constructFromDDU ( const CSCDDUEventData )
private

for DDU-only data

◆ initDDU()

void CSCChamberDataItr::initDDU ( )
private

sets theDDU & theNumberOfCSCs

◆ next()

bool CSCChamberDataItr::next ( void  )

Definition at line 23 of file CSCChamberDataItr.cc.

23  {
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 }

References cms::cuda::assert(), CSCDCCEventData::dduData(), CSCDDUDataItr::next(), mps_fire::result, theCurrentDDU, theDCCData, theDDUItr, and theNumberOfDDUs.

◆ operator*()

const CSCEventData & CSCChamberDataItr::operator* ( void  )

Definition at line 38 of file CSCChamberDataItr.cc.

38 { return **theDDUItr; }

References theDDUItr.

Member Data Documentation

◆ theCurrentDDU

unsigned CSCChamberDataItr::theCurrentDDU
private

Definition at line 41 of file CSCChamberDataItr.h.

Referenced by CSCChamberDataItr(), and next().

◆ theDCCData

const CSCDCCEventData* CSCChamberDataItr::theDCCData
private

make a new vector of DDUs (length 1).

a little confusing here. This class will either own theDCCData, in which case the DDUs points inside it,

Definition at line 39 of file CSCChamberDataItr.h.

Referenced by CSCChamberDataItr(), next(), and ~CSCChamberDataItr().

◆ theDDUItr

CSCDDUDataItr* CSCChamberDataItr::theDDUItr
private

Definition at line 40 of file CSCChamberDataItr.h.

Referenced by CSCChamberDataItr(), next(), and operator*().

◆ theNumberOfDDUs

unsigned CSCChamberDataItr::theNumberOfDDUs
private

Definition at line 42 of file CSCChamberDataItr.h.

Referenced by CSCChamberDataItr(), and next().

CSCDCCEventData::dduData
const std::vector< CSCDDUEventData > & dduData() const
accessor to dduData
Definition: CSCDCCEventData.h:25
CSCDCCEventData
01/20/05 A.Tumanov
Definition: CSCDCCEventData.h:13
cms::cuda::assert
assert(be >=bs)
CSCChamberDataItr::theDDUItr
CSCDDUDataItr * theDDUItr
Definition: CSCChamberDataItr.h:40
CSCDDUDataItr::next
bool next()
Definition: CSCDDUDataItr.cc:59
CSCDCCHeader
Definition: CSCDCCHeader.h:13
CSCChamberDataItr::theDCCData
const CSCDCCEventData * theDCCData
make a new vector of DDUs (length 1).
Definition: CSCChamberDataItr.h:39
CSCDCCHeader::check
bool check() const
Definition: CSCDCCHeader.h:27
CSCDDUDataItr
Definition: CSCDDUDataItr.h:13
CSCChamberDataItr::theNumberOfDDUs
unsigned theNumberOfDDUs
Definition: CSCChamberDataItr.h:42
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCChamberDataItr::theCurrentDDU
unsigned theCurrentDDU
Definition: CSCChamberDataItr.h:41
mps_fire.result
result
Definition: mps_fire.py:303