00001 00040 #ifndef IOPool_Streamer_EventMessage_h 00041 #define IOPool_Streamer_EventMessage_h 00042 00043 #include "IOPool/Streamer/interface/MsgTools.h" 00044 #include "IOPool/Streamer/interface/MsgHeader.h" 00045 00046 // ----------------------- event message ------------------------ 00047 00048 struct EventHeader 00049 { 00050 Header header_; 00051 uint8 protocolVersion_; 00052 char_uint32 run_; 00053 char_uint32 event_; 00054 char_uint32 lumi_; 00055 char_uint32 origDataSize_; 00056 char_uint32 outModId_; 00057 }; 00058 00059 class EventMsgView 00060 { 00061 public: 00062 00063 EventMsgView(void* buf); 00064 00065 uint32 code() const { return head_.code(); } 00066 uint32 size() const { return head_.size(); } 00067 00068 const uint8* eventData() const { return event_start_; } 00069 uint8* startAddress() const { return buf_; } 00070 uint32 eventLength() const { return event_len_; } 00071 uint32 headerSize() const {return event_start_-buf_;} 00072 uint32 protocolVersion() const; 00073 uint32 run() const; 00074 uint32 event() const; 00075 uint32 lumi() const; 00076 uint32 origDataSize() const; 00077 uint32 outModId() const; 00078 00079 void l1TriggerBits(std::vector<bool>& put_here) const; 00080 void hltTriggerBits(uint8* put_here) const; 00081 00082 uint32 hltCount() const {return hlt_bits_count_;} 00083 uint32 l1Count() const {return l1_bits_count_;} 00084 uint32 adler32_chksum() const {return adler32_chksum_;} 00085 std::string hostName() const; 00086 uint32 hostName_len() const {return host_name_len_;} 00087 00088 private: 00089 uint8* buf_; 00090 HeaderView head_; 00091 00092 uint8* hlt_bits_start_; 00093 uint32 hlt_bits_count_; 00094 uint8* l1_bits_start_; 00095 uint32 l1_bits_count_; 00096 uint8* event_start_; 00097 uint32 event_len_; 00098 uint32 adler32_chksum_; 00099 uint8* host_name_start_; 00100 uint32 host_name_len_; 00101 bool v2Detected_; 00102 }; 00103 00104 #endif 00105