CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::streamer::InitMsgView Class Reference

#include <InitMessage.h>

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 62 of file InitMessage.h.

Constructor & Destructor Documentation

◆ InitMsgView()

InitMsgView::InitMsgView ( void *  buf)

Definition at line 9 of file InitMessage.cc.

References adler32_chksum_, buf_, edm::streamer::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_, processName_len_, processName_start_, protocolVersion(), release_len_, and release_start_.

10  : buf_((uint8*)buf),
11  head_(buf),
12  release_start_(nullptr),
13  release_len_(0),
14  processName_start_(nullptr),
16  outputModuleLabel_start_(nullptr),
18  outputModuleId_(0),
19  hlt_trig_start_(nullptr),
20  hlt_trig_count_(0),
21  hlt_trig_len_(0),
22  hlt_select_start_(nullptr),
24  hlt_select_len_(0),
25  l1_trig_start_(nullptr),
26  l1_trig_count_(0),
27  l1_trig_len_(0),
28  adler32_chksum_(0),
29  host_name_start_(nullptr),
30  host_name_len_(0),
31  desc_start_(nullptr),
32  desc_len_(0) {
33  if (protocolVersion() == 2) {
34  std::cout << "Protocol Version 2 encountered" << std::endl;
35  release_start_ = buf_ + sizeof(InitHeader) - (sizeof(uint32) * 2);
36  // Minus the size for Init and Event Header size fileds
37  // in the InitHeader
38  } else { //For version 3
39  release_start_ = buf_ + sizeof(InitHeader);
40  }
42  release_start_ += sizeof(uint8);
44 
45  //Lets get Process Name from right after Release Name
46  if (protocolVersion() > 3) {
47  //std::cout << "Protocol Version > 3 encountered" << std::endl;
49  processName_start_ = (uint8*)(pos + sizeof(uint8));
51 
52  // Output Module Label
53  if (protocolVersion() > 4) {
55  outputModuleLabel_start_ = (uint8*)(pos + sizeof(uint8));
57 
58  // Output Module Id
59  if (protocolVersion() > 5) {
61  pos += sizeof(char_uint32);
62  }
63  }
64  }
65 
68  hlt_trig_start_ += sizeof(char_uint32);
70  hlt_trig_start_ += sizeof(char_uint32);
72 
73  if (protocolVersion() > 4) {
76  hlt_select_start_ += sizeof(char_uint32);
78  hlt_select_start_ += sizeof(char_uint32);
80  }
81 
84  l1_trig_start_ += sizeof(char_uint32);
86  l1_trig_start_ += sizeof(char_uint32);
88 
89  if (protocolVersion() > 7) {
91  pos += sizeof(uint32);
92 
93  if (protocolVersion() <= 9) {
96  host_name_start_ += sizeof(uint8);
98  }
99  }
100 
101  desc_start_ = pos;
103  desc_start_ += sizeof(char_uint32);
104 }
uint32 convert32(char_uint32 v)
Definition: MsgTools.h:29
unsigned char uint8
Definition: MsgTools.h:12
uint32 protocolVersion() const
Definition: InitMessage.cc:111
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:17
unsigned int uint32
Definition: MsgTools.h:14

Member Function Documentation

◆ adler32_chksum()

uint32 edm::streamer::InitMsgView::adler32_chksum ( ) const
inline

Definition at line 90 of file InitMessage.h.

References adler32_chksum_.

Referenced by edm::streamer::StreamerInputSource::deserializeRegistry().

90 { return adler32_chksum_; }

◆ code()

uint32 edm::streamer::InitMsgView::code ( ) const
inline

Definition at line 66 of file InitMessage.h.

References edm::streamer::HeaderView::code(), and head_.

Referenced by edm::streamer::StreamerInputSource::deserializeRegistry().

66 { return head_.code(); }
uint32 code() const
Definition: MsgHeader.h:45

◆ descData()

const uint8* edm::streamer::InitMsgView::descData ( ) const
inline

◆ descLength()

uint32 edm::streamer::InitMsgView::descLength ( ) const
inline

Definition at line 86 of file InitMessage.h.

References desc_len_.

Referenced by edm::streamer::StreamerInputSource::deserializeRegistry().

86 { return desc_len_; }

◆ eventHeaderSize()

uint32 InitMsgView::eventHeaderSize ( ) const

This is estimated size of event header for Protocol Version 2.

Definition at line 160 of file InitMessage.cc.

References buf_, edm::streamer::convert32(), get_hlt_bit_cnt(), get_l1_bit_cnt(), h, and protocolVersion().

160  {
161  if (protocolVersion() == 2) {
164  uint32 hlt_sz = get_hlt_bit_cnt();
165  if (hlt_sz != 0)
166  hlt_sz = 1 + ((hlt_sz - 1) / 4);
167 
168  uint32 l1_sz = get_l1_bit_cnt();
169  if (l1_sz != 0)
170  l1_sz = 1 + ((l1_sz - 1) / 8);
171 
172  return 1 + (4 * 8) + hlt_sz + l1_sz;
173  }
174 
175  InitHeader* h = reinterpret_cast<InitHeader*>(buf_);
176  return convert32(h->event_header_size_);
177 }
uint32 convert32(char_uint32 v)
Definition: MsgTools.h:29
uint32 get_hlt_bit_cnt() const
Definition: InitMessage.h:82
uint32 get_l1_bit_cnt() const
Definition: InitMessage.h:83
uint32 protocolVersion() const
Definition: InitMessage.cc:111
unsigned int uint32
Definition: MsgTools.h:14
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ get_hlt_bit_cnt()

uint32 edm::streamer::InitMsgView::get_hlt_bit_cnt ( ) const
inline

Definition at line 82 of file InitMessage.h.

References hlt_trig_count_.

Referenced by eventHeaderSize().

82 { return hlt_trig_count_; }

◆ get_l1_bit_cnt()

uint32 edm::streamer::InitMsgView::get_l1_bit_cnt ( ) const
inline

Definition at line 83 of file InitMessage.h.

References l1_trig_count_.

Referenced by eventHeaderSize().

83 { return l1_trig_count_; }

◆ headerSize()

uint32 edm::streamer::InitMsgView::headerSize ( ) const
inline

◆ hltTriggerNames()

void InitMsgView::hltTriggerNames ( Strings save_here) const

Definition at line 143 of file InitMessage.cc.

References edm::streamer::MsgTools::getNames(), hlt_trig_len_, and hlt_trig_start_.

143  {
145 }
void getNames(uint8 *from, uint32 from_len, Strings &to)
Definition: MsgTools.h:86

◆ hltTriggerSelections()

void InitMsgView::hltTriggerSelections ( Strings save_here) const

Definition at line 147 of file InitMessage.cc.

References Exception, edm::streamer::MsgTools::getNames(), hlt_select_len_, hlt_select_start_, and protocolVersion().

147  {
148  if (protocolVersion() < 5)
149  throw cms::Exception("Invalid Message Version", "InitMsgView")
150  << "HLT trigger selections are only supported in Protocol Version 5 and above"
151  << ".\n";
152 
154 }
uint32 protocolVersion() const
Definition: InitMessage.cc:111
void getNames(uint8 *from, uint32 from_len, Strings &to)
Definition: MsgTools.h:86

◆ hostName()

std::string InitMsgView::hostName ( ) const

Definition at line 186 of file InitMessage.cc.

References newFWLiteAna::found, host_name_len_, host_name_start_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by edm::streamer::StreamerInputSource::deserializeRegistry().

186  {
187  if (host_name_start_) {
188  std::string host_name(reinterpret_cast<char*>(host_name_start_), host_name_len_);
189  size_t found = host_name.find('\0');
190  if (found != std::string::npos) {
191  return std::string(host_name, 0, found);
192  } else {
193  return host_name;
194  }
195  } else {
196  return "n/a";
197  }
198 }

◆ hostName_len()

uint32 edm::streamer::InitMsgView::hostName_len ( ) const
inline

Definition at line 92 of file InitMessage.h.

References host_name_len_.

92 { return host_name_len_; }

◆ l1TriggerNames()

void InitMsgView::l1TriggerNames ( Strings save_here) const

Definition at line 156 of file InitMessage.cc.

References edm::streamer::MsgTools::getNames(), l1_trig_len_, and l1_trig_start_.

156  {
158 }
void getNames(uint8 *from, uint32 from_len, Strings &to)
Definition: MsgTools.h:86

◆ outputModuleId()

uint32 edm::streamer::InitMsgView::outputModuleId ( ) const
inline

Definition at line 76 of file InitMessage.h.

References outputModuleId_.

76 { return outputModuleId_; }

◆ outputModuleLabel()

std::string InitMsgView::outputModuleLabel ( ) const

Definition at line 134 of file InitMessage.cc.

References Exception, outputModuleLabel_len_, outputModuleLabel_start_, protocolVersion(), and AlCaHLTBitMon_QueryRunRegistry::string.

134  {
135  if (protocolVersion() < 5)
136  throw cms::Exception("Invalid Message Version", "InitMsgView")
137  << "Output Module Label is only supported in Protocol Version 5 and above"
138  << ".\n";
139 
140  return std::string(reinterpret_cast<char*>(outputModuleLabel_start_), outputModuleLabel_len_);
141 }
uint32 protocolVersion() const
Definition: InitMessage.cc:111

◆ processName()

std::string InitMsgView::processName ( ) const

Definition at line 125 of file InitMessage.cc.

References Exception, processName_len_, processName_start_, protocolVersion(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by edm::streamer::StreamerInputSource::deserializeRegistry().

125  {
126  if (protocolVersion() < 4)
127  throw cms::Exception("Invalid Message Version", "InitMsgView")
128  << "Process Name is only supported in Protocol Version 4 and above"
129  << ".\n";
130 
131  return std::string(reinterpret_cast<char*>(processName_start_), processName_len_);
132 }
uint32 protocolVersion() const
Definition: InitMessage.cc:111

◆ protocolVersion()

uint32 InitMsgView::protocolVersion ( ) const

Definition at line 111 of file InitMessage.cc.

References buf_, and h.

Referenced by edm::streamer::StreamerInputSource::deserializeRegistry(), eventHeaderSize(), hltTriggerSelections(), InitMsgView(), outputModuleLabel(), and processName().

111  {
112  InitHeader* h = reinterpret_cast<InitHeader*>(buf_);
113  return h->version_.protocol_;
114 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ pset()

void InitMsgView::pset ( uint8 put_here) const

Definition at line 116 of file InitMessage.cc.

References buf_, and h.

116  {
117  InitHeader* h = reinterpret_cast<InitHeader*>(buf_);
118  memcpy(put_here, h->version_.pset_id_, sizeof(h->version_.pset_id_));
119 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ releaseTag()

std::string InitMsgView::releaseTag ( ) const

◆ run()

uint32 InitMsgView::run ( ) const

Definition at line 106 of file InitMessage.cc.

References buf_, edm::streamer::convert32(), and h.

106  {
107  InitHeader* h = reinterpret_cast<InitHeader*>(buf_);
108  return convert32(h->run_);
109 }
uint32 convert32(char_uint32 v)
Definition: MsgTools.h:29
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ size()

uint32 edm::streamer::InitMsgView::size ( void  ) const
inline

◆ startAddress()

uint8* edm::streamer::InitMsgView::startAddress ( ) const
inline

Definition at line 68 of file InitMessage.h.

References buf_.

Referenced by edm::streamer::StreamerOutputFile::writeStart().

68 { return buf_; }

Member Data Documentation

◆ adler32_chksum_

uint32 edm::streamer::InitMsgView::adler32_chksum_
private

Definition at line 117 of file InitMessage.h.

Referenced by adler32_chksum(), and InitMsgView().

◆ buf_

uint8* edm::streamer::InitMsgView::buf_
private

◆ desc_len_

uint32 edm::streamer::InitMsgView::desc_len_
private

Definition at line 124 of file InitMessage.h.

Referenced by descLength(), and InitMsgView().

◆ desc_start_

uint8* edm::streamer::InitMsgView::desc_start_
private

Definition at line 123 of file InitMessage.h.

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

◆ head_

HeaderView edm::streamer::InitMsgView::head_
private

Definition at line 96 of file InitMessage.h.

Referenced by code(), and size().

◆ hlt_select_count_

uint32 edm::streamer::InitMsgView::hlt_select_count_
private

Definition at line 112 of file InitMessage.h.

Referenced by InitMsgView().

◆ hlt_select_len_

uint32 edm::streamer::InitMsgView::hlt_select_len_
private

Definition at line 113 of file InitMessage.h.

Referenced by hltTriggerSelections(), and InitMsgView().

◆ hlt_select_start_

uint8* edm::streamer::InitMsgView::hlt_select_start_
private

Definition at line 111 of file InitMessage.h.

Referenced by hltTriggerSelections(), and InitMsgView().

◆ hlt_trig_count_

uint32 edm::streamer::InitMsgView::hlt_trig_count_
private

Definition at line 109 of file InitMessage.h.

Referenced by get_hlt_bit_cnt(), and InitMsgView().

◆ hlt_trig_len_

uint32 edm::streamer::InitMsgView::hlt_trig_len_
private

Definition at line 110 of file InitMessage.h.

Referenced by hltTriggerNames(), and InitMsgView().

◆ hlt_trig_start_

uint8* edm::streamer::InitMsgView::hlt_trig_start_
private

Definition at line 108 of file InitMessage.h.

Referenced by hltTriggerNames(), and InitMsgView().

◆ host_name_len_

uint32 edm::streamer::InitMsgView::host_name_len_
private

Definition at line 119 of file InitMessage.h.

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

◆ host_name_start_

uint8* edm::streamer::InitMsgView::host_name_start_
private

Definition at line 118 of file InitMessage.h.

Referenced by hostName(), and InitMsgView().

◆ l1_trig_count_

uint32 edm::streamer::InitMsgView::l1_trig_count_
private

Definition at line 115 of file InitMessage.h.

Referenced by get_l1_bit_cnt(), and InitMsgView().

◆ l1_trig_len_

uint32 edm::streamer::InitMsgView::l1_trig_len_
private

Definition at line 116 of file InitMessage.h.

Referenced by InitMsgView(), and l1TriggerNames().

◆ l1_trig_start_

uint8* edm::streamer::InitMsgView::l1_trig_start_
private

Definition at line 114 of file InitMessage.h.

Referenced by InitMsgView(), and l1TriggerNames().

◆ outputModuleId_

uint32 edm::streamer::InitMsgView::outputModuleId_
private

Definition at line 106 of file InitMessage.h.

Referenced by InitMsgView(), and outputModuleId().

◆ outputModuleLabel_len_

uint32 edm::streamer::InitMsgView::outputModuleLabel_len_
private

Definition at line 105 of file InitMessage.h.

Referenced by InitMsgView(), and outputModuleLabel().

◆ outputModuleLabel_start_

uint8* edm::streamer::InitMsgView::outputModuleLabel_start_
private

Definition at line 104 of file InitMessage.h.

Referenced by InitMsgView(), and outputModuleLabel().

◆ processName_len_

uint32 edm::streamer::InitMsgView::processName_len_
private

Definition at line 102 of file InitMessage.h.

Referenced by InitMsgView(), and processName().

◆ processName_start_

uint8* edm::streamer::InitMsgView::processName_start_
private

Definition at line 101 of file InitMessage.h.

Referenced by InitMsgView(), and processName().

◆ release_len_

uint32 edm::streamer::InitMsgView::release_len_
private

Definition at line 99 of file InitMessage.h.

Referenced by InitMsgView(), and releaseTag().

◆ release_start_

uint8* edm::streamer::InitMsgView::release_start_
private

Definition at line 98 of file InitMessage.h.

Referenced by InitMsgView(), and releaseTag().