#include <InitMessage.h>
Definition at line 59 of file InitMessage.h.
InitMsgView::InitMsgView | ( | void * | buf | ) |
Definition at line 7 of file InitMessage.cc.
References adler32_chksum_, buf_, convert32(), gather_cfg::cout, desc_len_, desc_start_, hlt_select_count_, hlt_select_len_, hlt_select_start_, hlt_trig_count_, hlt_trig_len_, hlt_trig_start_, host_name_len_, host_name_start_, l1_trig_count_, l1_trig_len_, l1_trig_start_, outputModuleId_, outputModuleLabel_len_, outputModuleLabel_start_, pos, processName_len_, processName_start_, protocolVersion(), release_len_, and release_start_.
: buf_((uint8*)buf),head_(buf) { if (protocolVersion() == 2) { std::cout << "Protocol Version 2 encountered" << std::endl; release_start_ = buf_ + sizeof(InitHeader) - (sizeof(uint32)*2); // Minus the size for Init and Event Header size fileds // in the InitHeader } else { //For version 3 release_start_ = buf_ + sizeof(InitHeader); } release_len_ = *release_start_; release_start_ += sizeof(uint8); uint8* pos = release_start_ + release_len_; //Lets get Process Name from right after Release Name if (protocolVersion() > 3) { //std::cout << "Protocol Version > 3 encountered" << std::endl; processName_len_ = *pos; processName_start_ = (uint8*)(pos + sizeof(uint8)); pos = processName_start_ + processName_len_; // Output Module Label if (protocolVersion() > 4) { outputModuleLabel_len_ = *pos; outputModuleLabel_start_ = (uint8*)(pos + sizeof(uint8)); pos = outputModuleLabel_start_ + outputModuleLabel_len_; // Output Module Id if (protocolVersion() > 5) { outputModuleId_ = convert32(pos); pos += sizeof(char_uint32); } } } hlt_trig_start_ = pos; hlt_trig_count_ = convert32(hlt_trig_start_); hlt_trig_start_ += sizeof(char_uint32); hlt_trig_len_ = convert32(hlt_trig_start_); hlt_trig_start_ += sizeof(char_uint32); pos = hlt_trig_start_ + hlt_trig_len_; if (protocolVersion() > 4) { hlt_select_start_ = pos; hlt_select_count_ = convert32(hlt_select_start_); hlt_select_start_ += sizeof(char_uint32); hlt_select_len_ = convert32(hlt_select_start_); hlt_select_start_ += sizeof(char_uint32); pos = hlt_select_start_ + hlt_select_len_; } l1_trig_start_ = pos; l1_trig_count_ = convert32(l1_trig_start_); l1_trig_start_ += sizeof(char_uint32); l1_trig_len_ = convert32(l1_trig_start_); l1_trig_start_ += sizeof(char_uint32); pos = l1_trig_start_ + l1_trig_len_; if (protocolVersion() > 7) { adler32_chksum_ = convert32(pos); host_name_start_ = pos + sizeof(uint32); host_name_len_ = *host_name_start_; host_name_start_ += sizeof(uint8); pos = host_name_start_ + host_name_len_; } desc_start_ = pos; desc_len_ = convert32(desc_start_); desc_start_ += sizeof(char_uint32); }
uint32 InitMsgView::adler32_chksum | ( | ) | const [inline] |
Definition at line 89 of file InitMessage.h.
References adler32_chksum_.
Referenced by edm::StreamerInputSource::deserializeRegistry(), and dumpInitHeader().
{return adler32_chksum_;}
uint32 InitMsgView::code | ( | ) | const [inline] |
Definition at line 65 of file InitMessage.h.
References HeaderView::code(), and head_.
Referenced by edm::StreamerInputSource::deserializeRegistry(), dumpInitHeader(), WatcherStreamFileReader::getHeader(), edm::StreamerFileReader::getHeader(), and edmtestp::TestFileReader::TestFileReader().
const uint8* InitMsgView::descData | ( | ) | const [inline] |
Definition at line 86 of file InitMessage.h.
References desc_start_.
Referenced by edm::StreamerInputSource::deserializeRegistry(), dumpInitVerbose(), and StreamerOutputFile::write().
{ return desc_start_; }
uint32 InitMsgView::descLength | ( | ) | const [inline] |
Definition at line 85 of file InitMessage.h.
References desc_len_.
Referenced by edm::StreamerInputSource::deserializeRegistry(), dumpInit(), dumpInitVerbose(), and dumpInitView().
{ return desc_len_; }
uint32 InitMsgView::eventHeaderSize | ( | ) | const |
This is estimated size of event header for Protocol Version 2.
Definition at line 141 of file InitMessage.cc.
References buf_, convert32(), InitHeader::event_header_size_, get_hlt_bit_cnt(), get_l1_bit_cnt(), h, and protocolVersion().
{ if (protocolVersion() == 2) { uint32 hlt_sz = get_hlt_bit_cnt(); if (hlt_sz != 0 ) hlt_sz = 1+ ((hlt_sz-1)/4); uint32 l1_sz = get_l1_bit_cnt(); if (l1_sz != 0) l1_sz = 1 + ((l1_sz-1)/8); return 1 + (4*8) + hlt_sz+l1_sz; } InitHeader* h = reinterpret_cast<InitHeader*>(buf_); return convert32(h->event_header_size_); }
uint32 InitMsgView::get_hlt_bit_cnt | ( | ) | const [inline] |
Definition at line 81 of file InitMessage.h.
References hlt_trig_count_.
Referenced by edm::StreamerFileWriter::doOutputHeader(), and eventHeaderSize().
{ return hlt_trig_count_; }
uint32 InitMsgView::get_l1_bit_cnt | ( | ) | const [inline] |
Definition at line 82 of file InitMessage.h.
References l1_trig_count_.
Referenced by eventHeaderSize().
{ return l1_trig_count_; }
uint32 InitMsgView::headerSize | ( | ) | const [inline] |
Definition at line 87 of file InitMessage.h.
References buf_, and desc_start_.
Referenced by stor::detail::InitMsgData::cacheHeaderFields(), StreamerOutputFile::write(), and StreamerOutputFile::writeStart().
{return desc_start_-buf_;}
void InitMsgView::hltTriggerNames | ( | Strings & | save_here | ) | const |
Definition at line 122 of file InitMessage.cc.
References MsgTools::getNames(), hlt_trig_len_, and hlt_trig_start_.
Referenced by dumpInitHeader(), stor::InitMsgCollection::getSelectionHelpString(), stor::EventConsumerSelector::initialize(), and stor::EventStreamSelector::initialize().
{ MsgTools::getNames(hlt_trig_start_,hlt_trig_len_,save_here); }
void InitMsgView::hltTriggerSelections | ( | Strings & | save_here | ) | const |
Definition at line 127 of file InitMessage.cc.
References Exception, MsgTools::getNames(), hlt_select_len_, hlt_select_start_, and protocolVersion().
Referenced by dumpInitHeader(), and stor::InitMsgCollection::getSelectionHelpString().
{ if (protocolVersion() < 5) throw cms::Exception("Invalid Message Version", "InitMsgView") << "HLT trigger selections are only supported in Protocol Version 5 and above" << ".\n"; MsgTools::getNames(hlt_select_start_,hlt_select_len_,save_here); }
std::string InitMsgView::hostName | ( | ) | const |
Definition at line 166 of file InitMessage.cc.
References newFWLiteAna::found, host_name_len_, and host_name_start_.
Referenced by edm::StreamerInputSource::deserializeRegistry(), and dumpInitHeader().
{ //return std::string(reinterpret_cast<char *>(host_name_start_),host_name_len_); std::string host_name(reinterpret_cast<char *>(host_name_start_),host_name_len_); size_t found = host_name.find('\0'); if(found != std::string::npos) { return std::string(host_name, 0, found); } else { return host_name; } }
uint32 InitMsgView::hostName_len | ( | ) | const [inline] |
void InitMsgView::l1TriggerNames | ( | Strings & | save_here | ) | const |
Definition at line 136 of file InitMessage.cc.
References MsgTools::getNames(), l1_trig_len_, and l1_trig_start_.
Referenced by dumpInitHeader().
{ MsgTools::getNames(l1_trig_start_,l1_trig_len_,save_here); }
uint32 InitMsgView::outputModuleId | ( | ) | const [inline] |
Definition at line 75 of file InitMessage.h.
References outputModuleId_.
Referenced by stor::InitMsgCollection::add(), edm::FUShmOutputModule::doOutputHeader(), dumpInitHeader(), stor::EventConsumerSelector::initialize(), stor::EventStreamSelector::initialize(), and edmtestp::TestFileReader::TestFileReader().
{ return outputModuleId_; }
std::string InitMsgView::outputModuleLabel | ( | ) | const |
Definition at line 112 of file InitMessage.cc.
References Exception, outputModuleLabel_len_, outputModuleLabel_start_, and protocolVersion().
Referenced by stor::InitMsgCollection::add(), stor::InitMsgCollection::addIfUnique(), dumpInitHeader(), stor::InitMsgCollection::getElementForOutputModule(), stor::InitMsgCollection::getSelectionHelpString(), stor::EventConsumerSelector::initialize(), stor::EventStreamSelector::initialize(), and stor::InitMsgCollection::initMsgCount().
{ if (protocolVersion() < 5) throw cms::Exception("Invalid Message Version", "InitMsgView") << "Output Module Label is only supported in Protocol Version 5 and above" << ".\n"; return std::string(reinterpret_cast<char *>(outputModuleLabel_start_),outputModuleLabel_len_); }
std::string InitMsgView::processName | ( | ) | const |
Definition at line 103 of file InitMessage.cc.
References Exception, processName_len_, processName_start_, and protocolVersion().
Referenced by edm::StreamerInputSource::deserializeRegistry(), and dumpInitHeader().
{ if (protocolVersion() < 4) throw cms::Exception("Invalid Message Version", "InitMsgView") << "Process Name is only supported in Protocol Version 4 and above" << ".\n"; return std::string(reinterpret_cast<char *>(processName_start_),processName_len_); }
uint32 InitMsgView::protocolVersion | ( | ) | const |
Definition at line 86 of file InitMessage.cc.
References buf_, h, Version::protocol_, and InitHeader::version_.
Referenced by edm::StreamerInputSource::deserializeRegistry(), dumpInitHeader(), eventHeaderSize(), hltTriggerSelections(), InitMsgView(), outputModuleLabel(), and processName().
{ InitHeader* h = reinterpret_cast<InitHeader*>(buf_); return h->version_.protocol_; }
void InitMsgView::pset | ( | uint8 * | put_here | ) | const |
Definition at line 92 of file InitMessage.cc.
References buf_, h, Version::pset_id_, and InitHeader::version_.
Referenced by dumpInitHeader().
{ InitHeader* h = reinterpret_cast<InitHeader*>(buf_); memcpy(put_here,h->version_.pset_id_,sizeof(h->version_.pset_id_)); }
std::string InitMsgView::releaseTag | ( | ) | const |
Definition at line 98 of file InitMessage.cc.
References release_len_, and release_start_.
Referenced by dumpInitHeader().
{ return std::string(reinterpret_cast<char *>(release_start_),release_len_); }
uint32 InitMsgView::run | ( | void | ) | const |
Definition at line 80 of file InitMessage.cc.
References buf_, convert32(), h, and InitHeader::run_.
Referenced by dumpInitHeader(), edmtestp::TestFileReader::TestFileReader(), and StreamerOutputFile::writeStart().
{ InitHeader* h = reinterpret_cast<InitHeader*>(buf_); return convert32(h->run_); }
uint32 InitMsgView::size | ( | void | ) | const [inline] |
Definition at line 66 of file InitMessage.h.
References head_, and HeaderView::size().
Referenced by stor::InitMsgCollection::add(), dumpInitHeader(), edmtestp::TestFileReader::TestFileReader(), and StreamerOutputFile::write().
uint8* InitMsgView::startAddress | ( | ) | const [inline] |
Definition at line 67 of file InitMessage.h.
References buf_.
Referenced by stor::InitMsgCollection::add(), edmtestp::TestFileReader::TestFileReader(), and StreamerOutputFile::writeStart().
{ return buf_; }
uint32 InitMsgView::adler32_chksum_ [private] |
Definition at line 116 of file InitMessage.h.
Referenced by adler32_chksum(), and InitMsgView().
uint8* InitMsgView::buf_ [private] |
Definition at line 94 of file InitMessage.h.
Referenced by eventHeaderSize(), headerSize(), InitMsgView(), protocolVersion(), pset(), run(), and startAddress().
uint32 InitMsgView::desc_len_ [private] |
Definition at line 123 of file InitMessage.h.
Referenced by descLength(), and InitMsgView().
uint8* InitMsgView::desc_start_ [private] |
Definition at line 122 of file InitMessage.h.
Referenced by descData(), headerSize(), and InitMsgView().
HeaderView InitMsgView::head_ [private] |
Definition at line 95 of file InitMessage.h.
uint32 InitMsgView::hlt_select_count_ [private] |
Definition at line 111 of file InitMessage.h.
Referenced by InitMsgView().
uint32 InitMsgView::hlt_select_len_ [private] |
Definition at line 112 of file InitMessage.h.
Referenced by hltTriggerSelections(), and InitMsgView().
uint8* InitMsgView::hlt_select_start_ [private] |
Definition at line 110 of file InitMessage.h.
Referenced by hltTriggerSelections(), and InitMsgView().
uint32 InitMsgView::hlt_trig_count_ [private] |
Definition at line 108 of file InitMessage.h.
Referenced by get_hlt_bit_cnt(), and InitMsgView().
uint32 InitMsgView::hlt_trig_len_ [private] |
Definition at line 109 of file InitMessage.h.
Referenced by hltTriggerNames(), and InitMsgView().
uint8* InitMsgView::hlt_trig_start_ [private] |
Definition at line 107 of file InitMessage.h.
Referenced by hltTriggerNames(), and InitMsgView().
uint32 InitMsgView::host_name_len_ [private] |
Definition at line 118 of file InitMessage.h.
Referenced by hostName(), hostName_len(), and InitMsgView().
uint8* InitMsgView::host_name_start_ [private] |
Definition at line 117 of file InitMessage.h.
Referenced by hostName(), and InitMsgView().
uint32 InitMsgView::l1_trig_count_ [private] |
Definition at line 114 of file InitMessage.h.
Referenced by get_l1_bit_cnt(), and InitMsgView().
uint32 InitMsgView::l1_trig_len_ [private] |
Definition at line 115 of file InitMessage.h.
Referenced by InitMsgView(), and l1TriggerNames().
uint8* InitMsgView::l1_trig_start_ [private] |
Definition at line 113 of file InitMessage.h.
Referenced by InitMsgView(), and l1TriggerNames().
uint32 InitMsgView::outputModuleId_ [private] |
Definition at line 105 of file InitMessage.h.
Referenced by InitMsgView(), and outputModuleId().
uint32 InitMsgView::outputModuleLabel_len_ [private] |
Definition at line 104 of file InitMessage.h.
Referenced by InitMsgView(), and outputModuleLabel().
uint8* InitMsgView::outputModuleLabel_start_ [private] |
Definition at line 103 of file InitMessage.h.
Referenced by InitMsgView(), and outputModuleLabel().
uint32 InitMsgView::processName_len_ [private] |
Definition at line 101 of file InitMessage.h.
Referenced by InitMsgView(), and processName().
uint8* InitMsgView::processName_start_ [private] |
Definition at line 100 of file InitMessage.h.
Referenced by InitMsgView(), and processName().
uint32 InitMsgView::release_len_ [private] |
Definition at line 98 of file InitMessage.h.
Referenced by InitMsgView(), and releaseTag().
uint8* InitMsgView::release_start_ [private] |
Definition at line 97 of file InitMessage.h.
Referenced by InitMsgView(), and releaseTag().