#include <IOPool/Streamer/interface/DQMEventMessage.h>
Public Member Functions | |
uint32 | code () const |
uint32 | compressionFlag () const |
Returns the compression flag (uncompressed data size or zero if uncompressed). | |
DQMEventMsgView (void *buf) | |
Constructor. | |
uint8 * | eventAddress () const |
uint32 | eventLength () const |
uint32 | eventNumberAtUpdate () const |
Returns the event number associated with the DQM Event. | |
uint32 | fuGuid () const |
Returns the GUID of the filter unit that created this update. | |
uint32 | fuProcessId () const |
Returns the process ID of the filter unit that created this update. | |
uint32 | headerSize () const |
Returns the size of the DQM Event header. | |
uint32 | lumiSection () const |
Returns the lumi section associated with the DQM Event. | |
uint32 | meCount (uint32 const subFolderIndex) const |
Returns the number of monitor elements in the subfolder at the specified index. | |
uint32 | meCount (std::string const &subFolderName) const |
Returns the number of monitor elements in the specified subfolder. | |
uint32 | protocolVersion () const |
Returns the protocol version of the DQM Event. | |
std::string | releaseTag () const |
uint32 | reserved () const |
Returns the reserved word associated with the DQM Event. | |
uint32 | runNumber () const |
Returns the run number associated with the DQM Event. | |
uint32 | size () const |
uint8 * | startAddress () const |
uint32 | subFolderCount () const |
std::string | subFolderName (uint32 const subFolderIndex) const |
Returns the name of the subfolder at the specified index. | |
boost::shared_ptr< std::vector < std::string > > | subFolderNames () const |
Returns a shared pointer to the list of subfolder names. | |
edm::Timestamp | timeStamp () const |
std::string | topFolderName () const |
uint32 | updateNumber () const |
Returns the update number of the DQM Event. | |
Private Attributes | |
uint8 * | buf_ |
uint8 * | eventAddr_ |
uint32 | eventLen_ |
std::string | folderName_ |
HeaderView | head_ |
std::vector< uint32 > | meCountList_ |
boost::shared_ptr< std::vector < std::string > > | nameListPtr_ |
std::string | releaseTag_ |
uint32 | subFolderCount_ |
std::map< std::string, uint32 > | subFolderIndexTable_ |
Definition at line 70 of file DQMEventMessage.h.
DQMEventMsgView::DQMEventMsgView | ( | void * | buf | ) |
Constructor.
Definition at line 16 of file DQMEventMessage.cc.
References buf_, code(), convert32(), Header::DQM_EVENT, eventAddr_, eventLen_, eventLength(), Exception, folderName_, headerSize(), int, len, MAX_STRING_SIZE, meCount(), meCountList_, nameListPtr_, protocolVersion(), releaseTag_, size(), subFolderCount_, subFolderIndexTable_, and subFolderName().
00016 : 00017 buf_((uint8*)buf),head_(buf) 00018 { 00019 uint8* bufPtr; 00020 uint32 len; 00021 00022 // verify that the buffer actually contains a DQM Event message 00023 if (this->code() != Header::DQM_EVENT) 00024 { 00025 throw cms::Exception("MessageDecoding", "DQMEventMsgView") 00026 << "Invalid DQM Event message code (" << this->code() 00027 << "). Should be " << Header::DQM_EVENT << "\n"; 00028 } 00029 00030 // verify that the message has a protocol that we support 00031 if (this->protocolVersion() != 2) 00032 { 00033 throw cms::Exception("MessageDecoding", "DQMEventMsgView") 00034 << "Unsupport protocol version (" << this->protocolVersion() << ").\n"; 00035 } 00036 00037 // set our buffer pointer to just beyond the fixed header data 00038 bufPtr = buf_ + sizeof(DQMEventHeader); 00039 00040 // determine the release tag 00041 len = convert32(bufPtr); 00042 bufPtr += sizeof(uint32); 00043 if (len >= 0) 00044 { 00045 if (len <= MAX_STRING_SIZE) // prevent something totally crazy 00046 { 00047 releaseTag_.append((char *) bufPtr, len); 00048 } 00049 bufPtr += len; 00050 } 00051 00052 // determine the top-level folder name 00053 len = convert32(bufPtr); 00054 bufPtr += sizeof(uint32); 00055 if (len >= 0) 00056 { 00057 if (len <= MAX_STRING_SIZE) // prevent something totally crazy 00058 { 00059 folderName_.append((char *) bufPtr, len); 00060 } 00061 bufPtr += len; 00062 } 00063 00064 // determine the number of subfolders 00065 subFolderCount_ = convert32(bufPtr); 00066 bufPtr += sizeof(uint32); 00067 00068 // loop over the subfolders to extract relevant quantities 00069 nameListPtr_.reset(new std::vector<std::string>()); 00070 for (int idx = 0; idx < (int) subFolderCount_; idx++) 00071 { 00072 // number of MEs in subfolder 00073 uint32 meCount = convert32(bufPtr); 00074 bufPtr += sizeof(uint32); 00075 meCountList_.push_back(meCount); 00076 00077 // subfolder name 00078 std::string subFolderName = "Subfolder " + idx; 00079 uint32 nameLen = convert32(bufPtr); 00080 bufPtr += sizeof(uint32); 00081 if (nameLen >= 0) 00082 { 00083 if (nameLen <= MAX_STRING_SIZE) // prevent something totally crazy 00084 { 00085 subFolderName.clear(); 00086 subFolderName.append((char *) bufPtr, nameLen); 00087 } 00088 bufPtr += nameLen; 00089 } 00090 nameListPtr_->push_back(subFolderName); 00091 subFolderIndexTable_[subFolderName] = idx; 00092 } 00093 00094 // determine the event length and address 00095 eventLen_ = convert32(bufPtr); 00096 bufPtr += sizeof(uint32); 00097 eventAddr_ = bufPtr; 00098 00099 // check that the event data doesn't extend beyond the reported 00100 // size of the message 00101 if ((this->headerSize() + this->eventLength()) > this->size()) 00102 { 00103 throw cms::Exception("MessageDecoding", "DQMEventMsgView") 00104 << "Inconsistent data sizes. The size of the header (" 00105 << this->headerSize() << ") and the data (" << this->eventLength() 00106 << ") exceed the size of the message (" << this->size() << ").\n"; 00107 } 00108 }
Definition at line 75 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 230 of file DQMEventMessage.cc.
References buf_, DQMEventHeader::compressionFlag_, convert32(), and h.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), dumpDQMEventHeader(), edm::DQMHttpSource::getOneDQMEvent(), and FUShmDQMOutputService::postEventProcessing().
00231 { 00232 DQMEventHeader* h = (DQMEventHeader*)buf_; 00233 return convert32(h->compressionFlag_); 00234 }
uint8* DQMEventMsgView::eventAddress | ( | ) | const [inline] |
Definition at line 79 of file DQMEventMessage.h.
References eventAddr_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), and StreamDQMOutputFile::write().
00079 { return eventAddr_; }
uint32 DQMEventMsgView::eventLength | ( | ) | const [inline] |
Definition at line 80 of file DQMEventMessage.h.
References eventLen_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), DQMEventMsgView(), and dumpDQMEventHeader().
00080 { return eventLen_; }
uint32 DQMEventMsgView::eventNumberAtUpdate | ( | ) | const |
Returns the event number associated with the DQM Event.
Definition at line 203 of file DQMEventMessage.cc.
References buf_, convert32(), DQMEventHeader::eventNumber_, and h.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), stor::StorageManager::DQMeventdataWebPage(), stor::SMProxyServer::DQMeventdataWebPage(), dumpDQMEventHeader(), edm::DQMHttpSource::getOneDQMEvent(), stor::DQMServiceManager::manageDQMEventMsg(), FUShmDQMOutputService::postEventProcessing(), stor::DQMEventServer::processDQMEvent(), and FUShmDQMOutputService::writeShmDQMData().
00204 { 00205 DQMEventHeader* h = (DQMEventHeader*)buf_; 00206 return convert32(h->eventNumber_); 00207 }
uint32 DQMEventMsgView::fuGuid | ( | ) | const |
Returns the GUID of the filter unit that created this update.
Definition at line 248 of file DQMEventMessage.cc.
References buf_, convert32(), DQMEventHeader::fuGuid_, and h.
Referenced by dumpDQMEventHeader().
00249 { 00250 DQMEventHeader* h = (DQMEventHeader*)buf_; 00251 return convert32(h->fuGuid_); 00252 }
uint32 DQMEventMsgView::fuProcessId | ( | ) | const |
Returns the process ID of the filter unit that created this update.
Definition at line 239 of file DQMEventMessage.cc.
References buf_, convert32(), DQMEventHeader::fuProcessId_, and h.
Referenced by dumpDQMEventHeader().
00240 { 00241 DQMEventHeader* h = (DQMEventHeader*)buf_; 00242 return convert32(h->fuProcessId_); 00243 }
uint32 DQMEventMsgView::headerSize | ( | ) | const |
Returns the size of the DQM Event header.
Definition at line 185 of file DQMEventMessage.cc.
References buf_, convert32(), h, and DQMEventHeader::headerSize_.
Referenced by DQMEventMsgView(), edm::DQMHttpSource::getOneDQMEvent(), FUShmDQMOutputService::postEventProcessing(), StreamDQMOutputFile::write(), and StreamDQMOutputFile::writeDQMEventHeader().
00186 { 00187 DQMEventHeader* h = (DQMEventHeader*)buf_; 00188 return convert32(h->headerSize_); 00189 }
uint32 DQMEventMsgView::lumiSection | ( | ) | const |
Returns the lumi section associated with the DQM Event.
Definition at line 212 of file DQMEventMessage.cc.
References buf_, convert32(), h, and DQMEventHeader::lumiSection_.
Referenced by dumpDQMEventHeader(), edm::DQMHttpSource::getOneDQMEvent(), stor::DQMServiceManager::manageDQMEventMsg(), and FUShmDQMOutputService::postEventProcessing().
00213 { 00214 DQMEventHeader* h = (DQMEventHeader*)buf_; 00215 return convert32(h->lumiSection_); 00216 }
Returns the number of monitor elements in the subfolder at the specified index.
Definition at line 160 of file DQMEventMessage.cc.
References Exception, meCountList_, and subFolderCount_.
00161 { 00162 // catch attempts to access an invalid entry 00163 if (subFolderIndex >= subFolderCount_) 00164 { 00165 throw cms::Exception("MessageDecoding", "DQMEventMsgView") 00166 << "Invalid subfolder index (" << subFolderIndex << ") - " 00167 << "the number of subfolders is " << subFolderCount_ << ".\n"; 00168 } 00169 00170 return meCountList_[subFolderIndex]; 00171 }
uint32 DQMEventMsgView::meCount | ( | std::string const & | subFolderName | ) | const |
Returns the number of monitor elements in the specified subfolder.
Definition at line 138 of file DQMEventMessage.cc.
References Exception, and subFolderIndexTable_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), DQMEventMsgView(), and dumpDQMEventView().
00139 { 00140 // lookup the index of the specified subfolder 00141 std::map<std::string, uint32>::const_iterator subFolderIter; 00142 subFolderIter = subFolderIndexTable_.find(subFolderName); 00143 00144 // throw an exception if the name was not found 00145 if (subFolderIter == subFolderIndexTable_.end()) 00146 { 00147 throw cms::Exception("MessageDecoding", "DQMEventMsgView") 00148 << "Unable to find the subfolder index for \"" 00149 << subFolderName << "\".\n"; 00150 } 00151 00152 // fetch the count by index 00153 return this->meCount(subFolderIter->second); 00154 }
uint32 DQMEventMsgView::protocolVersion | ( | ) | const |
Returns the protocol version of the DQM Event.
Definition at line 176 of file DQMEventMessage.cc.
References buf_, convert32(), h, and DQMEventHeader::protocolVersion_.
Referenced by DQMEventMsgView(), dumpDQMEventHeader(), edm::DQMHttpSource::getOneDQMEvent(), and FUShmDQMOutputService::postEventProcessing().
00177 { 00178 DQMEventHeader* h = (DQMEventHeader*)buf_; 00179 return convert32(h->protocolVersion_); 00180 }
std::string DQMEventMsgView::releaseTag | ( | ) | const [inline] |
Definition at line 95 of file DQMEventMessage.h.
References releaseTag_.
Referenced by dumpDQMEventHeader(), edm::DQMHttpSource::getOneDQMEvent(), stor::DQMServiceManager::manageDQMEventMsg(), and FUShmDQMOutputService::postEventProcessing().
00095 { return releaseTag_; }
uint32 DQMEventMsgView::reserved | ( | ) | const |
Returns the reserved word associated with the DQM Event.
Definition at line 257 of file DQMEventMessage.cc.
References buf_, convert32(), h, and DQMEventHeader::reserved_.
Referenced by dumpDQMEventHeader(), edm::DQMHttpSource::getOneDQMEvent(), and FUShmDQMOutputService::postEventProcessing().
00258 { 00259 DQMEventHeader* h = (DQMEventHeader*)buf_; 00260 return convert32(h->reserved_); 00261 }
uint32 DQMEventMsgView::runNumber | ( | ) | const |
Returns the run number associated with the DQM Event.
Definition at line 194 of file DQMEventMessage.cc.
References buf_, convert32(), h, and DQMEventHeader::runNumber_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), dumpDQMEventHeader(), edm::DQMHttpSource::getOneDQMEvent(), stor::DQMServiceManager::manageDQMEventMsg(), FUShmDQMOutputService::postEventProcessing(), and FUShmDQMOutputService::writeShmDQMData().
00195 { 00196 DQMEventHeader* h = (DQMEventHeader*)buf_; 00197 return convert32(h->runNumber_); 00198 }
Definition at line 76 of file DQMEventMessage.h.
References head_, and HeaderView::size().
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), stor::StorageManager::DQMeventdataWebPage(), stor::SMProxyServer::DQMeventdataWebPage(), DQMEventMsgView(), dumpDQMEventHeader(), stor::DQMEventServer::processDQMEvent(), stor::DQMConsumerPipe::pushEvent(), and StreamDQMOutputFile::write().
uint8* DQMEventMsgView::startAddress | ( | ) | const [inline] |
Definition at line 78 of file DQMEventMessage.h.
References buf_.
Referenced by stor::StorageManager::DQMeventdataWebPage(), stor::SMProxyServer::DQMeventdataWebPage(), stor::DQMEventServer::processDQMEvent(), stor::DQMConsumerPipe::pushEvent(), and StreamDQMOutputFile::writeDQMEventHeader().
00078 { return buf_; }
uint32 DQMEventMsgView::subFolderCount | ( | ) | const [inline] |
Definition at line 98 of file DQMEventMessage.h.
References subFolderCount_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), edm::DQMHttpSource::getOneDQMEvent(), and FUShmDQMOutputService::postEventProcessing().
00098 { return subFolderCount_; }
std::string DQMEventMsgView::subFolderName | ( | uint32 const | subFolderIndex | ) | const |
Returns the name of the subfolder at the specified index.
Definition at line 122 of file DQMEventMessage.cc.
References Exception, nameListPtr_, and subFolderCount_.
Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), and DQMEventMsgView().
00123 { 00124 // catch attempts to access an invalid entry 00125 if (subFolderIndex >= subFolderCount_) 00126 { 00127 throw cms::Exception("MessageDecoding", "DQMEventMsgView") 00128 << "Invalid subfolder index (" << subFolderIndex << ") - " 00129 << "the number of subfolders is " << subFolderCount_ << ".\n"; 00130 } 00131 00132 return (*nameListPtr_)[subFolderIndex]; 00133 }
boost::shared_ptr< std::vector< std::string > > DQMEventMsgView::subFolderNames | ( | ) | const |
Returns a shared pointer to the list of subfolder names.
Definition at line 114 of file DQMEventMessage.cc.
References nameListPtr_.
Referenced by dumpDQMEventView().
00115 { 00116 return nameListPtr_; 00117 }
edm::Timestamp DQMEventMsgView::timeStamp | ( | ) | const |
Definition at line 264 of file DQMEventMessage.cc.
References buf_, convert64(), h, and DQMEventHeader::timeStamp_.
Referenced by edm::DQMHttpSource::getOneDQMEvent().
00265 { 00266 DQMEventHeader* h = (DQMEventHeader*)buf_; 00267 return edm::Timestamp(convert64(h->timeStamp_)); 00268 }
std::string DQMEventMsgView::topFolderName | ( | ) | const [inline] |
Definition at line 96 of file DQMEventMessage.h.
References folderName_.
Referenced by dumpDQMEventHeader(), edm::DQMHttpSource::getOneDQMEvent(), stor::DQMServiceManager::manageDQMEventMsg(), FUShmDQMOutputService::postEventProcessing(), stor::DQMEventServer::processDQMEvent(), stor::DQMConsumerPipe::wantsDQMEvent(), and FUShmDQMOutputService::writeShmDQMData().
00096 { return folderName_; }
uint32 DQMEventMsgView::updateNumber | ( | ) | const |
Returns the update number of the DQM Event.
Definition at line 221 of file DQMEventMessage.cc.
References buf_, convert32(), h, and DQMEventHeader::updateNumber_.
Referenced by dumpDQMEventHeader(), edm::DQMHttpSource::getOneDQMEvent(), stor::DQMServiceManager::manageDQMEventMsg(), and FUShmDQMOutputService::postEventProcessing().
00222 { 00223 DQMEventHeader* h = (DQMEventHeader*)buf_; 00224 return convert32(h->updateNumber_); 00225 }
uint8* DQMEventMsgView::buf_ [private] |
Definition at line 106 of file DQMEventMessage.h.
Referenced by compressionFlag(), DQMEventMsgView(), eventNumberAtUpdate(), fuGuid(), fuProcessId(), headerSize(), lumiSection(), protocolVersion(), reserved(), runNumber(), startAddress(), timeStamp(), and updateNumber().
uint8* DQMEventMsgView::eventAddr_ [private] |
Definition at line 110 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), and eventAddress().
uint32 DQMEventMsgView::eventLen_ [private] |
Definition at line 111 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), and eventLength().
std::string DQMEventMsgView::folderName_ [private] |
Definition at line 109 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), and topFolderName().
HeaderView DQMEventMsgView::head_ [private] |
std::vector<uint32> DQMEventMsgView::meCountList_ [private] |
boost::shared_ptr< std::vector<std::string> > DQMEventMsgView::nameListPtr_ [private] |
Definition at line 114 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), subFolderName(), and subFolderNames().
std::string DQMEventMsgView::releaseTag_ [private] |
Definition at line 108 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), and releaseTag().
uint32 DQMEventMsgView::subFolderCount_ [private] |
Definition at line 112 of file DQMEventMessage.h.
Referenced by DQMEventMsgView(), meCount(), subFolderCount(), and subFolderName().
std::map<std::string, uint32> DQMEventMsgView::subFolderIndexTable_ [private] |