#include <CSCDDUEventData.h>
Public Member Functions | |
void | add (CSCEventData &, int dmbId, int dduInput) |
for making events. Sets the bxnum and lvl1num inside the chamber event | |
bool | check () const |
const std::vector< CSCEventData > & | cscData () const |
accessor to data | |
CSCDDUEventData (unsigned short *buf, CSCDCCExaminer *examiner=NULL) | |
CSCDDUEventData (const CSCDDUHeader &) | |
CSCDCCHeader | dccHeader () const |
CSCDCCTrailer | dccTrailer () const |
void | decodeStatus (int status) const |
void | decodeStatus () const |
CSCDDUHeader | header () const |
boost::dynamic_bitset | pack () |
Alex check this 16 or 64. | |
int | size () const |
int | sizeInWords () const |
CSCDDUTrailer | trailer () const |
uint16_t | trailer0 () const |
~CSCDDUEventData () | |
Static Public Member Functions | |
static void | setDebug (bool value) |
static void | setErrorMask (unsigned int value) |
Public Attributes | |
long unsigned int | errorstat |
trailer info | |
Static Public Attributes | |
static bool | debug = false |
static unsigned int | errMask = 0xFFFFFFFF |
Protected Member Functions | |
void | unpack_data (unsigned short *buf, CSCDCCExaminer *examiner=NULL) |
a good test routine would be to unpack data, then pack it again. | |
Protected Attributes | |
std::vector< CSCEventData > | theData |
CSCDCCHeader | theDCCHeader |
CSCDCCTrailer | theDCCTrailer |
CSCDDUHeader | theDDUHeader |
CSCDDUTrailer | theDDUTrailer |
uint16_t | theDDUTrailer0 |
int | theSizeInWords |
Definition at line 19 of file CSCDDUEventData.h.
CSCDDUEventData::CSCDDUEventData | ( | const CSCDDUHeader & | header | ) | [explicit] |
Definition at line 19 of file CSCDDUEventData.cc.
References header(), and theDDUHeader.
{ theDDUHeader = header; }
CSCDDUEventData::CSCDDUEventData | ( | unsigned short * | buf, |
CSCDCCExaminer * | examiner = NULL |
||
) | [explicit] |
CSCDDUEventData::~CSCDDUEventData | ( | ) |
Definition at line 30 of file CSCDDUEventData.cc.
{ }
void CSCDDUEventData::add | ( | CSCEventData & | cscData, |
int | dmbId, | ||
int | dduInput | ||
) |
for making events. Sets the bxnum and lvl1num inside the chamber event
Definition at line 35 of file CSCDDUEventData.cc.
References CSCDDUHeader::bxnum(), CSCEventData::dmbHeader(), CSCDDUHeader::lvl1num(), CSCDDUHeader::setDMBDAV(), CSCDMBHeader::setdmbID(), CSCEventData::setEventInformation(), theData, and theDDUHeader.
{ theDDUHeader.setDMBDAV(dduInput); //@@ Tim: The following sets the word which is supposed to be CSCs in error, with bit 15 set for DMB Full //@@ so I think sim should not set it at all //@@ theDDUTrailer.setDMBDAV(dmbId); cscData.dmbHeader()->setdmbID(dmbId); cscData.setEventInformation(theDDUHeader.bxnum(), theDDUHeader.lvl1num()); theData.push_back(cscData); }
bool CSCDDUEventData::check | ( | ) | const |
Definition at line 314 of file CSCDDUEventData.cc.
References CSCDDUTrailer::check(), CSCDDUHeader::check(), debug, LogTrace, sizeInWords(), theDDUHeader, theDDUTrailer, and CSCDDUTrailer::wordcount().
Referenced by CSCDCCEventData::unpack_data().
{ // the trailer counts in 64-bit words if (debug) { LogTrace ("CSCDDUEventData|CSCRawToDigi") << sizeInWords(); LogTrace ("CSCDDUEventData|CSCRawToDigi") << "wordcount = " << theDDUTrailer.wordcount()*4; } return theDDUHeader.check() && theDDUTrailer.check(); }
const std::vector<CSCEventData>& CSCDDUEventData::cscData | ( | ) | const [inline] |
accessor to data
Definition at line 34 of file CSCDDUEventData.h.
References theData.
Referenced by CSCDDUDataItr::CSCDDUDataItr(), CSCDDUDataItr::operator*(), and cscdqm::EventProcessor::processDDU().
{return theData;}
CSCDCCHeader CSCDDUEventData::dccHeader | ( | ) | const [inline] |
CSCDCCTrailer CSCDDUEventData::dccTrailer | ( | ) | const [inline] |
void CSCDDUEventData::decodeStatus | ( | int | status | ) | const |
prints out the error associated with this status from the header or trailer
this is a mask for printing out errors
Definition at line 51 of file CSCDDUEventData.cc.
References errMask, and LogTrace.
{ // JRG is Jason Gilmore // JRG, low-order 16-bit status (most serious errors): if((code&errMask)>0) { // JRG, low-order 16-bit status (most serious errors): if((code&0x0000F000)>0) { if((0x00008000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Critical Error, ** needs reset **"; if((0x00004000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Single Error, bad event"; if((0x00002000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Single Warning"; if((0x00001000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Near Full Warning"; } if((code&0x00000F00)>0) { if((0x00000800&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU 64-bit Alignment Error"; if((0x00000400&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Control DLL Error occured"; if((0x00000200&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU DMB Error occurred"; if((0x00000100&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Lost In Event Error"; } if((code&0x000000F0)>0) { if((0x00000080&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Lost In Data Error occurred"; if((0x00000040&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Timeout Error"; if((0x00000020&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " TMB or ALCT CRC Error"; if((0x00000010&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Multiple Transmit Errors"; } if((code&0x0000000F)>0) { if((0x00000008&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Sync Lost or FIFO Full Error"; if((0x00000004&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Fiber/FIFO Connection Error"; if((0x00000002&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU L1A Match Error"; if((0x00000001&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU DMB or CFEB CRC Error"; } if((code&0xF0000000)>0) { // JRG, high-order 16-bit status (not-so-serious errors): if((0x80000000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU DMB LCT/DAV/Movlp Mismatch"; if((0x40000000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU-CFEB L1 Mismatch"; if((0x20000000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU saw no good DMB CRCs"; if((0x10000000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU CFEB Count Error"; } if((code&0x0F000000)>0) { if((0x08000000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU FirstDat Error"; if((0x04000000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU L1A-FIFO Full Error"; if((0x02000000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Data Stuck in FIFO"; if((0x01000000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU NoLiveFibers Error"; } if((code&0x00F00000)>0) { if((0x00800000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Spwd single-bit Warning"; if((0x00400000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Input FPGA Error"; if((0x00200000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU DAQ Stop bit set"; if((0x00100000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU DAQ says Not Ready"; if((0x00300000&code)==0x00200000) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU DAQ Applied Backpressure"; } if((code&0x000F0000)>0) { if((0x00080000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU TMB Error"; if((0x00040000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU ALCT Error"; if((0x00020000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Trigger Readout Wordcount Error"; if((0x00010000&code)>0) LogTrace ("CSCDDUEventData|CSCRawToDigi") << " DDU Trigger L1A Match Error"; } } }
void CSCDDUEventData::decodeStatus | ( | ) | const |
Definition at line 46 of file CSCDDUEventData.cc.
References CSCDDUTrailer::errorstat(), and theDDUTrailer.
Referenced by CSCEventData::unpack_data().
{ this->decodeStatus(theDDUTrailer.errorstat()); }
CSCDDUHeader CSCDDUEventData::header | ( | ) | const [inline] |
Definition at line 36 of file CSCDDUEventData.h.
References theDDUHeader.
Referenced by CSCDDUEventData(), and cscdqm::EventProcessor::processDDU().
{return theDDUHeader;}
boost::dynamic_bitset CSCDDUEventData::pack | ( | ) |
Alex check this 16 or 64.
returns packed event data
Definition at line 326 of file CSCDDUEventData.cc.
References python::multivaluedict::append(), CSCDDUTrailer::data(), CSCDDUHeader::data(), i, query::result, CSCDDUTrailer::setWordCount(), CSCDDUHeader::sizeInWords(), CSCDDUTrailer::sizeInWords(), theData, theDDUHeader, theDDUTrailer, theSizeInWords, and bitset_utilities::ushortToBitset().
{ boost::dynamic_bitset<> result = bitset_utilities::ushortToBitset( theDDUHeader.sizeInWords()*16, theDDUHeader.data()); //std::cout <<"SANDRIK inside DDUEvdata check = "; //theDDUHeader.check(); //std::cout <<std::endl; //std::cout <<"printing out ddu header words"<<std::endl; //for (unsigned int i=0;i<theDDUHeader.sizeInWords();i++) { // unsigned short * buf = theDDUHeader.data(); // printf("%04x %04x %04x %04x\n",buf[i+3],buf[i+2],buf[i+1],buf[i]); // i+=3; //} //std::cout <<"printing out ddu header words via bitset"<<std::endl; //bitset_utilities::printWords(result); for(unsigned int i = 0; i < theData.size(); ++i) { result = bitset_utilities::append(result,theData[i].pack()); } theSizeInWords = result.size()/16 + theDDUTrailer.sizeInWords(); // 64-bit word count theDDUTrailer.setWordCount(theSizeInWords/4); boost::dynamic_bitset<> dduTrailer = bitset_utilities::ushortToBitset ( theDDUTrailer.sizeInWords()*16, theDDUTrailer.data()); result = bitset_utilities::append(result,dduTrailer); return result; }
static void CSCDDUEventData::setDebug | ( | bool | value | ) | [inline, static] |
Definition at line 30 of file CSCDDUEventData.h.
References debug, and relativeConstraints::value.
Referenced by CSCDCCUnpacker::CSCDCCUnpacker().
static void CSCDDUEventData::setErrorMask | ( | unsigned int | value | ) | [inline, static] |
Definition at line 31 of file CSCDDUEventData.h.
References errMask, and relativeConstraints::value.
Referenced by CSCDCCUnpacker::CSCDCCUnpacker().
int CSCDDUEventData::size | ( | void | ) | const [inline] |
Definition at line 57 of file CSCDDUEventData.h.
References theSizeInWords.
Referenced by cscdqm::EventProcessor::processDDU(), and CSCEventData::unpack_data().
{return theSizeInWords*16;}
int CSCDDUEventData::sizeInWords | ( | ) | const [inline] |
Definition at line 56 of file CSCDDUEventData.h.
References theSizeInWords.
Referenced by check(), and CSCDCCEventData::unpack_data().
{return theSizeInWords;}
CSCDDUTrailer CSCDDUEventData::trailer | ( | ) | const [inline] |
Definition at line 37 of file CSCDDUEventData.h.
References theDDUTrailer.
Referenced by cscdqm::EventProcessor::processDDU().
{return theDDUTrailer;}
uint16_t CSCDDUEventData::trailer0 | ( | ) | const [inline] |
Definition at line 38 of file CSCDDUEventData.h.
References theDDUTrailer0.
{return theDDUTrailer0;}
void CSCDDUEventData::unpack_data | ( | unsigned short * | buf, |
CSCDCCExaminer * | examiner = NULL |
||
) | [protected] |
a good test routine would be to unpack data, then pack it again.
bool CSCDDUEventData::debug = false [static] |
Definition at line 63 of file CSCDDUEventData.h.
Referenced by check(), setDebug(), and CSCEventData::unpack_data().
uint32_t CSCDDUEventData::errMask = 0xFFFFFFFF [static] |
Definition at line 64 of file CSCDDUEventData.h.
Referenced by decodeStatus(), setErrorMask(), and CSCEventData::unpack_data().
long unsigned int CSCDDUEventData::errorstat |
trailer info
Definition at line 48 of file CSCDDUEventData.h.
Referenced by CSCEventData::unpack_data().
std::vector<CSCEventData> CSCDDUEventData::theData [protected] |
Definition at line 72 of file CSCDDUEventData.h.
Referenced by add(), cscData(), pack(), and CSCEventData::unpack_data().
CSCDCCHeader CSCDDUEventData::theDCCHeader [protected] |
Definition at line 69 of file CSCDDUEventData.h.
Referenced by dccHeader().
CSCDCCTrailer CSCDDUEventData::theDCCTrailer [protected] |
Definition at line 74 of file CSCDDUEventData.h.
Referenced by dccTrailer().
CSCDDUHeader CSCDDUEventData::theDDUHeader [protected] |
Definition at line 70 of file CSCDDUEventData.h.
Referenced by add(), check(), CSCDDUEventData(), header(), pack(), and CSCEventData::unpack_data().
CSCDDUTrailer CSCDDUEventData::theDDUTrailer [protected] |
Definition at line 73 of file CSCDDUEventData.h.
Referenced by check(), decodeStatus(), pack(), trailer(), and CSCEventData::unpack_data().
uint16_t CSCDDUEventData::theDDUTrailer0 [protected] |
Definition at line 75 of file CSCDDUEventData.h.
Referenced by trailer0(), and CSCEventData::unpack_data().
int CSCDDUEventData::theSizeInWords [protected] |
Definition at line 76 of file CSCDDUEventData.h.
Referenced by pack(), size(), sizeInWords(), and CSCEventData::unpack_data().