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 namespace edm::streamer {
40  struct Version {
41  Version(const uint8* pset) : protocol_(11) { std::copy(pset, pset + sizeof(pset_id_), &pset_id_[0]); }
42 
43  uint8 protocol_; // version of the protocol
44  unsigned char pset_id_[16]; // parameter set ID
45  };
46 
47  struct InitHeader {
48  InitHeader(const Header& h, uint32 run, const Version& v, uint32 init_header_size = 0, uint32 event_header_size = 0)
49  : header_(h), version_(v) {
50  convert(run, run_);
51  convert(init_header_size, init_header_size_);
52  convert(event_header_size, event_header_size_);
53  }
54 
60  };
61 
62  class InitMsgView {
63  public:
64  InitMsgView(void* buf);
65 
66  uint32 code() const { return head_.code(); }
67  uint32 size() const { return head_.size(); }
68  uint8* startAddress() const { return buf_; }
69 
70  uint32 run() const;
71  uint32 protocolVersion() const;
72  void pset(uint8* put_here) const;
73  std::string releaseTag() const;
74  std::string processName() const;
77 
78  void hltTriggerNames(Strings& save_here) const;
79  void hltTriggerSelections(Strings& save_here) const;
80  void l1TriggerNames(Strings& save_here) const;
81 
83  uint32 get_l1_bit_cnt() const { return l1_trig_count_; }
84 
85  // needed for streamer file
86  uint32 descLength() const { return desc_len_; }
87  const uint8* descData() const { return desc_start_; }
88  uint32 headerSize() const { return desc_start_ - buf_; }
89  uint32 eventHeaderSize() const;
91  std::string hostName() const;
92  uint32 hostName_len() const { return host_name_len_; }
93 
94  private:
97 
98  uint8* release_start_; // points to the string
100 
101  uint8* processName_start_; // points to the string
103 
104  uint8* outputModuleLabel_start_; // points to the string
107 
108  uint8* hlt_trig_start_; // points to the string
109  uint32 hlt_trig_count_; // number of strings
110  uint32 hlt_trig_len_; // length of strings character array only
111  uint8* hlt_select_start_; // points to the string
112  uint32 hlt_select_count_; // number of strings
113  uint32 hlt_select_len_; // length of strings character array only
114  uint8* l1_trig_start_; // points to the string
115  uint32 l1_trig_count_; // number of strings
116  uint32 l1_trig_len_; // length of strings character array only
120 
121  // does not need to be present in the message sent over the network,
122  // but is needed for the index file
123  uint8* desc_start_; // point to the bytes
125  };
126 } // namespace edm::streamer
127 #endif
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:43
uint32 headerSize() const
Definition: InitMessage.h:88
void hltTriggerNames(Strings &save_here) const
Definition: InitMessage.cc:143
uint32 outputModuleId() const
Definition: InitMessage.h:76
std::string releaseTag() const
Definition: InitMessage.cc:121
std::string hostName() const
Definition: InitMessage.cc:186
uint32 get_hlt_bit_cnt() const
Definition: InitMessage.h:82
void l1TriggerNames(Strings &save_here) const
Definition: InitMessage.cc:156
const uint8 * descData() const
Definition: InitMessage.h:87
uint32 get_l1_bit_cnt() const
Definition: InitMessage.h:83
void pset(uint8 *put_here) const
Definition: InitMessage.cc:116
unsigned char pset_id_[16]
Definition: InitMessage.h:44
unsigned char uint8
Definition: MsgTools.h:12
uint32 protocolVersion() const
Definition: InitMessage.cc:111
uint32 size() const
Definition: MsgHeader.h:46
uint32 descLength() const
Definition: InitMessage.h:86
uint32 code() const
Definition: MsgHeader.h:45
std::string processName() const
Definition: InitMessage.cc:125
uint32 hostName_len() const
Definition: InitMessage.h:92
uint8 * startAddress() const
Definition: InitMessage.h:68
InitHeader(const Header &h, uint32 run, const Version &v, uint32 init_header_size=0, uint32 event_header_size=0)
Definition: InitMessage.h:48
char_uint32 init_header_size_
Definition: InitMessage.h:58
void hltTriggerSelections(Strings &save_here) const
Definition: InitMessage.cc:147
uint32 adler32_chksum() const
Definition: InitMessage.h:90
Version(const uint8 *pset)
Definition: InitMessage.h:41
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:17
std::vector< std::string > Strings
Definition: MsgTools.h:19
char_uint32 event_header_size_
Definition: InitMessage.h:59
uint32 eventHeaderSize() const
Definition: InitMessage.cc:160
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
std::string outputModuleLabel() const
Definition: InitMessage.cc:134