CMS 3D CMS Logo

Public Member Functions | Private Attributes

InitMsgView Class Reference

#include <InitMessage.h>

List of all members.

Public Member Functions

uint32 adler32_chksum () const
uint32 code () const
const uint8descData () const
uint32 descLength () const
uint32 eventHeaderSize () const
uint32 get_hlt_bit_cnt () const
uint32 get_l1_bit_cnt () const
uint32 headerSize () const
void hltTriggerNames (Strings &save_here) const
void hltTriggerSelections (Strings &save_here) const
std::string hostName () const
uint32 hostName_len () const
 InitMsgView (void *buf)
void l1TriggerNames (Strings &save_here) const
uint32 outputModuleId () const
std::string outputModuleLabel () const
std::string processName () const
uint32 protocolVersion () const
void pset (uint8 *put_here) const
std::string releaseTag () const
uint32 run () const
uint32 size () const
uint8startAddress () const

Private Attributes

uint32 adler32_chksum_
uint8buf_
uint32 desc_len_
uint8desc_start_
HeaderView head_
uint32 hlt_select_count_
uint32 hlt_select_len_
uint8hlt_select_start_
uint32 hlt_trig_count_
uint32 hlt_trig_len_
uint8hlt_trig_start_
uint32 host_name_len_
uint8host_name_start_
uint32 l1_trig_count_
uint32 l1_trig_len_
uint8l1_trig_start_
uint32 outputModuleId_
uint32 outputModuleLabel_len_
uint8outputModuleLabel_start_
uint32 processName_len_
uint8processName_start_
uint32 release_len_
uint8release_start_

Detailed Description

Definition at line 60 of file InitMessage.h.


Constructor & Destructor Documentation

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);
}

Member Function Documentation

uint32 InitMsgView::adler32_chksum ( ) const [inline]

Definition at line 90 of file InitMessage.h.

References adler32_chksum_.

Referenced by edm::StreamerInputSource::deserializeRegistry(), and dumpInitHeader().

{return adler32_chksum_;}
uint32 InitMsgView::code ( ) const [inline]
const uint8* InitMsgView::descData ( ) const [inline]
uint32 InitMsgView::descLength ( ) const [inline]

Definition at line 86 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 82 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 83 of file InitMessage.h.

References l1_trig_count_.

Referenced by eventHeaderSize().

{ return l1_trig_count_; }
uint32 InitMsgView::headerSize ( ) const [inline]
void InitMsgView::hltTriggerNames ( Strings save_here) const
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]

Definition at line 92 of file InitMessage.h.

References host_name_len_.

{return host_name_len_;}
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().

uint32 InitMsgView::outputModuleId ( ) const [inline]
std::string InitMsgView::outputModuleLabel ( ) const
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
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]
uint8* InitMsgView::startAddress ( ) const [inline]

Member Data Documentation

Definition at line 117 of file InitMessage.h.

Referenced by adler32_chksum(), and InitMsgView().

Definition at line 124 of file InitMessage.h.

Referenced by descLength(), and InitMsgView().

Definition at line 123 of file InitMessage.h.

Referenced by descData(), headerSize(), and InitMsgView().

Definition at line 96 of file InitMessage.h.

Referenced by code(), and size().

Definition at line 112 of file InitMessage.h.

Referenced by InitMsgView().

Definition at line 113 of file InitMessage.h.

Referenced by hltTriggerSelections(), and InitMsgView().

Definition at line 111 of file InitMessage.h.

Referenced by hltTriggerSelections(), and InitMsgView().

Definition at line 109 of file InitMessage.h.

Referenced by get_hlt_bit_cnt(), and InitMsgView().

Definition at line 110 of file InitMessage.h.

Referenced by hltTriggerNames(), and InitMsgView().

Definition at line 108 of file InitMessage.h.

Referenced by hltTriggerNames(), and InitMsgView().

Definition at line 119 of file InitMessage.h.

Referenced by hostName(), hostName_len(), and InitMsgView().

Definition at line 118 of file InitMessage.h.

Referenced by hostName(), and InitMsgView().

Definition at line 115 of file InitMessage.h.

Referenced by get_l1_bit_cnt(), and InitMsgView().

Definition at line 116 of file InitMessage.h.

Referenced by InitMsgView(), and l1TriggerNames().

Definition at line 114 of file InitMessage.h.

Referenced by InitMsgView(), and l1TriggerNames().

Definition at line 106 of file InitMessage.h.

Referenced by InitMsgView(), and outputModuleId().

Definition at line 105 of file InitMessage.h.

Referenced by InitMsgView(), and outputModuleLabel().

Definition at line 104 of file InitMessage.h.

Referenced by InitMsgView(), and outputModuleLabel().

Definition at line 102 of file InitMessage.h.

Referenced by InitMsgView(), and processName().

Definition at line 101 of file InitMessage.h.

Referenced by InitMsgView(), and processName().

Definition at line 99 of file InitMessage.h.

Referenced by InitMsgView(), and releaseTag().

Definition at line 98 of file InitMessage.h.

Referenced by InitMsgView(), and releaseTag().