57 adjustEventToNewProductRegistry_(
false) {
63 std::unique_ptr<FileBlock>
65 return std::unique_ptr<FileBlock>(
new FileBlock);
73 FDEBUG(6) <<
"mergeIntoRegistry: Product List: " << std::endl;
80 if (!mergeInfo.empty()) {
81 throw cms::Exception(
"MismatchedInput",
"RootInputFileSequence::previousEvent()") << mergeInfo;
96 SendDescs::const_iterator
i(descs.begin()),
e(descs.end());
101 FDEBUG(6) <<
"declare: " << real_name << std::endl;
109 SendDescs::const_iterator
i(descs.begin()),
e(descs.end());
114 FDEBUG(6) <<
"BuildReadData: " << real_name << std::endl;
123 std::auto_ptr<SendJobHeader>
126 throw cms::Exception(
"StreamTranslation",
"Registry deserialization error")
127 <<
"received wrong message type: expected INIT, got "
128 << initView.
code() <<
"\n";
136 FDEBUG(10) <<
"StreamerInputSource::deserializeRegistry processName = "<<
processName_<< std::endl;
137 FDEBUG(10) <<
"StreamerInputSource::deserializeRegistry protocolVersion_= "<<
protocolVersion_<< std::endl;
146 std::cerr <<
"Error from StreamerInputSource: checksum of Init registry blob failed "
147 <<
" chksum from registry data = " << adler32_chksum <<
" from header = "
154 TBufferFile xbuf(TBuffer::kRead, initView.
descLength(),
157 std::auto_ptr<SendJobHeader>
sd((
SendJobHeader*)xbuf.ReadObjectAny(desc));
160 throw cms::Exception(
"StreamTranslation",
"Registry deserialization error")
161 <<
"Could not read the initial product registry list\n";
181 for (SendJobHeader::ParameterSetMap::const_iterator
i = psetMap.begin(), iEnd = psetMap.end();
i != iEnd; ++
i) {
187 for (ProcessConfigurationVector::const_iterator it = pcv.begin(), itEnd = pcv.end(); it != itEnd; ++it) {
198 throw cms::Exception(
"StreamTranslation",
"Event deserialization error")
199 <<
"received wrong message type: expected EVENT, got "
200 << eventView.
code() <<
"\n";
201 FDEBUG(9) <<
"Decode event: "
202 << eventView.
event() <<
" "
203 << eventView.
run() <<
" "
204 << eventView.
size() <<
" "
214 unsigned long dest_size;
221 std::cerr <<
"Error from StreamerInputSource: checksum of event data blob failed "
222 <<
" chksum from event = " << adler32_chksum <<
" from header = "
226 if(origsize != 78 && origsize != 0) {
233 dest_.resize(dest_size);
234 unsigned char*
pos = (
unsigned char*) &
dest_[0];
235 unsigned char* from = (
unsigned char*) eventView.
eventData();
251 throw cms::Exception(
"StreamTranslation",
"Event deserialization error")
252 <<
"got a null event from input stream\n";
289 for(SendProds::iterator spi = sps.begin(), spe = sps.end(); spi != spe; ++spi) {
290 FDEBUG(10) <<
"check prodpair" << std::endl;
294 <<
" " << spi->desc()->className()
295 <<
" " << spi->desc()->productInstanceName()
296 <<
" " << spi->desc()->branchID()
303 if(spi->prod() != 0) {
304 FDEBUG(10) <<
"addproduct next " << spi->branchID() << std::endl;
305 eventPrincipal.
putOnRead(branchDesc, spi->prod(), productProvenance);
306 FDEBUG(10) <<
"addproduct done" << std::endl;
308 FDEBUG(10) <<
"addproduct empty next " << spi->branchID() << std::endl;
309 eventPrincipal.
putOnRead(branchDesc, spi->prod(), productProvenance);
310 FDEBUG(10) <<
"addproduct empty done" << std::endl;
315 FDEBUG(10) <<
"Size = " << eventPrincipal.
size() << std::endl;
317 return &eventPrincipal;
330 unsigned int inputSize,
331 std::vector<unsigned char>& outputBuffer,
332 unsigned int expectedFullSize) {
333 unsigned long origSize = expectedFullSize;
334 unsigned long uncompressedSize = expectedFullSize*1.1;
335 FDEBUG(1) <<
"Uncompress: original size = " << origSize
336 <<
", compressed size = " << inputSize
338 outputBuffer.resize(uncompressedSize);
339 int ret = uncompress(&outputBuffer[0], &uncompressedSize,
340 inputBuffer, inputSize);
344 FDEBUG(10) <<
" original size = " << origSize <<
" final size = "
345 << uncompressedSize << std::endl;
346 if(origSize != uncompressedSize) {
347 std::cerr <<
"deserializeEvent: Problem with uncompress, original size = "
348 << origSize <<
" uncompress size = " << uncompressedSize << std::endl;
350 throw cms::Exception(
"StreamDeserialization",
"Uncompression error")
351 <<
"mismatch event lengths should be" << origSize <<
" got "
352 << uncompressedSize <<
"\n";
356 std::cerr <<
"deserializeEvent: Problem with uncompress, return value = "
358 throw cms::Exception(
"StreamDeserialization",
"Uncompression error")
359 <<
"Error code = " << ret <<
"\n ";
361 return (
unsigned int) uncompressedSize;
377 <<
"StreamerInputSource::setRun()\n"
378 <<
"Run number cannot be modified for this type of Input Source\n"
379 <<
"Contact a Storage Manager Developer\n";
388 return eventPrincipal_ ? eventPrincipal_->getIt(
id) :
WrapperHolder();
393 eventPrincipal_ = ep;
void fillEventPrincipal(EventAuxiliary const &aux, boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs=boost::shared_ptr< EventSelectionIDVector >(), boost::shared_ptr< BranchListIndexes > branchListIndexes=boost::shared_ptr< BranchListIndexes >(), boost::shared_ptr< BranchMapper > mapper=boost::shared_ptr< BranchMapper >(new BranchMapper), DelayedReader *reader=0)
const uint8 * eventData() const
const uint8 * descData() const
static ThreadSafeRegistry * instance()
std::string hostName() const
std::vector< BranchDescription > SendDescs
void doBuildRealData(const std::string &name)
void setRefCoreStreamer(bool resetAll=false)
std::string merge(ProductRegistry const &other, std::string const &fileName, BranchDescription::MatchMode parametersMustMatch=BranchDescription::Permissive, BranchDescription::MatchMode branchesMustMatch=BranchDescription::Permissive)
bool insertMapped(value_type const &v)
TClass * getTClass(const std::type_info &ti)
void fillProductRegistryTransients(std::vector< ProcessConfiguration > const &pcVec, ProductRegistry const &preg, bool okToRegister=false)
std::vector< EventSelectionID > EventSelectionIDVector
void setID(ParameterSetID const &id) const
uint32 adler32_chksum() const
ProcessConfigurationRegistry::vector_type ProcessConfigurationVector
uint32 eventLength() const
uint32 adler32_chksum() const
std::vector< BranchListIndex > BranchListIndexes
std::string hostName() const
void setProcessHistoryID(ProcessHistoryID const &phid)
std::vector< StreamedProduct > SendProds
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
uint32 protocolVersion() const
static Timestamp const & invalidTimestamp()
std::string wrappedClassName(std::string const &iFullName)
void putOnRead(ConstBranchDescription const &bd, void const *product, ProductProvenance const &productProvenance)
uint32 origDataSize() const
bool updateFromInput(BranchIDLists const &bidlists)
bool adjustToNewProductRegistry(ProductRegistry const ®)
std::string processName() const
void updateFromInput(ProductList const &other)
void setProcessHistoryID(ProcessHistoryID const &phid)
void adjustIndexesAfterProductRegistryAddition()
uint32 descLength() const
void loadCap(const std::string &name)