CMS 3D CMS Logo

InitMessage.h
Go to the documentation of this file.
1 
33 #ifndef IOPool_Streamer_InitMessage_h
34 #define IOPool_Streamer_InitMessage_h
35 
38 
39 struct Version {
40  Version(const uint8* pset) : protocol_(11) { std::copy(pset, pset + sizeof(pset_id_), &pset_id_[0]); }
41 
42  uint8 protocol_; // version of the protocol
43  unsigned char pset_id_[16]; // parameter set ID
44 };
45 
46 struct InitHeader {
47  InitHeader(const Header& h, uint32 run, const Version& v, uint32 init_header_size = 0, uint32 event_header_size = 0)
48  : header_(h), version_(v) {
49  convert(run, run_);
50  convert(init_header_size, init_header_size_);
51  convert(event_header_size, event_header_size_);
52  }
53 
59 };
60 
61 class InitMsgView {
62 public:
63  InitMsgView(void* buf);
64 
65  uint32 code() const { return head_.code(); }
66  uint32 size() const { return head_.size(); }
67  uint8* startAddress() const { return buf_; }
68 
69  uint32 run() const;
70  uint32 protocolVersion() const;
71  void pset(uint8* put_here) const;
72  std::string releaseTag() const;
73  std::string processName() const;
76 
77  void hltTriggerNames(Strings& save_here) const;
78  void hltTriggerSelections(Strings& save_here) const;
79  void l1TriggerNames(Strings& save_here) const;
80 
82  uint32 get_l1_bit_cnt() const { return l1_trig_count_; }
83 
84  // needed for streamer file
85  uint32 descLength() const { return desc_len_; }
86  const uint8* descData() const { return desc_start_; }
87  uint32 headerSize() const { return desc_start_ - buf_; }
88  uint32 eventHeaderSize() const;
90  std::string hostName() const;
91  uint32 hostName_len() const { return host_name_len_; }
92 
93 private:
96 
97  uint8* release_start_; // points to the string
99 
100  uint8* processName_start_; // points to the string
102 
103  uint8* outputModuleLabel_start_; // points to the string
106 
107  uint8* hlt_trig_start_; // points to the string
108  uint32 hlt_trig_count_; // number of strings
109  uint32 hlt_trig_len_; // length of strings character array only
110  uint8* hlt_select_start_; // points to the string
111  uint32 hlt_select_count_; // number of strings
112  uint32 hlt_select_len_; // length of strings character array only
113  uint8* l1_trig_start_; // points to the string
114  uint32 l1_trig_count_; // number of strings
115  uint32 l1_trig_len_; // length of strings character array only
119 
120  // does not need to be present in the message sent over the network,
121  // but is needed for the index file
122  uint8* desc_start_; // point to the bytes
124 };
125 
126 #endif
InitMsgView::headerSize
uint32 headerSize() const
Definition: InitMessage.h:87
InitMsgView::get_l1_bit_cnt
uint32 get_l1_bit_cnt() const
Definition: InitMessage.h:82
InitMsgView::adler32_chksum_
uint32 adler32_chksum_
Definition: InitMessage.h:116
InitMsgView::adler32_chksum
uint32 adler32_chksum() const
Definition: InitMessage.h:89
InitMsgView::protocolVersion
uint32 protocolVersion() const
Definition: InitMessage.cc:109
Header
Definition: MsgHeader.h:6
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
InitMsgView::releaseTag
std::string releaseTag() const
Definition: InitMessage.cc:119
InitMsgView::descLength
uint32 descLength() const
Definition: InitMessage.h:85
uint8
unsigned char uint8
Definition: MsgTools.h:11
InitMsgView::get_hlt_bit_cnt
uint32 get_hlt_bit_cnt() const
Definition: InitMessage.h:81
Version::Version
Version(const uint8 *pset)
Definition: InitMessage.h:40
InitMsgView::processName
std::string processName() const
Definition: InitMessage.cc:123
InitHeader::init_header_size_
char_uint32 init_header_size_
Definition: InitMessage.h:57
InitMsgView::outputModuleId
uint32 outputModuleId() const
Definition: InitMessage.h:75
MsgHeader.h
InitMsgView::hlt_trig_len_
uint32 hlt_trig_len_
Definition: InitMessage.h:109
char_uint32
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:16
findQualityFiles.v
v
Definition: findQualityFiles.py:179
InitMsgView::hlt_select_count_
uint32 hlt_select_count_
Definition: InitMessage.h:111
InitHeader::event_header_size_
char_uint32 event_header_size_
Definition: InitMessage.h:58
Strings
std::vector< std::string > Strings
Definition: MsgTools.h:18
Version::protocol_
uint8 protocol_
Definition: InitMessage.h:42
InitMsgView::size
uint32 size() const
Definition: InitMessage.h:66
InitMsgView::run
uint32 run() const
Definition: InitMessage.cc:104
uint32
unsigned int uint32
Definition: MsgTools.h:13
InitMsgView::l1TriggerNames
void l1TriggerNames(Strings &save_here) const
Definition: InitMessage.cc:154
InitHeader::InitHeader
InitHeader(const Header &h, uint32 run, const Version &v, uint32 init_header_size=0, uint32 event_header_size=0)
Definition: InitMessage.h:47
InitMsgView::hostName
std::string hostName() const
Definition: InitMessage.cc:183
InitHeader::version_
Version version_
Definition: InitMessage.h:55
InitMsgView::InitMsgView
InitMsgView(void *buf)
Definition: InitMessage.cc:7
InitHeader
Definition: InitMessage.h:46
InitMsgView::l1_trig_len_
uint32 l1_trig_len_
Definition: InitMessage.h:115
HeaderView
Definition: MsgHeader.h:35
h
InitMsgView::processName_len_
uint32 processName_len_
Definition: InitMessage.h:101
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
fileCollector.convert
def convert(infile, ofile)
Definition: fileCollector.py:47
InitMsgView::release_len_
uint32 release_len_
Definition: InitMessage.h:98
InitMsgView::desc_start_
uint8 * desc_start_
Definition: InitMessage.h:122
InitHeader::run_
char_uint32 run_
Definition: InitMessage.h:56
InitMsgView::startAddress
uint8 * startAddress() const
Definition: InitMessage.h:67
InitMsgView::desc_len_
uint32 desc_len_
Definition: InitMessage.h:123
HeaderView::code
uint32 code() const
Definition: MsgHeader.h:43
InitMsgView::outputModuleLabel_len_
uint32 outputModuleLabel_len_
Definition: InitMessage.h:104
InitMsgView::outputModuleId_
uint32 outputModuleId_
Definition: InitMessage.h:105
InitMsgView::release_start_
uint8 * release_start_
Definition: InitMessage.h:97
MsgTools.h
InitMsgView::host_name_len_
uint32 host_name_len_
Definition: InitMessage.h:118
InitMsgView::code
uint32 code() const
Definition: InitMessage.h:65
InitMsgView::head_
HeaderView head_
Definition: InitMessage.h:95
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
InitMsgView::l1_trig_start_
uint8 * l1_trig_start_
Definition: InitMessage.h:113
InitMsgView::hltTriggerSelections
void hltTriggerSelections(Strings &save_here) const
Definition: InitMessage.cc:145
InitMsgView::outputModuleLabel_start_
uint8 * outputModuleLabel_start_
Definition: InitMessage.h:103
HeaderView::size
uint32 size() const
Definition: MsgHeader.h:44
writedatasetfile.run
run
Definition: writedatasetfile.py:27
InitMsgView::hlt_select_start_
uint8 * hlt_select_start_
Definition: InitMessage.h:110
InitMsgView::eventHeaderSize
uint32 eventHeaderSize() const
Definition: InitMessage.cc:158
InitMsgView::hltTriggerNames
void hltTriggerNames(Strings &save_here) const
Definition: InitMessage.cc:141
InitMsgView::hlt_select_len_
uint32 hlt_select_len_
Definition: InitMessage.h:112
InitMsgView::hlt_trig_start_
uint8 * hlt_trig_start_
Definition: InitMessage.h:107
InitMsgView::buf_
uint8 * buf_
Definition: InitMessage.h:94
InitMsgView::outputModuleLabel
std::string outputModuleLabel() const
Definition: InitMessage.cc:132
Version::pset_id_
unsigned char pset_id_[16]
Definition: InitMessage.h:43
InitMsgView::processName_start_
uint8 * processName_start_
Definition: InitMessage.h:100
InitMsgView::descData
const uint8 * descData() const
Definition: InitMessage.h:86
InitMsgView::host_name_start_
uint8 * host_name_start_
Definition: InitMessage.h:117
InitMsgView::l1_trig_count_
uint32 l1_trig_count_
Definition: InitMessage.h:114
InitMsgView::hostName_len
uint32 hostName_len() const
Definition: InitMessage.h:91
InitMsgView::pset
void pset(uint8 *put_here) const
Definition: InitMessage.cc:114
InitHeader::header_
Header header_
Definition: InitMessage.h:54
InitMsgView::hlt_trig_count_
uint32 hlt_trig_count_
Definition: InitMessage.h:108
Version
Definition: InitMessage.h:39
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
InitMsgView
Definition: InitMessage.h:61