CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
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 61 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_, processName_len_, processName_start_, protocolVersion(), release_len_, and release_start_.

8  : buf_((uint8*)buf),
9  head_(buf),
10  release_start_(nullptr),
11  release_len_(0),
12  processName_start_(nullptr),
14  outputModuleLabel_start_(nullptr),
16  outputModuleId_(0),
17  hlt_trig_start_(nullptr),
18  hlt_trig_count_(0),
19  hlt_trig_len_(0),
20  hlt_select_start_(nullptr),
22  hlt_select_len_(0),
23  l1_trig_start_(nullptr),
24  l1_trig_count_(0),
25  l1_trig_len_(0),
26  adler32_chksum_(0),
27  host_name_start_(nullptr),
28  host_name_len_(0),
29  desc_start_(nullptr),
30  desc_len_(0) {
31  if (protocolVersion() == 2) {
32  std::cout << "Protocol Version 2 encountered" << std::endl;
33  release_start_ = buf_ + sizeof(InitHeader) - (sizeof(uint32) * 2);
34  // Minus the size for Init and Event Header size fileds
35  // in the InitHeader
36  } else { //For version 3
37  release_start_ = buf_ + sizeof(InitHeader);
38  }
40  release_start_ += sizeof(uint8);
42 
43  //Lets get Process Name from right after Release Name
44  if (protocolVersion() > 3) {
45  //std::cout << "Protocol Version > 3 encountered" << std::endl;
46  processName_len_ = *pos;
47  processName_start_ = (uint8*)(pos + sizeof(uint8));
49 
50  // Output Module Label
51  if (protocolVersion() > 4) {
53  outputModuleLabel_start_ = (uint8*)(pos + sizeof(uint8));
55 
56  // Output Module Id
57  if (protocolVersion() > 5) {
59  pos += sizeof(char_uint32);
60  }
61  }
62  }
63 
64  hlt_trig_start_ = pos;
66  hlt_trig_start_ += sizeof(char_uint32);
68  hlt_trig_start_ += sizeof(char_uint32);
70 
71  if (protocolVersion() > 4) {
72  hlt_select_start_ = pos;
74  hlt_select_start_ += sizeof(char_uint32);
76  hlt_select_start_ += sizeof(char_uint32);
78  }
79 
80  l1_trig_start_ = pos;
82  l1_trig_start_ += sizeof(char_uint32);
84  l1_trig_start_ += sizeof(char_uint32);
86 
87  if (protocolVersion() > 7) {
89  pos += sizeof(uint32);
90 
91  if (protocolVersion() <= 9) {
92  host_name_start_ = pos;
94  host_name_start_ += sizeof(uint8);
96  }
97  }
98 
99  desc_start_ = pos;
101  desc_start_ += sizeof(char_uint32);
102 }
uint32 hlt_select_count_
Definition: InitMessage.h:111
uint32 release_len_
Definition: InitMessage.h:98
uint8 * desc_start_
Definition: InitMessage.h:122
uint32 hlt_trig_len_
Definition: InitMessage.h:109
uint32 desc_len_
Definition: InitMessage.h:123
uint32 l1_trig_len_
Definition: InitMessage.h:115
HeaderView head_
Definition: InitMessage.h:95
uint8 * l1_trig_start_
Definition: InitMessage.h:113
uint32 outputModuleLabel_len_
Definition: InitMessage.h:104
uint8 * outputModuleLabel_start_
Definition: InitMessage.h:103
uint8 * release_start_
Definition: InitMessage.h:97
unsigned int uint32
Definition: MsgTools.h:13
uint32 host_name_len_
Definition: InitMessage.h:118
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:16
uint32 processName_len_
Definition: InitMessage.h:101
uint32 protocolVersion() const
Definition: InitMessage.cc:109
uint32 outputModuleId_
Definition: InitMessage.h:105
uint8 * hlt_trig_start_
Definition: InitMessage.h:107
uint8 * host_name_start_
Definition: InitMessage.h:117
uint8 * hlt_select_start_
Definition: InitMessage.h:110
uint32 convert32(char_uint32 v)
Definition: MsgTools.h:28
unsigned char uint8
Definition: MsgTools.h:11
uint8 * buf_
Definition: InitMessage.h:94
tuple cout
Definition: gather_cfg.py:144
uint32 adler32_chksum_
Definition: InitMessage.h:116
uint32 hlt_trig_count_
Definition: InitMessage.h:108
uint8 * processName_start_
Definition: InitMessage.h:100
uint32 l1_trig_count_
Definition: InitMessage.h:114
uint32 hlt_select_len_
Definition: InitMessage.h:112

Member Function Documentation

uint32 InitMsgView::adler32_chksum ( ) const
inline

Definition at line 89 of file InitMessage.h.

References adler32_chksum_.

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

89 { return adler32_chksum_; }
uint32 adler32_chksum_
Definition: InitMessage.h:116
uint32 InitMsgView::code ( ) const
inline
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().

86 { return desc_start_; }
uint8 * desc_start_
Definition: InitMessage.h:122
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().

85 { return desc_len_; }
uint32 desc_len_
Definition: InitMessage.h:123
uint32 InitMsgView::eventHeaderSize ( ) const

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

Definition at line 158 of file InitMessage.cc.

References buf_, convert32(), InitHeader::event_header_size_, get_hlt_bit_cnt(), get_l1_bit_cnt(), h, and protocolVersion().

158  {
159  if (protocolVersion() == 2) {
162  uint32 hlt_sz = get_hlt_bit_cnt();
163  if (hlt_sz != 0)
164  hlt_sz = 1 + ((hlt_sz - 1) / 4);
165 
166  uint32 l1_sz = get_l1_bit_cnt();
167  if (l1_sz != 0)
168  l1_sz = 1 + ((l1_sz - 1) / 8);
169 
170  return 1 + (4 * 8) + hlt_sz + l1_sz;
171  }
172 
173  InitHeader* h = reinterpret_cast<InitHeader*>(buf_);
174  return convert32(h->event_header_size_);
175 }
char_uint32 event_header_size_
Definition: InitMessage.h:58
unsigned int uint32
Definition: MsgTools.h:13
uint32 protocolVersion() const
Definition: InitMessage.cc:109
uint32 convert32(char_uint32 v)
Definition: MsgTools.h:28
uint8 * buf_
Definition: InitMessage.h:94
uint32 get_hlt_bit_cnt() const
Definition: InitMessage.h:81
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
uint32 get_l1_bit_cnt() const
Definition: InitMessage.h:82
uint32 InitMsgView::get_hlt_bit_cnt ( ) const
inline

Definition at line 81 of file InitMessage.h.

References hlt_trig_count_.

Referenced by eventHeaderSize().

81 { return hlt_trig_count_; }
uint32 hlt_trig_count_
Definition: InitMessage.h:108
uint32 InitMsgView::get_l1_bit_cnt ( ) const
inline

Definition at line 82 of file InitMessage.h.

References l1_trig_count_.

Referenced by eventHeaderSize().

82 { return l1_trig_count_; }
uint32 l1_trig_count_
Definition: InitMessage.h:114
uint32 InitMsgView::headerSize ( ) const
inline

Definition at line 87 of file InitMessage.h.

References buf_, and desc_start_.

Referenced by StreamerOutputFile::write(), and StreamerOutputFile::writeStart().

87 { return desc_start_ - buf_; }
uint8 * desc_start_
Definition: InitMessage.h:122
uint8 * buf_
Definition: InitMessage.h:94
void InitMsgView::hltTriggerNames ( Strings save_here) const

Definition at line 141 of file InitMessage.cc.

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

Referenced by dumpInitHeader().

141  {
143 }
uint32 hlt_trig_len_
Definition: InitMessage.h:109
uint8 * hlt_trig_start_
Definition: InitMessage.h:107
void getNames(uint8 *from, uint32 from_len, Strings &to)
Definition: MsgTools.h:85
void InitMsgView::hltTriggerSelections ( Strings save_here) const

Definition at line 145 of file InitMessage.cc.

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

Referenced by dumpInitHeader().

145  {
146  if (protocolVersion() < 5)
147  throw cms::Exception("Invalid Message Version", "InitMsgView")
148  << "HLT trigger selections are only supported in Protocol Version 5 and above"
149  << ".\n";
150 
152 }
uint32 protocolVersion() const
Definition: InitMessage.cc:109
uint8 * hlt_select_start_
Definition: InitMessage.h:110
void getNames(uint8 *from, uint32 from_len, Strings &to)
Definition: MsgTools.h:85
uint32 hlt_select_len_
Definition: InitMessage.h:112
std::string InitMsgView::hostName ( ) const

Definition at line 184 of file InitMessage.cc.

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

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

184  {
185  if (host_name_start_) {
186  std::string host_name(reinterpret_cast<char*>(host_name_start_), host_name_len_);
187  size_t found = host_name.find('\0');
188  if (found != std::string::npos) {
189  return std::string(host_name, 0, found);
190  } else {
191  return host_name;
192  }
193  } else {
194  return "n/a";
195  }
196 }
uint32 host_name_len_
Definition: InitMessage.h:118
uint8 * host_name_start_
Definition: InitMessage.h:117
uint32 InitMsgView::hostName_len ( ) const
inline

Definition at line 91 of file InitMessage.h.

References host_name_len_.

91 { return host_name_len_; }
uint32 host_name_len_
Definition: InitMessage.h:118
void InitMsgView::l1TriggerNames ( Strings save_here) const

Definition at line 154 of file InitMessage.cc.

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

Referenced by dumpInitHeader().

154  {
156 }
uint32 l1_trig_len_
Definition: InitMessage.h:115
uint8 * l1_trig_start_
Definition: InitMessage.h:113
void getNames(uint8 *from, uint32 from_len, Strings &to)
Definition: MsgTools.h:85
uint32 InitMsgView::outputModuleId ( ) const
inline

Definition at line 75 of file InitMessage.h.

References outputModuleId_.

Referenced by dumpInitHeader().

75 { return outputModuleId_; }
uint32 outputModuleId_
Definition: InitMessage.h:105
std::string InitMsgView::outputModuleLabel ( ) const

Definition at line 132 of file InitMessage.cc.

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

Referenced by dumpInitHeader().

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

Definition at line 123 of file InitMessage.cc.

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

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

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

Definition at line 109 of file InitMessage.cc.

References buf_, h, Version::protocol_, and InitHeader::version_.

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

109  {
110  InitHeader* h = reinterpret_cast<InitHeader*>(buf_);
111  return h->version_.protocol_;
112 }
uint8 protocol_
Definition: InitMessage.h:42
Version version_
Definition: InitMessage.h:55
uint8 * buf_
Definition: InitMessage.h:94
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void InitMsgView::pset ( uint8 put_here) const

Definition at line 114 of file InitMessage.cc.

References buf_, h, Version::pset_id_, and InitHeader::version_.

Referenced by dumpInitHeader().

114  {
115  InitHeader* h = reinterpret_cast<InitHeader*>(buf_);
116  memcpy(put_here, h->version_.pset_id_, sizeof(h->version_.pset_id_));
117 }
unsigned char pset_id_[16]
Definition: InitMessage.h:43
Version version_
Definition: InitMessage.h:55
uint8 * buf_
Definition: InitMessage.h:94
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
std::string InitMsgView::releaseTag ( ) const

Definition at line 119 of file InitMessage.cc.

References release_len_, release_start_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dumpInitHeader().

119  {
120  return std::string(reinterpret_cast<char*>(release_start_), release_len_);
121 }
uint32 release_len_
Definition: InitMessage.h:98
uint8 * release_start_
Definition: InitMessage.h:97
uint32 InitMsgView::run ( ) const

Definition at line 104 of file InitMessage.cc.

References buf_, convert32(), h, and InitHeader::run_.

Referenced by dumpInitHeader().

104  {
105  InitHeader* h = reinterpret_cast<InitHeader*>(buf_);
106  return convert32(h->run_);
107 }
char_uint32 run_
Definition: InitMessage.h:56
uint32 convert32(char_uint32 v)
Definition: MsgTools.h:28
uint8 * buf_
Definition: InitMessage.h:94
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
uint32 InitMsgView::size ( void  ) const
inline

Definition at line 66 of file InitMessage.h.

References head_, and HeaderView::size().

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), dumpInitHeader(), and StreamerOutputFile::write().

66 { return head_.size(); }
HeaderView head_
Definition: InitMessage.h:95
uint32 size() const
Definition: MsgHeader.h:44
uint8* InitMsgView::startAddress ( ) const
inline

Definition at line 67 of file InitMessage.h.

References buf_.

Referenced by StreamerOutputFile::writeStart().

67 { return buf_; }
uint8 * buf_
Definition: InitMessage.h:94

Member Data Documentation

uint32 InitMsgView::adler32_chksum_
private

Definition at line 116 of file InitMessage.h.

Referenced by adler32_chksum(), and InitMsgView().

uint8* InitMsgView::buf_
private
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.

Referenced by code(), and size().

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().