CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
edm::StreamDQMSerializer Class Reference

#include <StreamDQMSerializer.h>

Public Member Functions

uint32_t adler32_chksum () const
 
unsigned char * bufferPointer () const
 
unsigned int currentEventSize () const
 
unsigned int currentSpaceUsed () const
 
int serializeDQMEvent (DQMEvent::TObjectTable &toTable, bool use_compression, int compression_level)
 
 StreamDQMSerializer ()
 

Private Attributes

uint32_t adler32_chksum_
 
std::vector< unsigned char > comp_buf_
 
unsigned int curr_event_size_
 
unsigned int curr_space_used_
 
unsigned char * ptr_
 
TBufferFile rootbuf_
 

Detailed Description

Definition at line 20 of file StreamDQMSerializer.h.

Constructor & Destructor Documentation

edm::StreamDQMSerializer::StreamDQMSerializer ( )

Default constructor

Definition at line 23 of file StreamDQMSerializer.cc.

23  :
27  rootbuf_(TBuffer::kWrite,init_size),
28  ptr_((unsigned char*)rootbuf_.Buffer()),
30  { }
const int init_size
std::vector< unsigned char > comp_buf_

Member Function Documentation

uint32_t edm::StreamDQMSerializer::adler32_chksum ( ) const
inline
unsigned char* edm::StreamDQMSerializer::bufferPointer ( ) const
inline

Definition at line 34 of file StreamDQMSerializer.h.

References ptr_.

Referenced by stor::DQMTopLevelFolder::getRecord(), and FUShmDQMOutputService::postEndLumi().

34 { return ptr_; }
unsigned int edm::StreamDQMSerializer::currentEventSize ( ) const
inline
unsigned int edm::StreamDQMSerializer::currentSpaceUsed ( ) const
inline

Definition at line 35 of file StreamDQMSerializer.h.

References curr_space_used_.

Referenced by FUShmDQMOutputService::postEndLumi().

35 { return curr_space_used_; }
int edm::StreamDQMSerializer::serializeDQMEvent ( DQMEvent::TObjectTable toTable,
bool  use_compression,
int  compression_level 
)

Serializes the specified table of ROOT TObjects into the internal buffer.

Definition at line 35 of file StreamDQMSerializer.cc.

References cms::Adler32(), adler32_chksum_, comp_buf_, edm::StreamSerializer::compressBuffer(), curr_event_size_, curr_space_used_, ptr_, and rootbuf_.

Referenced by stor::DQMTopLevelFolder::getRecord(), and FUShmDQMOutputService::postEndLumi().

38  {
39  // initialize the internal TBuffer
40  rootbuf_.Reset();
41  RootDebug tracer(10,10);
42 
43  // loop over each subfolder
44  DQMEvent::TObjectTable::const_iterator sfIter;
45  for (sfIter = toTable.begin(); sfIter != toTable.end(); sfIter++)
46  {
47  std::string folderName = sfIter->first;
48  std::vector<TObject *> toList = sfIter->second;
49 
50  // serialize the ME data
51  uint32 meCount = toList.size();
52  for (int idx = 0; idx < (int) meCount; idx++) {
53  TObject *toPtr = toList[idx];
54  rootbuf_.WriteObject(toPtr);
55  }
56  }
57 
58  // set sizes and pointer(s) appropriately
59  curr_event_size_ = rootbuf_.Length();
61  ptr_ = (unsigned char*) rootbuf_.Buffer();
62 
63  // compress the data, if needed
64  if (use_compression)
65  {
66  unsigned int dest_size =
69  // compression succeeded
70  if (dest_size != 0)
71  {
72  ptr_ = &comp_buf_[0]; // reset to point at compressed area
73  curr_space_used_ = dest_size;
74  }
75  }
76  // calculate the adler32 checksum
78 
79 
80  return curr_space_used_;
81  }
static unsigned int compressBuffer(unsigned char *inputBuffer, unsigned int inputSize, std::vector< unsigned char > &outputBuffer, int compressionLevel)
std::vector< unsigned char > comp_buf_
unsigned int uint32
Definition: MsgTools.h:13
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)

Member Data Documentation

uint32_t edm::StreamDQMSerializer::adler32_chksum_
private

Definition at line 46 of file StreamDQMSerializer.h.

Referenced by adler32_chksum(), and serializeDQMEvent().

std::vector<unsigned char> edm::StreamDQMSerializer::comp_buf_
private

Definition at line 41 of file StreamDQMSerializer.h.

Referenced by serializeDQMEvent().

unsigned int edm::StreamDQMSerializer::curr_event_size_
private

Definition at line 42 of file StreamDQMSerializer.h.

Referenced by currentEventSize(), and serializeDQMEvent().

unsigned int edm::StreamDQMSerializer::curr_space_used_
private

Definition at line 43 of file StreamDQMSerializer.h.

Referenced by currentSpaceUsed(), and serializeDQMEvent().

unsigned char* edm::StreamDQMSerializer::ptr_
private

Definition at line 45 of file StreamDQMSerializer.h.

Referenced by bufferPointer(), and serializeDQMEvent().

TBufferFile edm::StreamDQMSerializer::rootbuf_
private

Definition at line 44 of file StreamDQMSerializer.h.

Referenced by serializeDQMEvent().