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