Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:19

0001 /** Event Message Represented here
0002 
0003 Protocol Versions 1-4:
0004 code 1 | size 4 | run 4 | event 4 | lumi 4 | reserved 4 |
0005 l1_count 4| l1bits l1_count/8 | 
0006 hlt_count 4| hltbits hlt_count/4 |
0007 eventdatalength 4 | eventdata blob {variable} 
0008 
0009 Protocol Version 5:
0010 code 1 | size 4 | protocol version 1 |
0011 run 4 | event 4 | lumi 4 | origDataSize 4 | outModId 4 |
0012 l1_count 4| l1bits l1_count/8 | 
0013 hlt_count 4| hltbits hlt_count/4 |
0014 eventdatalength 4 | eventdata blob {variable} 
0015 
0016 Protocol Version 6:  // no change here, only INIT msg change
0017 code 1 | size 4 | protocol version 1 |
0018 run 4 | event 4 | lumi 4 | origDataSize 4 | outModId 4 |
0019 l1_count 4| l1bits l1_count/8 | 
0020 hlt_count 4| hltbits hlt_count/4 |
0021 eventdatalength 4 | eventdata blob {variable} 
0022 
0023 Protocol Version 7:  // no change here, only data blob changes
0024 code 1 | size 4 | protocol version 1 |
0025 run 4 | event 4 | lumi 4 | origDataSize 4 | outModId 4 |
0026 l1_count 4| l1bits l1_count/8 | 
0027 hlt_count 4| hltbits hlt_count/4 |
0028 eventdatalength 4 | eventdata blob {variable} 
0029 
0030 Protocol Version 8:  // add in checksum of data blob changes
0031 code 1 | size 4 | protocol version 1 |
0032 run 4 | event 4 | lumi 4 | origDataSize 4 | outModId 4 |
0033 l1_count 4| l1bits l1_count/8 | 
0034 hlt_count 4| hltbits hlt_count/4 |
0035 adler32_chksum 4 | host name length 1 | host name {Fixed size}
0036 eventdatalength 4 | eventdata blob {variable} 
0037 
0038 Protocol Version 9:  // add dropped events counter
0039 code 1 | size 4 | protocol version 1 |
0040 run 4 | event 4 | lumi 4 | origDataSize 4 | outModId 4 |
0041 droppedEventsCount 4 |
0042 l1_count 4 | l1bits l1_count/8 | 
0043 hlt_count 4 | hltbits hlt_count/4 |
0044 adler32_chksum 4 | host name length 1 | host name {Fixed size}
0045 eventdatalength 4 | eventdata blob {variable} 
0046 
0047 Protocol Version 10: identical to version 9, but incremented to keep in sync with init msg version 
0048 
0049 Protocol Version 11: identical to version 10, except event changed from 4 bytes to 8 bytes
0050 
0051 */
0052 
0053 #ifndef IOPool_Streamer_EventMessage_h
0054 #define IOPool_Streamer_EventMessage_h
0055 
0056 #include "IOPool/Streamer/interface/MsgTools.h"
0057 #include "IOPool/Streamer/interface/MsgHeader.h"
0058 
0059 // ----------------------- event message ------------------------
0060 
0061 struct EventHeader {
0062   Header header_;
0063   uint8 protocolVersion_;
0064   char_uint32 run_;
0065   char_uint64 event_;
0066   char_uint32 lumi_;
0067   char_uint32 origDataSize_;
0068   char_uint32 outModId_;
0069   char_uint32 droppedEventsCount_;
0070 };
0071 
0072 class EventMsgView {
0073 public:
0074   EventMsgView(void* buf);
0075 
0076   uint32 code() const { return head_.code(); }
0077   uint32 size() const { return head_.size(); }
0078 
0079   const uint8* eventData() const { return event_start_; }
0080   uint8* startAddress() const { return buf_; }
0081   uint32 eventLength() const { return event_len_; }
0082   uint32 headerSize() const { return event_start_ - buf_; }
0083   uint32 protocolVersion() const;
0084   uint32 run() const;
0085   uint64 event() const;
0086   uint32 lumi() const;
0087   uint32 origDataSize() const;
0088   uint32 outModId() const;
0089   uint32 droppedEventsCount() const;
0090 
0091   void l1TriggerBits(std::vector<bool>& put_here) const;
0092   void hltTriggerBits(uint8* put_here) const;
0093 
0094   uint32 hltCount() const { return hlt_bits_count_; }
0095   uint32 l1Count() const { return l1_bits_count_; }
0096   uint32 adler32_chksum() const { return adler32_chksum_; }
0097   std::string hostName() const;
0098   uint32 hostName_len() const { return host_name_len_; }
0099 
0100 private:
0101   uint8* buf_;
0102   HeaderView head_;
0103 
0104   uint8* hlt_bits_start_;
0105   uint32 hlt_bits_count_;
0106   uint8* l1_bits_start_;
0107   uint32 l1_bits_count_;
0108   uint8* event_start_;
0109   uint32 event_len_;
0110   uint32 adler32_chksum_;
0111   uint8* host_name_start_;
0112   uint32 host_name_len_;
0113   bool v2Detected_;
0114 };
0115 
0116 #endif