#include <DQMEventMessage.h>
Definition at line 73 of file DQMEventMessage.h.
DQMEventMsgView::DQMEventMsgView | ( | void * | buf | ) |
Constructor.
Definition at line 16 of file DQMEventMessage.cc.
References adler32_chksum_, buf_, code(), convert32(), Header::DQM_EVENT, eventAddr_, eventLen_, eventLength(), Exception, folderName_, headerSize(), host_name_len_, host_name_start_, MAX_STRING_SIZE, meCount(), meCountList_, nameListPtr_, protocolVersion(), releaseTag_, size(), subFolderCount_, subFolderIndexTable_, and subFolderName().
: buf_((uint8*)buf),head_(buf) { uint8* bufPtr; uint32 len; // verify that the buffer actually contains a DQM Event message if (this->code() != Header::DQM_EVENT) { throw cms::Exception("MessageDecoding", "DQMEventMsgView") << "Invalid DQM Event message code (" << this->code() << "). Should be " << Header::DQM_EVENT << "\n"; } // verify that the message has a protocol that we support if (this->protocolVersion() != 3) { throw cms::Exception("MessageDecoding", "DQMEventMsgView") << "Unsupport protocol version (" << this->protocolVersion() << ").\n"; } // set our buffer pointer to just beyond the fixed header data bufPtr = buf_ + sizeof(DQMEventHeader); // determine the release tag len = convert32(bufPtr); bufPtr += sizeof(uint32); if (len <= MAX_STRING_SIZE) // prevent something totally crazy // len >= 0, since len is unsigned. { releaseTag_.append((char *) bufPtr, len); } bufPtr += len; // determine the top-level folder name len = convert32(bufPtr); bufPtr += sizeof(uint32); if (len <= MAX_STRING_SIZE) // prevent something totally crazy // len >= 0, since len is unsigned. { folderName_.append((char *) bufPtr, len); } bufPtr += len; // determine the number of subfolders subFolderCount_ = convert32(bufPtr); bufPtr += sizeof(uint32); // loop over the subfolders to extract relevant quantities nameListPtr_.reset(new std::vector<std::string>()); for (int idx = 0; idx < (int) subFolderCount_; idx++) { // number of MEs in subfolder uint32 meCount = convert32(bufPtr); bufPtr += sizeof(uint32); meCountList_.push_back(meCount); // subfolder name std::string subFolderName = "Subfolder " + idx; uint32 nameLen = convert32(bufPtr); bufPtr += sizeof(uint32); if (nameLen <= MAX_STRING_SIZE) // prevent something totally crazy // nameLen >= 0, since nameLen is unsigned. { subFolderName.clear(); subFolderName.append((char *) bufPtr, nameLen); } bufPtr += nameLen; nameListPtr_->push_back(subFolderName); subFolderIndexTable_[subFolderName] = idx; } adler32_chksum_ = convert32(bufPtr); bufPtr += sizeof(uint32); host_name_len_ = *bufPtr; bufPtr += sizeof(uint8); host_name_start_ = bufPtr; bufPtr += host_name_len_; // determine the event length and address eventLen_ = convert32(bufPtr); bufPtr += sizeof(uint32); eventAddr_ = bufPtr; // check that the event data doesn't extend beyond the reported // size of the message if ((this->headerSize() + this->eventLength()) > this->size()) { throw cms::Exception("MessageDecoding", "DQMEventMsgView") << "Inconsistent data sizes. The size of the header (" << this->headerSize() << ") and the data (" << this->eventLength() << ") exceed the size of the message (" << this->size() << ").\n"; } }
uint32 DQMEventMsgView::adler32_chksum | ( | ) | const [inline] |
Definition at line 84 of file DQMEventMessage.h.
References adler32_chksum_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), and dumpDQMEventHeader().
{return adler32_chksum_;}
uint32 DQMEventMsgView::code | ( | ) | const [inline] |
Definition at line 78 of file DQMEventMessage.h.
References HeaderView::code(), and head_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), DQMEventMsgView(), and dumpDQMEventHeader().
uint32 DQMEventMsgView::compressionFlag | ( | ) | const |
Returns the compression flag (uncompressed data size or zero if uncompressed).
Definition at line 228 of file DQMEventMessage.cc.
References buf_, DQMEventHeader::compressionFlag_, convert32(), and h.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), and dumpDQMEventHeader().
{ DQMEventHeader* h = (DQMEventHeader*)buf_; return convert32(h->compressionFlag_); }
uint8* DQMEventMsgView::eventAddress | ( | ) | const [inline] |
Definition at line 82 of file DQMEventMessage.h.
References eventAddr_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), and StreamDQMOutputFile::write().
{ return eventAddr_; }
uint32 DQMEventMsgView::eventLength | ( | ) | const [inline] |
Definition at line 83 of file DQMEventMessage.h.
References eventLen_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), DQMEventMsgView(), and dumpDQMEventHeader().
{ return eventLen_; }
uint32 DQMEventMsgView::eventNumberAtUpdate | ( | ) | const |
Returns the event number associated with the DQM Event.
Definition at line 201 of file DQMEventMessage.cc.
References buf_, convert32(), DQMEventHeader::eventNumber_, and h.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), dumpDQMEventHeader(), edm::DQMHttpSource::readOneEvent(), and FUShmDQMOutputService::writeShmDQMData().
{ DQMEventHeader* h = (DQMEventHeader*)buf_; return convert32(h->eventNumber_); }
uint32 DQMEventMsgView::fuGuid | ( | ) | const |
Returns the GUID of the filter unit that created this update.
Definition at line 246 of file DQMEventMessage.cc.
References buf_, convert32(), DQMEventHeader::fuGuid_, and h.
Referenced by dumpDQMEventHeader().
{ DQMEventHeader* h = (DQMEventHeader*)buf_; return convert32(h->fuGuid_); }
uint32 DQMEventMsgView::fuProcessId | ( | ) | const |
Returns the process ID of the filter unit that created this update.
Definition at line 237 of file DQMEventMessage.cc.
References buf_, convert32(), DQMEventHeader::fuProcessId_, and h.
Referenced by dumpDQMEventHeader().
{ DQMEventHeader* h = (DQMEventHeader*)buf_; return convert32(h->fuProcessId_); }
uint32 DQMEventMsgView::headerSize | ( | ) | const |
Returns the size of the DQM Event header.
Definition at line 183 of file DQMEventMessage.cc.
References buf_, convert32(), h, and DQMEventHeader::headerSize_.
Referenced by DQMEventMsgView(), StreamDQMOutputFile::write(), and StreamDQMOutputFile::writeDQMEventHeader().
{ DQMEventHeader* h = (DQMEventHeader*)buf_; return convert32(h->headerSize_); }
std::string DQMEventMsgView::hostName | ( | ) | const |
Definition at line 268 of file DQMEventMessage.cc.
References host_name_len_, and host_name_start_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), and dumpDQMEventHeader().
{ return std::string(reinterpret_cast<char *>(host_name_start_),host_name_len_); }
uint32 DQMEventMsgView::hostName_len | ( | ) | const [inline] |
Definition at line 86 of file DQMEventMessage.h.
References host_name_len_.
{return host_name_len_;}
uint32 DQMEventMsgView::lumiSection | ( | ) | const |
Returns the lumi section associated with the DQM Event.
Definition at line 210 of file DQMEventMessage.cc.
References buf_, convert32(), h, and DQMEventHeader::lumiSection_.
Referenced by stor::DQMTopLevelFolder::addDQMEvent(), smproxy::DQMEventMsg::DQMEventMsg(), dumpDQMEventHeader(), edm::DQMHttpSource::readOneEvent(), and smproxy::DQMArchiver::writeDQMEventToFile().
{ DQMEventHeader* h = (DQMEventHeader*)buf_; return convert32(h->lumiSection_); }
uint32 DQMEventMsgView::meCount | ( | std::string const & | subFolderName | ) | const |
Returns the number of monitor elements in the specified subfolder.
Definition at line 136 of file DQMEventMessage.cc.
References Exception, and subFolderIndexTable_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), DQMEventMsgView(), and dumpDQMEventView().
{ // lookup the index of the specified subfolder std::map<std::string, uint32>::const_iterator subFolderIter; subFolderIter = subFolderIndexTable_.find(subFolderName); // throw an exception if the name was not found if (subFolderIter == subFolderIndexTable_.end()) { throw cms::Exception("MessageDecoding", "DQMEventMsgView") << "Unable to find the subfolder index for \"" << subFolderName << "\".\n"; } // fetch the count by index return this->meCount(subFolderIter->second); }
Returns the number of monitor elements in the subfolder at the specified index.
Definition at line 158 of file DQMEventMessage.cc.
References Exception, meCountList_, and subFolderCount_.
{ // catch attempts to access an invalid entry if (subFolderIndex >= subFolderCount_) { throw cms::Exception("MessageDecoding", "DQMEventMsgView") << "Invalid subfolder index (" << subFolderIndex << ") - " << "the number of subfolders is " << subFolderCount_ << ".\n"; } return meCountList_[subFolderIndex]; }
uint32 DQMEventMsgView::mergeCount | ( | ) | const |
Returns the number of merges
Definition at line 255 of file DQMEventMessage.cc.
References buf_, convert32(), h, and DQMEventHeader::mergeCount_.
Referenced by stor::DQMTopLevelFolder::addDQMEvent(), edm::DQMHttpSource::addEventToDQMBackend(), and dumpDQMEventHeader().
{ DQMEventHeader* h = (DQMEventHeader*)buf_; return convert32(h->mergeCount_); }
uint32 DQMEventMsgView::protocolVersion | ( | ) | const |
Returns the protocol version of the DQM Event.
Definition at line 174 of file DQMEventMessage.cc.
References buf_, convert32(), h, and DQMEventHeader::protocolVersion_.
Referenced by DQMEventMsgView(), and dumpDQMEventHeader().
{ DQMEventHeader* h = (DQMEventHeader*)buf_; return convert32(h->protocolVersion_); }
std::string DQMEventMsgView::releaseTag | ( | ) | const [inline] |
Definition at line 101 of file DQMEventMessage.h.
References releaseTag_.
Referenced by stor::DQMTopLevelFolder::addDQMEvent(), and dumpDQMEventHeader().
{ return releaseTag_; }
uint32 DQMEventMsgView::runNumber | ( | ) | const |
Returns the run number associated with the DQM Event.
Definition at line 192 of file DQMEventMessage.cc.
References buf_, convert32(), h, and DQMEventHeader::runNumber_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), smproxy::DQMEventMsg::DQMEventMsg(), dumpDQMEventHeader(), edm::DQMHttpSource::readOneEvent(), smproxy::DQMArchiver::writeDQMEventToFile(), and FUShmDQMOutputService::writeShmDQMData().
{ DQMEventHeader* h = (DQMEventHeader*)buf_; return convert32(h->runNumber_); }
uint32 DQMEventMsgView::size | ( | void | ) | const [inline] |
Definition at line 79 of file DQMEventMessage.h.
References head_, and HeaderView::size().
Referenced by stor::DQMTopLevelFolder::addDQMEvent(), edm::StreamDQMDeserializer::deserializeDQMEvent(), smproxy::DQMEventMsg::DQMEventMsg(), DQMEventMsgView(), dumpDQMEventHeader(), StreamDQMOutputFile::write(), and smproxy::DQMArchiver::writeDQMEventToFile().
uint8* DQMEventMsgView::startAddress | ( | ) | const [inline] |
Definition at line 81 of file DQMEventMessage.h.
References buf_.
Referenced by smproxy::DQMEventMsg::DQMEventMsg(), and StreamDQMOutputFile::writeDQMEventHeader().
{ return buf_; }
uint32 DQMEventMsgView::subFolderCount | ( | ) | const [inline] |
Definition at line 104 of file DQMEventMessage.h.
References subFolderCount_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent().
{ return subFolderCount_; }
std::string DQMEventMsgView::subFolderName | ( | uint32 const | subFolderIndex | ) | const |
Returns the name of the subfolder at the specified index.
Definition at line 120 of file DQMEventMessage.cc.
References Exception, nameListPtr_, and subFolderCount_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), and DQMEventMsgView().
{ // catch attempts to access an invalid entry if (subFolderIndex >= subFolderCount_) { throw cms::Exception("MessageDecoding", "DQMEventMsgView") << "Invalid subfolder index (" << subFolderIndex << ") - " << "the number of subfolders is " << subFolderCount_ << ".\n"; } return (*nameListPtr_)[subFolderIndex]; }
boost::shared_ptr< std::vector< std::string > > DQMEventMsgView::subFolderNames | ( | ) | const |
Returns a shared pointer to the list of subfolder names.
Definition at line 112 of file DQMEventMessage.cc.
References nameListPtr_.
Referenced by dumpDQMEventView().
{ return nameListPtr_; }
edm::Timestamp DQMEventMsgView::timeStamp | ( | ) | const |
Definition at line 262 of file DQMEventMessage.cc.
References buf_, convert64(), h, and DQMEventHeader::timeStamp_.
Referenced by stor::DQMTopLevelFolder::addDQMEvent(), and edm::DQMHttpSource::readOneEvent().
{ DQMEventHeader* h = (DQMEventHeader*)buf_; return edm::Timestamp(convert64(h->timeStamp_)); }
std::string DQMEventMsgView::topFolderName | ( | ) | const [inline] |
Definition at line 102 of file DQMEventMessage.h.
References folderName_.
Referenced by stor::DQMTopLevelFolder::addDQMEvent(), smproxy::DQMEventMsg::DQMEventMsg(), dumpDQMEventHeader(), smproxy::DQMArchiver::updateLastRecord(), and FUShmDQMOutputService::writeShmDQMData().
{ return folderName_; }
uint32 DQMEventMsgView::updateNumber | ( | ) | const |
Returns the update number of the DQM Event.
Definition at line 219 of file DQMEventMessage.cc.
References buf_, convert32(), h, and DQMEventHeader::updateNumber_.
Referenced by stor::DQMTopLevelFolder::addDQMEvent(), dumpDQMEventHeader(), and smproxy::DQMArchiver::handleDQMEvent().
{ DQMEventHeader* h = (DQMEventHeader*)buf_; return convert32(h->updateNumber_); }
uint32 DQMEventMsgView::adler32_chksum_ [private] |
Definition at line 118 of file DQMEventMessage.h.
Referenced by adler32_chksum(), and DQMEventMsgView().
uint8* DQMEventMsgView::buf_ [private] |
Definition at line 112 of file DQMEventMessage.h.
Referenced by compressionFlag(), DQMEventMsgView(), eventNumberAtUpdate(), fuGuid(), fuProcessId(), headerSize(), lumiSection(), mergeCount(), protocolVersion(), runNumber(), startAddress(), timeStamp(), and updateNumber().
uint8* DQMEventMsgView::eventAddr_ [private] |
Definition at line 116 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), and eventAddress().
uint32 DQMEventMsgView::eventLen_ [private] |
Definition at line 117 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), and eventLength().
std::string DQMEventMsgView::folderName_ [private] |
Definition at line 115 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), and topFolderName().
HeaderView DQMEventMsgView::head_ [private] |
Definition at line 113 of file DQMEventMessage.h.
uint32 DQMEventMsgView::host_name_len_ [private] |
Definition at line 120 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), hostName(), and hostName_len().
uint8* DQMEventMsgView::host_name_start_ [private] |
Definition at line 119 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), and hostName().
std::vector<uint32> DQMEventMsgView::meCountList_ [private] |
Definition at line 124 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), and meCount().
boost::shared_ptr< std::vector<std::string> > DQMEventMsgView::nameListPtr_ [private] |
Definition at line 123 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), subFolderName(), and subFolderNames().
std::string DQMEventMsgView::releaseTag_ [private] |
Definition at line 114 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), and releaseTag().
uint32 DQMEventMsgView::subFolderCount_ [private] |
Definition at line 121 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), meCount(), subFolderCount(), and subFolderName().
std::map<std::string, uint32> DQMEventMsgView::subFolderIndexTable_ [private] |
Definition at line 122 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), and meCount().