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 
31 #ifndef IOPool_Streamer_InitMessage_h
32 #define IOPool_Streamer_InitMessage_h
33 
36 
37 struct Version
38 {
39  Version(const uint8* pset):protocol_(10)
40  { 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 {
48  InitHeader(const Header& h, uint32 run, const Version& v,
49  uint32 init_header_size=0, uint32 event_header_size=0):
50  header_(h),version_(v)
51  {
52  convert(run,run_);
53  convert(init_header_size, init_header_size_);
54  convert(event_header_size, event_header_size_);
55  }
56 
62 };
63 
65 {
66 public:
67 
68  InitMsgView(void* buf);
69 
70  uint32 code() const { return head_.code(); }
71  uint32 size() const { return head_.size(); }
72  uint8* startAddress() const { return buf_; }
73 
74  uint32 run() const;
75  uint32 protocolVersion() const;
76  void pset(uint8* put_here) const;
77  std::string releaseTag() const;
78  std::string processName() const;
81 
82  void hltTriggerNames(Strings& save_here) const;
83  void hltTriggerSelections(Strings& save_here) const;
84  void l1TriggerNames(Strings& save_here) const;
85 
87  uint32 get_l1_bit_cnt() const { return l1_trig_count_; }
88 
89  // needed for streamer file
90  uint32 descLength() const { return desc_len_; }
91  const uint8* descData() const { return desc_start_; }
92  uint32 headerSize() const {return desc_start_-buf_;}
93  uint32 eventHeaderSize() const;
95  std::string hostName() const;
97 
98 private:
101 
102  uint8* release_start_; // points to the string
104 
105  uint8* processName_start_; // points to the string
107 
108  uint8* outputModuleLabel_start_; // points to the string
111 
112  uint8* hlt_trig_start_; // points to the string
113  uint32 hlt_trig_count_; // number of strings
114  uint32 hlt_trig_len_; // length of strings character array only
115  uint8* hlt_select_start_; // points to the string
116  uint32 hlt_select_count_; // number of strings
117  uint32 hlt_select_len_; // length of strings character array only
118  uint8* l1_trig_start_; // points to the string
119  uint32 l1_trig_count_; // number of strings
120  uint32 l1_trig_len_; // length of strings character array only
124 
125  // does not need to be present in the message sent over the network,
126  // but is needed for the index file
127  uint8* desc_start_; // point to the bytes
129 };
130 
131 #endif
132 
Header header_
Definition: InitMessage.h:57
uint32 hostName_len() const
Definition: InitMessage.h:96
const uint8 * descData() const
Definition: InitMessage.h:91
InitHeader(const Header &h, uint32 run, const Version &v, uint32 init_header_size=0, uint32 event_header_size=0)
Definition: InitMessage.h:48
std::vector< std::string > Strings
Definition: MsgTools.h:18
char_uint32 event_header_size_
Definition: InitMessage.h:61
uint32 hlt_select_count_
Definition: InitMessage.h:116
uint8 protocol_
Definition: InitMessage.h:42
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:146
uint8 * startAddress() const
Definition: InitMessage.h:72
uint32 release_len_
Definition: InitMessage.h:103
uint8 * desc_start_
Definition: InitMessage.h:127
uint32 hlt_trig_len_
Definition: InitMessage.h:114
uint32 adler32_chksum() const
Definition: InitMessage.h:94
std::string releaseTag() const
Definition: InitMessage.cc:122
uint32 desc_len_
Definition: InitMessage.h:128
InitMsgView(void *buf)
Definition: InitMessage.cc:7
unsigned char pset_id_[16]
Definition: InitMessage.h:43
uint32 l1_trig_len_
Definition: InitMessage.h:120
std::string hostName() const
Definition: InitMessage.cc:190
HeaderView head_
Definition: InitMessage.h:100
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
uint8 * l1_trig_start_
Definition: InitMessage.h:118
Version version_
Definition: InitMessage.h:58
uint32 outputModuleLabel_len_
Definition: InitMessage.h:109
uint8 * outputModuleLabel_start_
Definition: InitMessage.h:108
uint8 * release_start_
Definition: InitMessage.h:102
void l1TriggerNames(Strings &save_here) const
Definition: InitMessage.cc:160
Version(const uint8 *pset)
Definition: InitMessage.h:39
unsigned int uint32
Definition: MsgTools.h:13
uint32 host_name_len_
Definition: InitMessage.h:123
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:16
uint32 processName_len_
Definition: InitMessage.h:106
uint32 protocolVersion() const
Definition: InitMessage.cc:110
uint32 headerSize() const
Definition: InitMessage.h:92
std::string outputModuleLabel() const
Definition: InitMessage.cc:136
uint32 outputModuleId_
Definition: InitMessage.h:110
uint32 eventHeaderSize() const
Definition: InitMessage.cc:165
uint32 size() const
Definition: MsgHeader.h:35
uint8 * hlt_trig_start_
Definition: InitMessage.h:112
char_uint32 run_
Definition: InitMessage.h:59
uint8 * host_name_start_
Definition: InitMessage.h:122
uint8 * hlt_select_start_
Definition: InitMessage.h:115
unsigned char uint8
Definition: MsgTools.h:11
uint32 outputModuleId() const
Definition: InitMessage.h:80
uint32 code() const
Definition: InitMessage.h:70
uint8 * buf_
Definition: InitMessage.h:99
std::string processName() const
Definition: InitMessage.cc:127
uint32 get_hlt_bit_cnt() const
Definition: InitMessage.h:86
uint32 run() const
Definition: InitMessage.cc:104
uint32 size() const
Definition: InitMessage.h:71
uint32 adler32_chksum_
Definition: InitMessage.h:121
uint32 hlt_trig_count_
Definition: InitMessage.h:113
uint32 descLength() const
Definition: InitMessage.h:90
uint8 * processName_start_
Definition: InitMessage.h:105
uint32 get_l1_bit_cnt() const
Definition: InitMessage.h:87
uint32 l1_trig_count_
Definition: InitMessage.h:119
void hltTriggerSelections(Strings &save_here) const
Definition: InitMessage.cc:151
void pset(uint8 *put_here) const
Definition: InitMessage.cc:116
char_uint32 init_header_size_
Definition: InitMessage.h:60
uint32 hlt_select_len_
Definition: InitMessage.h:117