00001 #ifndef IOPool_Streamer_StreamDQMSerializer_h 00002 #define IOPool_Streamer_StreamDQMSerializer_h 00003 00011 #include "TBufferFile.h" 00012 00013 #include "IOPool/Streamer/interface/DQMEventMsgBuilder.h" 00014 #include <stdint.h> 00015 #include <vector> 00016 00017 namespace edm 00018 { 00019 00020 class StreamDQMSerializer 00021 { 00022 00023 public: 00024 00025 StreamDQMSerializer(); 00026 00027 int serializeDQMEvent(DQMEvent::TObjectTable& toTable, 00028 bool use_compression, int compression_level); 00029 00030 // This object always caches the results of the last event 00031 // serialization operation. You get access to the data using the 00032 // following member functions. 00033 00034 unsigned char* bufferPointer() const { return ptr_; } 00035 unsigned int currentSpaceUsed() const { return curr_space_used_; } 00036 unsigned int currentEventSize() const { return curr_event_size_; } 00037 uint32_t adler32_chksum() const { return adler32_chksum_; } 00038 00039 private: 00040 00041 std::vector<unsigned char> comp_buf_; // space for compressed data 00042 unsigned int curr_event_size_; 00043 unsigned int curr_space_used_; // less than curr_event_size_ if compressed 00044 TBufferFile rootbuf_; 00045 unsigned char* ptr_; // set to the place where the last event stored 00046 uint32_t adler32_chksum_; // adler32 check sum for the (compressed) data 00047 00048 }; 00049 00050 } 00051 00052 #endif