36 selections_(selections),
46 FDEBUG(6) <<
"StreamSerializer::serializeRegistry" << std::endl;
49 FDEBUG(9) <<
"Product List: " << std::endl;
69 int bres = data_buffer.
rootbuf_.WriteObjectAny((
char*)&sd, tc);
74 throw cms::Exception(
"StreamTranslation",
"Registry serialization failed")
75 <<
"StreamSerializer failed to serialize registry\n";
82 throw cms::Exception(
"StreamTranslation",
"Registry serialization truncated")
83 <<
"StreamSerializer module attempted to serialize\n"
84 <<
"a registry that is to big for the allocated buffers\n";
89 throw cms::Exception(
"StreamTranslation",
"Registry serialization failed")
90 <<
"StreamSerializer module got an unknown error code\n"
91 <<
" while attempting to serialize registry\n";
98 data_buffer.
ptr_ = (
unsigned char*)data_buffer.
rootbuf_.Buffer();
133 selectionIDs.push_back(selectorConfig);
161 int bres = data_buffer.
rootbuf_.WriteObjectAny(&se,
tc_);
165 throw cms::Exception(
"StreamTranslation",
"Event serialization failed")
166 <<
"StreamSerializer failed to serialize event: "
167 << eventPrincipal.
id();
174 throw cms::Exception(
"StreamTranslation",
"Event serialization truncated")
175 <<
"StreamSerializer module attempted to serialize an event\n"
176 <<
"that is to big for the allocated buffers: "
177 << eventPrincipal.
id();
182 throw cms::Exception(
"StreamTranslation",
"Event serialization failed")
183 <<
"StreamSerializer module got an unknown error code\n"
184 <<
" while attempting to serialize event: "
185 << eventPrincipal.
id();
192 data_buffer.
ptr_ = (
unsigned char*)data_buffer.
rootbuf_.Buffer();
194 if(data_buffer.
ptr_ != data_.ptr_) {
195 std::cerr <<
"ROOT reset the buffer!!!!\n";
196 data_.ptr_ = data_buffer.
ptr_;
206 if(use_compression) {
207 unsigned int dest_size =
228 unsigned int inputSize,
229 std::vector<unsigned char> &outputBuffer,
230 int compressionLevel) {
231 unsigned int resultSize = 0;
234 unsigned long dest_size = (
unsigned long)(
double(inputSize)*
236 if(outputBuffer.size() < dest_size) outputBuffer.resize(dest_size);
239 int ret = compress2(&outputBuffer[0], &dest_size, inputBuffer,
240 inputSize, compressionLevel);
245 resultSize = dest_size;
247 FDEBUG(1) <<
" original size = " << inputSize
248 <<
" final size = " << dest_size
249 <<
" ratio = " << double(dest_size)/double(inputSize)
253 FDEBUG(9) <<
"Compression Return value: " << ret
254 <<
" Okay = " << Z_OK << std::endl;
256 std::cerr <<
"Compression Return value: " << ret <<
" Okay = " << Z_OK << std::endl;
WrapperBase const * wrapper() const
EventSelectionIDVector const & eventSelectionIDs() const
std::vector< BranchIDList > BranchIDLists
EventID const & id() const
ProductProvenance const * productProvenance() const
int serializeEvent(EventPrincipal const &eventPrincipal, ParameterSetID const &selectorConfig, bool use_compression, int compression_level, SerializeDataBuffer &data_buffer, ModuleCallingContext const *mcc)
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
std::vector< BranchID > const & parents() const
std::vector< unsigned char > comp_buf_
unsigned int curr_event_size_
bool getMapped(key_type const &k, value_type &result) const
BranchID const & branchID() const
unsigned int curr_space_used_
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
OutputHandle getForOutput(BranchID const &bid, bool getProd, ModuleCallingContext const *mcc) const
SelectedProducts const * selections_
ParentageID const & parentageID() const
std::vector< BranchDescription const * > SelectedProducts
int serializeRegistry(SerializeDataBuffer &data_buffer, const BranchIDLists &branchIDLists)
static ParentageRegistry * instance()
EventAuxiliary const & aux() const
void fillMap(regmap_type &fillme) const
static Registry * instance()
StreamSerializer(SelectedProducts const *selections)