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

Definition at line 37 of file StreamDQMSerializer.h.

References adler32_chksum_.

37 { return adler32_chksum_; }
unsigned char* edm::StreamDQMSerializer::bufferPointer ( ) const
inline

Definition at line 34 of file StreamDQMSerializer.h.

References ptr_.

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

Definition at line 36 of file StreamDQMSerializer.h.

References curr_event_size_.

36 { return curr_event_size_; }
unsigned int edm::StreamDQMSerializer::currentSpaceUsed ( ) const
inline

Definition at line 35 of file StreamDQMSerializer.h.

References curr_space_used_.

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_, customizeTrackingMonitorSeedNumber::idx, ptr_, rootbuf_, and AlCaHLTBitMon_QueryRunRegistry::string.

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)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...

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().