CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
InitMessage.h
Go to the documentation of this file.
1 
27 #ifndef IOPool_Streamer_InitMessage_h
28 #define IOPool_Streamer_InitMessage_h
29 
32 
33 struct Version
34 {
35  Version(const uint8* pset):protocol_(9)
36  { std::copy(pset,pset+sizeof(pset_id_),&pset_id_[0]); }
37 
38  uint8 protocol_; // version of the protocol
39  unsigned char pset_id_[16]; // parameter set ID
40 };
41 
42 struct InitHeader
43 {
44  InitHeader(const Header& h, uint32 run, const Version& v,
45  uint32 init_header_size=0, uint32 event_header_size=0):
46  header_(h),version_(v)
47  {
48  convert(run,run_);
49  convert(init_header_size, init_header_size_);
50  convert(event_header_size, event_header_size_);
51  }
52 
58 };
59 
61 {
62 public:
63 
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;
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 
127 #endif
128 
Header header_
Definition: InitMessage.h:53
uint32 hostName_len() const
Definition: InitMessage.h:92
const uint8 * descData() const
Definition: InitMessage.h:87
InitHeader(const Header &h, uint32 run, const Version &v, uint32 init_header_size=0, uint32 event_header_size=0)
Definition: InitMessage.h:44
std::vector< std::string > Strings
Definition: MsgTools.h:18
char_uint32 event_header_size_
Definition: InitMessage.h:57
uint32 hlt_select_count_
Definition: InitMessage.h:112
uint8 protocol_
Definition: InitMessage.h:38
uint32 code() const
Definition: MsgHeader.h:34
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:46
void hltTriggerNames(Strings &save_here) const
Definition: InitMessage.cc:142
uint8 * startAddress() const
Definition: InitMessage.h:68
uint32 release_len_
Definition: InitMessage.h:99
uint8 * desc_start_
Definition: InitMessage.h:123
uint32 hlt_trig_len_
Definition: InitMessage.h:110
uint32 adler32_chksum() const
Definition: InitMessage.h:90
std::string releaseTag() const
Definition: InitMessage.cc:118
uint32 desc_len_
Definition: InitMessage.h:124
InitMsgView(void *buf)
Definition: InitMessage.cc:7
unsigned char pset_id_[16]
Definition: InitMessage.h:39
uint32 l1_trig_len_
Definition: InitMessage.h:116
std::string hostName() const
Definition: InitMessage.cc:186
HeaderView head_
Definition: InitMessage.h:96
uint8 * l1_trig_start_
Definition: InitMessage.h:114
Version version_
Definition: InitMessage.h:54
uint32 outputModuleLabel_len_
Definition: InitMessage.h:105
uint8 * outputModuleLabel_start_
Definition: InitMessage.h:104
uint8 * release_start_
Definition: InitMessage.h:98
void l1TriggerNames(Strings &save_here) const
Definition: InitMessage.cc:156
Version(const uint8 *pset)
Definition: InitMessage.h:35
unsigned int uint32
Definition: MsgTools.h:13
uint32 host_name_len_
Definition: InitMessage.h:119
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:16
uint32 processName_len_
Definition: InitMessage.h:102
uint32 protocolVersion() const
Definition: InitMessage.cc:106
uint32 headerSize() const
Definition: InitMessage.h:88
std::string outputModuleLabel() const
Definition: InitMessage.cc:132
uint32 outputModuleId_
Definition: InitMessage.h:106
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
uint32 eventHeaderSize() const
Definition: InitMessage.cc:161
uint32 size() const
Definition: MsgHeader.h:35
uint8 * hlt_trig_start_
Definition: InitMessage.h:108
char_uint32 run_
Definition: InitMessage.h:55
uint8 * host_name_start_
Definition: InitMessage.h:118
uint8 * hlt_select_start_
Definition: InitMessage.h:111
unsigned char uint8
Definition: MsgTools.h:11
uint32 outputModuleId() const
Definition: InitMessage.h:76
uint32 code() const
Definition: InitMessage.h:66
uint8 * buf_
Definition: InitMessage.h:95
std::string processName() const
Definition: InitMessage.cc:123
uint32 get_hlt_bit_cnt() const
Definition: InitMessage.h:82
uint32 run() const
Definition: InitMessage.cc:100
uint32 size() const
Definition: InitMessage.h:67
uint32 adler32_chksum_
Definition: InitMessage.h:117
uint32 hlt_trig_count_
Definition: InitMessage.h:109
uint32 descLength() const
Definition: InitMessage.h:86
uint8 * processName_start_
Definition: InitMessage.h:101
uint32 get_l1_bit_cnt() const
Definition: InitMessage.h:83
uint32 l1_trig_count_
Definition: InitMessage.h:115
void hltTriggerSelections(Strings &save_here) const
Definition: InitMessage.cc:147
void pset(uint8 *put_here) const
Definition: InitMessage.cc:112
char_uint32 init_header_size_
Definition: InitMessage.h:56
uint32 hlt_select_len_
Definition: InitMessage.h:113