#include <EventFilter/CSCRawToDigi/interface/CSCChamberDataItr.h>
Public Member Functions | |
CSCChamberDataItr (const char *buf) | |
construct from data buffer. | |
bool | next () |
const CSCEventData & | operator * () |
~CSCChamberDataItr () | |
Private Member Functions | |
void | constructFromDCC (const CSCDCCEventData &) |
for DCC data. | |
void | constructFromDDU (const CSCDDUEventData &) |
for DDU-only data | |
void | initDDU () |
sets theDDU & theNumberOfCSCs | |
Private Attributes | |
unsigned | theCurrentDDU |
const CSCDCCEventData * | theDCCData |
a little confusing here. | |
CSCDDUDataItr * | theDDUItr |
unsigned | theNumberOfDDUs |
Definition at line 15 of file CSCChamberDataItr.h.
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.
References CSCDCCHeader::check(), CSCDCCEventData::dduData(), theCurrentDDU, theDCCData, theDDUItr, and theNumberOfDDUs.
00004 : 00005 theDCCData(0), 00006 theCurrentDDU(0) 00007 { 00008 // first try if it's DCC data. 00009 const CSCDCCHeader * dccHeader 00010 = reinterpret_cast<const CSCDCCHeader *>(buf); 00011 if(dccHeader->check()) 00012 { 00013 theDCCData = new CSCDCCEventData((unsigned short *)buf); 00014 theNumberOfDDUs = theDCCData->dduData().size(); 00015 theDDUItr = new CSCDDUDataItr( &(theDCCData->dduData()[theCurrentDDU]) ); 00016 } 00017 else 00018 { 00019 // it's DDU data, with only one DDU 00020 theDDUItr = new CSCDDUDataItr(buf); 00021 theNumberOfDDUs = 1; 00022 } 00023 }
CSCChamberDataItr::~CSCChamberDataItr | ( | ) |
Definition at line 26 of file CSCChamberDataItr.cc.
References theDCCData.
00027 { 00028 // safe, even if it's zero 00029 delete theDCCData; 00030 }
void CSCChamberDataItr::constructFromDCC | ( | const CSCDCCEventData & | ) | [private] |
for DCC data.
void CSCChamberDataItr::constructFromDDU | ( | const CSCDDUEventData & | ) | [private] |
for DDU-only data
void CSCChamberDataItr::initDDU | ( | ) | [private] |
sets theDDU & theNumberOfCSCs
bool CSCChamberDataItr::next | ( | ) |
Definition at line 33 of file CSCChamberDataItr.cc.
References CSCDCCEventData::dduData(), CSCDDUDataItr::next(), HLT_VtxMuL3::result, theCurrentDDU, theDCCData, theDDUItr, and theNumberOfDDUs.
00034 { 00035 bool result = true; 00036 if(!theDDUItr->next()) 00037 { 00038 if(++theCurrentDDU >= theNumberOfDDUs) 00039 { 00040 result = false; 00041 } 00042 else 00043 { 00044 // the next DDU exists, so initialize an itr 00045 assert(theDCCData != 0); 00046 delete theDDUItr; 00047 theDDUItr = new CSCDDUDataItr( &(theDCCData->dduData()[theCurrentDDU]) ); 00048 } 00049 } 00050 return result; 00051 }
const CSCEventData & CSCChamberDataItr::operator * | ( | void | ) |
Definition at line 54 of file CSCChamberDataItr.cc.
References theDDUItr.
00055 { 00056 return **theDDUItr; 00057 }
unsigned CSCChamberDataItr::theCurrentDDU [private] |
const CSCDCCEventData* CSCChamberDataItr::theDCCData [private] |
a little confusing here.
This class will either own theDCCData, in which case the DDUs points inside it, make a new vector of DDUs (length 1).
Definition at line 39 of file CSCChamberDataItr.h.
Referenced by CSCChamberDataItr(), next(), and ~CSCChamberDataItr().
CSCDDUDataItr* CSCChamberDataItr::theDDUItr [private] |
Definition at line 40 of file CSCChamberDataItr.h.
Referenced by CSCChamberDataItr(), next(), and operator *().
unsigned CSCChamberDataItr::theNumberOfDDUs [private] |