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
const uint8 * descData() const
Definition: InitMessage.h:86
Header header_
Definition: InitMessage.h:54
std::string releaseTag() const
Definition: InitMessage.cc:119
uint32 outputModuleId() const
Definition: InitMessage.h:75
uint32 get_l1_bit_cnt() const
Definition: InitMessage.h:82
InitHeader(const Header &h, uint32 run, const Version &v, uint32 init_header_size=0, uint32 event_header_size=0)
Definition: InitMessage.h:47
std::vector< std::string > Strings
Definition: MsgTools.h:18
char_uint32 event_header_size_
Definition: InitMessage.h:58
uint32 protocolVersion() const
Definition: InitMessage.cc:109
uint32 hlt_select_count_
Definition: InitMessage.h:111
uint32 run() const
Definition: InitMessage.cc:104
void l1TriggerNames(Strings &save_here) const
Definition: InitMessage.cc:154
uint32 descLength() const
Definition: InitMessage.h:85
uint8 protocol_
Definition: InitMessage.h:42
std::string processName() const
Definition: InitMessage.cc:123
uint32 size() const
Definition: InitMessage.h:66
uint32 release_len_
Definition: InitMessage.h:98
uint8 * desc_start_
Definition: InitMessage.h:122
uint32 size() const
Definition: MsgHeader.h:44
uint32 hlt_trig_len_
Definition: InitMessage.h:109
uint32 desc_len_
Definition: InitMessage.h:123
std::string hostName() const
Definition: InitMessage.cc:184
InitMsgView(void *buf)
Definition: InitMessage.cc:7
unsigned char pset_id_[16]
Definition: InitMessage.h:43
uint32 l1_trig_len_
Definition: InitMessage.h:115
HeaderView head_
Definition: InitMessage.h:95
void hltTriggerSelections(Strings &save_here) const
Definition: InitMessage.cc:145
uint8 * l1_trig_start_
Definition: InitMessage.h:113
Version version_
Definition: InitMessage.h:55
uint32 outputModuleLabel_len_
Definition: InitMessage.h:104
def convert(infile, ofile)
uint8 * outputModuleLabel_start_
Definition: InitMessage.h:103
uint8 * release_start_
Definition: InitMessage.h:97
Version(const uint8 *pset)
Definition: InitMessage.h:40
unsigned int uint32
Definition: MsgTools.h:13
uint32 host_name_len_
Definition: InitMessage.h:118
uint32 code() const
Definition: InitMessage.h:65
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:16
uint32 processName_len_
Definition: InitMessage.h:101
uint32 code() const
Definition: MsgHeader.h:43
uint32 outputModuleId_
Definition: InitMessage.h:105
uint8 * hlt_trig_start_
Definition: InitMessage.h:107
uint8 * startAddress() const
Definition: InitMessage.h:67
char_uint32 run_
Definition: InitMessage.h:56
uint8 * host_name_start_
Definition: InitMessage.h:117
uint32 hostName_len() const
Definition: InitMessage.h:91
uint8 * hlt_select_start_
Definition: InitMessage.h:110
unsigned char uint8
Definition: MsgTools.h:11
uint8 * buf_
Definition: InitMessage.h:94
uint32 adler32_chksum_
Definition: InitMessage.h:116
uint32 hlt_trig_count_
Definition: InitMessage.h:108
uint32 eventHeaderSize() const
Definition: InitMessage.cc:158
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 outputModuleLabel() const
Definition: InitMessage.cc:132
uint8 * processName_start_
Definition: InitMessage.h:100
uint32 headerSize() const
Definition: InitMessage.h:87
uint32 l1_trig_count_
Definition: InitMessage.h:114
uint32 get_hlt_bit_cnt() const
Definition: InitMessage.h:81
void pset(uint8 *put_here) const
Definition: InitMessage.cc:114
uint32 adler32_chksum() const
Definition: InitMessage.h:89
char_uint32 init_header_size_
Definition: InitMessage.h:57
void hltTriggerNames(Strings &save_here) const
Definition: InitMessage.cc:141
uint32 hlt_select_len_
Definition: InitMessage.h:112