CMS 3D CMS Logo

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

#include <StreamDQMSerializer.h>

Classes

struct  Arr
 

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 26 of file StreamDQMSerializer.cc.

26  :
30  rootbuf_(TBuffer::kWrite,init_size),
31  ptr_((unsigned char*)rootbuf_.Buffer()),
33  { }
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 38 of file StreamDQMSerializer.cc.

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

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

41  {
42  // initialize the internal TBuffer
43  rootbuf_.Reset();
44  RootDebug tracer(10,10);
45 
46  // loop over each subfolder
47  DQMEvent::TObjectTable::const_iterator sfIter;
48  for (sfIter = toTable.begin(); sfIter != toTable.end(); sfIter++)
49  {
50  std::string folderName = sfIter->first;
51  std::vector<TObject *> toList = sfIter->second;
52 
53  // serialize the ME data
54  uint32 meCount = toList.size();
55  for (int idx = 0; idx < (int) meCount; idx++) {
56  TObject *toPtr = toList[idx];
57  rootbuf_.WriteObject(toPtr);
58  }
59  }
60 
61  // set sizes and pointer(s) appropriately
62  curr_event_size_ = rootbuf_.Length();
64  ptr_ = (unsigned char*) rootbuf_.Buffer();
65 
66  // compress the data, if needed
67  if (use_compression)
68  {
69  unsigned int dest_size =
72  // compression succeeded
73  if (dest_size != 0)
74  {
75  ptr_ = &comp_buf_[0]; // reset to point at compressed area
76  curr_space_used_ = dest_size;
77  }
78  }
79  // calculate the adler32 checksum
81 
82 
83  return curr_space_used_;
84  }
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 56 of file StreamDQMSerializer.h.

Referenced by adler32_chksum(), and serializeDQMEvent().

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

Definition at line 51 of file StreamDQMSerializer.h.

Referenced by serializeDQMEvent().

unsigned int edm::StreamDQMSerializer::curr_event_size_
private

Definition at line 52 of file StreamDQMSerializer.h.

Referenced by currentEventSize(), and serializeDQMEvent().

unsigned int edm::StreamDQMSerializer::curr_space_used_
private

Definition at line 53 of file StreamDQMSerializer.h.

Referenced by currentSpaceUsed(), and serializeDQMEvent().

unsigned char* edm::StreamDQMSerializer::ptr_
private
TBufferFile edm::StreamDQMSerializer::rootbuf_
private

Definition at line 54 of file StreamDQMSerializer.h.

Referenced by serializeDQMEvent().