36 selections_(selections),
46 FDEBUG(6) <<
"StreamSerializer::serializeRegistry" << std::endl;
51 FDEBUG(9) <<
"Product List: " << std::endl;
56 FDEBUG(9) <<
"StreamOutput got product = " << (*i)->className()
69 for(PCMap::const_iterator
i = procConfigMap.begin(),
e = procConfigMap.end();
i !=
e; ++
i) {
70 procConfigVector.push_back(
i->second);
80 int bres = data_buffer.
rootbuf_.WriteObjectAny((
char*)&sd, tc);
85 throw cms::Exception(
"StreamTranslation",
"Registry serialization failed")
86 <<
"StreamSerializer failed to serialize registry\n";
93 throw cms::Exception(
"StreamTranslation",
"Registry serialization truncated")
94 <<
"StreamSerializer module attempted to serialize\n"
95 <<
"a registry that is to big for the allocated buffers\n";
100 throw cms::Exception(
"StreamTranslation",
"Registry serialization failed")
101 <<
"StreamSerializer module got an unknown error code\n"
102 <<
" while attempting to serialize registry\n";
109 data_buffer.
ptr_ = (
unsigned char*)data_buffer.
rootbuf_.Buffer();
143 selectionIDs.push_back(selectorConfig);
172 int bres = data_buffer.
rootbuf_.WriteObjectAny(&se,
tc_);
176 throw cms::Exception(
"StreamTranslation",
"Event serialization failed")
177 <<
"StreamSerializer failed to serialize event: "
178 << eventPrincipal.
id();
185 throw cms::Exception(
"StreamTranslation",
"Event serialization truncated")
186 <<
"StreamSerializer module attempted to serialize an event\n"
187 <<
"that is to big for the allocated buffers: "
188 << eventPrincipal.
id();
193 throw cms::Exception(
"StreamTranslation",
"Event serialization failed")
194 <<
"StreamSerializer module got an unknown error code\n"
195 <<
" while attempting to serialize event: "
196 << eventPrincipal.
id();
203 data_buffer.
ptr_ = (
unsigned char*)data_buffer.
rootbuf_.Buffer();
205 if(data_buffer.
ptr_ != data_.ptr_) {
206 std::cerr <<
"ROOT reset the buffer!!!!\n";
207 data_.ptr_ = data_buffer.
ptr_;
217 if(use_compression) {
218 unsigned int dest_size =
239 unsigned int inputSize,
240 std::vector<unsigned char> &outputBuffer,
241 int compressionLevel) {
242 unsigned int resultSize = 0;
245 unsigned long dest_size = (
unsigned long)(
double(inputSize)*
247 if(outputBuffer.size() < dest_size) outputBuffer.resize(dest_size);
250 int ret = compress2(&outputBuffer[0], &dest_size, inputBuffer,
251 inputSize, compressionLevel);
256 resultSize = dest_size;
258 FDEBUG(1) <<
" original size = " << inputSize
259 <<
" final size = " << dest_size
260 <<
" ratio = " << double(dest_size)/double(inputSize)
264 FDEBUG(9) <<
"Compression Return value: " << ret
265 <<
" Okay = " << Z_OK << std::endl;
267 std::cerr <<
"Compression Return value: " << ret <<
" Okay = " << Z_OK << std::endl;
EventSelectionIDVector const & eventSelectionIDs() const
static ThreadSafeRegistry * instance()
EventID const & id() const
ProductProvenance const * productProvenance() const
bool getMapped(key_type const &k, value_type &result) const
BranchListIndexes const & branchListIndexes() const
TClass * getTClass(const std::type_info &ti)
static unsigned int compressBuffer(unsigned char *inputBuffer, unsigned int inputSize, std::vector< unsigned char > &outputBuffer, int compressionLevel)
ProcessHistory const & processHistory() const
std::vector< EventSelectionID > EventSelectionIDVector
ProcessConfigurationRegistry::vector_type ProcessConfigurationVector
std::vector< BranchID > const & parents() const
std::vector< unsigned char > comp_buf_
std::map< key_type, value_type > collection_type
unsigned int curr_event_size_
static ThreadSafeIndexedRegistry * instance()
void const * wrapper() const
OutputHandle getForOutput(BranchID const &bid, bool getProd) const
BranchID const & branchID() const
StreamSerializer(Selections const *selections)
unsigned int curr_space_used_
int serializeEvent(EventPrincipal const &eventPrincipal, ParameterSetID const &selectorConfig, bool use_compression, int compression_level, SerializeDataBuffer &data_buffer)
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
ParentageID const & parentageID() const
char data[epos_bytes_allocation]
Selections const * selections_
int serializeRegistry(SerializeDataBuffer &data_buffer)
collection_type & data()
Provide access to the contained collection.
void fillMap(Registry *reg, regmap_type &fillme)
EventAuxiliary const & aux() const