Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-31 04:19:41

0001 /** Init Message
0002 
0003 Protocol Versoion 2:
0004 code 1 | size 4 | protocol version 1 | pset 16 | run 4 | Init Header Size 4| Event Header Seize 4| releaseTagLength 1 | ReleaseTag var| HLT count 4| HLT Trig Legth 4 | HLT Trig names var | L1 Trig Count 4| L1 TrigName len 4| L1 Trig Names var |desc legth 4 | description blob var
0005 
0006 Protocol Version 3:
0007 code 1 | size 4 | protocol version 1 | pset 16 | run 4 | Init Header Size 4| Event Header Size 4| releaseTagLength 1 | ReleaseTag var| HLT count 4| HLT Trig Legth 4 | HLT Trig names var | L1 Trig Count 4| L1 TrigName len 4| L1 Trig Names var |desc legth 4 | description blob var
0008 
0009 Protocol Version 4:
0010 code 1 | size 4 | protocol version 1 | pset 16 | run 4 | Init Header Size 4| Event Header Size 4| releaseTagLength 1 | ReleaseTag var| processNameLength 1 | processName var | HLT count 4| HLT Trig Legth 4 | HLT Trig names var | L1 Trig Count 4| L1 TrigName len 4| L1 Trig Names var |desc legth 4 | description blob var
0011 
0012 Protocol Version 5:
0013 code 1 | size 4 | protocol version 1 | pset 16 | run 4 | Init Header Size 4| Event Header Size 4| releaseTagLength 1 | ReleaseTag var| processNameLength 1 | processName var| outputModuleLabelLength 1 | outputModuleLabel var | HLT Trig count 4| HLT Trig Length 4 | HLT Trig names var | HLT Selection count 4| HLT Selection Length 4 | HLT Selection names var | L1 Trig Count 4| L1 TrigName len 4| L1 Trig Names var |desc legth 4 | description blob var
0014 
0015 Protocol Version 6:
0016 code 1 | size 4 | protocol version 1 | pset 16 | run 4 | Init Header Size 4| Event Header Size 4| releaseTagLength 1 | ReleaseTag var| processNameLength 1 | processName var| outputModuleLabelLength 1 | outputModuleLabel var | outputModuleId 4 | HLT Trig count 4| HLT Trig Length 4 | HLT Trig names var | HLT Selection count 4| HLT Selection Length 4 | HLT Selection names var | L1 Trig Count 4| L1 TrigName len 4| L1 Trig Names var |desc legth 4 | description blob var
0017   
0018 Protocol Version 7: No change to protocol, only description blob (and event data blob) changed
0019 code 1 | size 4 | protocol version 1 | pset 16 | run 4 | Init Header Size 4| Event Header Size 4| releaseTagLength 1 | ReleaseTag var| processNameLength 1 | processName var| outputModuleLabelLength 1 | outputModuleLabel var | outputModuleId 4 | HLT Trig count 4| HLT Trig Length 4 | HLT Trig names var | HLT Selection count 4| HLT Selection Length 4 | HLT Selection names var | L1 Trig Count 4| L1 TrigName len 4| L1 Trig Names var |desc legth 4 | description blob var
0020 
0021 Protocol Version 8: added data blob checksum and hostname
0022 code 1 | size 4 | protocol version 1 | pset 16 | run 4 | Init Header Size 4| Event Header Size 4| releaseTagLength 1 | ReleaseTag var| processNameLength 1 | processName var| outputModuleLabelLength 1 | outputModuleLabel var | outputModuleId 4 | HLT Trig count 4| HLT Trig Length 4 | HLT Trig names var | HLT Selection count 4| HLT Selection Length 4 | HLT Selection names var | L1 Trig Count 4| L1 TrigName len 4| L1 Trig Names var | adler32 chksum 4| host name length 4| host name var|desc legth 4 | description blob var
0023 
0024 Protocol Version 9: identical to version 8, but incremented to keep in sync with event msg protocol version 
0025 
0026 Protocol Version 10: removed hostname
0027 code 1 | size 4 | protocol version 1 | pset 16 | run 4 | Init Header Size 4| Event Header Size 4| releaseTagLength 1 | ReleaseTag var| processNameLength 1 | processName var| outputModuleLabelLength 1 | outputModuleLabel var | outputModuleId 4 | HLT Trig count 4| HLT Trig Length 4 | HLT Trig names var | HLT Selection count 4| HLT Selection Length 4 | HLT Selection names var | L1 Trig Count 4| L1 TrigName len 4| L1 Trig Names var | adler32 chksum 4| desc legth 4 | description blob var
0028 
0029 Protocol Version 11: identical to version 10, but incremented to keep in sync with event msg protocol version
0030 
0031 */
0032 
0033 #ifndef IOPool_Streamer_InitMessage_h
0034 #define IOPool_Streamer_InitMessage_h
0035 
0036 #include "IOPool/Streamer/interface/MsgTools.h"
0037 #include "IOPool/Streamer/interface/MsgHeader.h"
0038 
0039 namespace edm::streamer {
0040   struct Version {
0041     Version(const uint8* pset) : protocol_(11) { std::copy(pset, pset + sizeof(pset_id_), &pset_id_[0]); }
0042 
0043     uint8 protocol_;             // version of the protocol
0044     unsigned char pset_id_[16];  // parameter set ID
0045   };
0046 
0047   struct InitHeader {
0048     InitHeader(const Header& h, uint32 run, const Version& v, uint32 init_header_size = 0, uint32 event_header_size = 0)
0049         : header_(h), version_(v) {
0050       convert(run, run_);
0051       convert(init_header_size, init_header_size_);
0052       convert(event_header_size, event_header_size_);
0053     }
0054 
0055     Header header_;
0056     Version version_;
0057     char_uint32 run_;
0058     char_uint32 init_header_size_;
0059     char_uint32 event_header_size_;
0060   };
0061 
0062   class InitMsgView {
0063   public:
0064     InitMsgView(void* buf);
0065 
0066     uint32 code() const { return head_.code(); }
0067     uint32 size() const { return head_.size(); }
0068     uint8* startAddress() const { return buf_; }
0069 
0070     uint32 run() const;
0071     uint32 protocolVersion() const;
0072     void pset(uint8* put_here) const;
0073     std::string releaseTag() const;
0074     std::string processName() const;
0075     std::string outputModuleLabel() const;
0076     uint32 outputModuleId() const { return outputModuleId_; }
0077 
0078     void hltTriggerNames(Strings& save_here) const;
0079     void hltTriggerSelections(Strings& save_here) const;
0080     void l1TriggerNames(Strings& save_here) const;
0081 
0082     uint32 get_hlt_bit_cnt() const { return hlt_trig_count_; }
0083     uint32 get_l1_bit_cnt() const { return l1_trig_count_; }
0084 
0085     // needed for streamer file
0086     uint32 descLength() const { return desc_len_; }
0087     const uint8* descData() const { return desc_start_; }
0088     uint32 headerSize() const { return desc_start_ - buf_; }
0089     uint32 eventHeaderSize() const;
0090     uint32 adler32_chksum() const { return adler32_chksum_; }
0091     std::string hostName() const;
0092     uint32 hostName_len() const { return host_name_len_; }
0093 
0094   private:
0095     uint8* buf_;
0096     HeaderView head_;
0097 
0098     uint8* release_start_;  // points to the string
0099     uint32 release_len_;
0100 
0101     uint8* processName_start_;  // points to the string
0102     uint32 processName_len_;
0103 
0104     uint8* outputModuleLabel_start_;  // points to the string
0105     uint32 outputModuleLabel_len_;
0106     uint32 outputModuleId_;
0107 
0108     uint8* hlt_trig_start_;    // points to the string
0109     uint32 hlt_trig_count_;    // number of strings
0110     uint32 hlt_trig_len_;      // length of strings character array only
0111     uint8* hlt_select_start_;  // points to the string
0112     uint32 hlt_select_count_;  // number of strings
0113     uint32 hlt_select_len_;    // length of strings character array only
0114     uint8* l1_trig_start_;     // points to the string
0115     uint32 l1_trig_count_;     // number of strings
0116     uint32 l1_trig_len_;       // length of strings character array only
0117     uint32 adler32_chksum_;
0118     uint8* host_name_start_;
0119     uint32 host_name_len_;
0120 
0121     // does not need to be present in the message sent over the network,
0122     // but is needed for the index file
0123     uint8* desc_start_;  // point to the bytes
0124     uint32 desc_len_;
0125   };
0126 }  // namespace edm::streamer
0127 #endif