49 FDEBUG(6) <<
"StreamSerializer::serializeRegistry" << std::endl;
54 FDEBUG(9) <<
"Product List: " << std::endl;
59 FDEBUG(9) <<
"StreamOutput got product = " << (*i)->className()
72 for (PCMap::const_iterator
i = procConfigMap.begin(),
e = procConfigMap.end();
i !=
e; ++
i) {
73 procConfigVector.push_back(
i->second);
83 int bres = data_buffer.
rootbuf_.WriteObjectAny((
char*)&sd, tc);
88 throw cms::Exception(
"StreamTranslation",
"Registry serialization failed")
89 <<
"StreamSerializer failed to serialize registry\n";
96 throw cms::Exception(
"StreamTranslation",
"Registry serialization truncated")
97 <<
"StreamSerializer module attempted to serialize\n"
98 <<
"a registry that is to big for the allocated buffers\n";
103 throw cms::Exception(
"StreamTranslation",
"Registry serialization failed")
104 <<
"StreamSerializer module got an unknown error code\n"
105 <<
" while attempting to serialize registry\n";
112 data_buffer.
ptr_ = (
unsigned char*)data_buffer.
rootbuf_.Buffer();
146 selectionIDs.push_back(selectorConfig);
175 int bres = data_buffer.
rootbuf_.WriteObjectAny(&se,
tc_);
179 throw cms::Exception(
"StreamTranslation",
"Event serialization failed")
180 <<
"StreamSerializer failed to serialize event: "
181 << eventPrincipal.
id();
188 throw cms::Exception(
"StreamTranslation",
"Event serialization truncated")
189 <<
"StreamSerializer module attempted to serialize an event\n"
190 <<
"that is to big for the allocated buffers: "
191 << eventPrincipal.
id();
196 throw cms::Exception(
"StreamTranslation",
"Event serialization failed")
197 <<
"StreamSerializer module got an unknown error code\n"
198 <<
" while attempting to serialize event: "
199 << eventPrincipal.
id();
206 data_buffer.
ptr_ = (
unsigned char*)data_buffer.
rootbuf_.Buffer();
208 if(data_buffer.
ptr_ != data_.ptr_) {
209 std::cerr <<
"ROOT reset the buffer!!!!\n";
210 data_.ptr_ = data_buffer.
ptr_;
220 if(use_compression) {
221 unsigned int dest_size =
242 unsigned int inputSize,
243 std::vector<unsigned char> &outputBuffer,
244 int compressionLevel) {
245 unsigned int resultSize = 0;
248 unsigned long dest_size = (
unsigned long)(
double(inputSize)*
250 if(outputBuffer.size() < dest_size) outputBuffer.resize(dest_size);
253 int ret = compress2(&outputBuffer[0], &dest_size, inputBuffer,
254 inputSize, compressionLevel);
259 resultSize = dest_size;
261 FDEBUG(1) <<
" original size = " << inputSize
262 <<
" final size = " << dest_size
263 <<
" ratio = " << double(dest_size)/double(inputSize)
267 FDEBUG(9) <<
"Compression Return value: " << ret
268 <<
" Okay = " << Z_OK << std::endl;
270 std::cerr <<
"Compression Return value: " << ret <<
" Okay = " << Z_OK << std::endl;
EventSelectionIDVector const & eventSelectionIDs() const
boost::shared_ptr< ProductProvenance > productProvenanceSharedPtr() const
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_
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
EDProduct const * wrapper() const
static ThreadSafeIndexedRegistry * instance()
Selections const * selections_
int serializeRegistry(SerializeDataBuffer &data_buffer)
static ThreadSafeRegistry * instance()
collection_type & data()
Provide access to the contained collection.
void fillMap(Registry *reg, regmap_type &fillme)
EventAuxiliary const & aux() const