55 inputFileTransitionsEachEvent_(
56 pset.getUntrackedParameter<bool>(
"inputFileTransitionsEachEvent",
false)),
63 runEndingFlag_(
false),
70 boost::shared_ptr<FileBlock>
72 return boost::shared_ptr<FileBlock>(
new FileBlock);
80 FDEBUG(6) <<
"mergeIntoRegistry: Product List: " << std::endl;
87 if (!mergeInfo.empty()) {
88 throw cms::Exception(
"MismatchedInput",
"RootInputFileSequence::previousEvent()") << mergeInfo;
103 SendDescs::const_iterator
i(descs.begin()),
e(descs.end());
108 FDEBUG(6) <<
"declare: " << real_name << std::endl;
116 SendDescs::const_iterator
i(descs.begin()),
e(descs.end());
121 FDEBUG(6) <<
"BuildReadData: " << real_name << std::endl;
126 boost::shared_ptr<RunAuxiliary>
134 boost::shared_ptr<LuminosityBlockAuxiliary>
192 std::auto_ptr<SendJobHeader>
195 throw cms::Exception(
"StreamTranslation",
"Registry deserialization error")
196 <<
"received wrong message type: expected INIT, got "
197 << initView.
code() <<
"\n";
205 FDEBUG(10) <<
"StreamerInputSource::deserializeRegistry processName = "<<
processName_<< std::endl;
206 FDEBUG(10) <<
"StreamerInputSource::deserializeRegistry protocolVersion_= "<<
protocolVersion_<< std::endl;
215 std::cerr <<
"Error from StreamerInputSource: checksum of Init registry blob failed "
216 <<
" chksum from registry data = " << adler32_chksum <<
" from header = "
223 TBufferFile xbuf(TBuffer::kRead, initView.
descLength(),
226 std::auto_ptr<SendJobHeader>
sd((
SendJobHeader*)xbuf.ReadObjectAny(desc));
229 throw cms::Exception(
"StreamTranslation",
"Registry deserialization error")
230 <<
"Could not read the initial product registry list\n";
250 for (SendJobHeader::ParameterSetMap::const_iterator
i = psetMap.begin(), iEnd = psetMap.end();
i != iEnd; ++
i) {
256 for (ProcessConfigurationVector::const_iterator it = pcv.begin(), itEnd = pcv.end(); it != itEnd; ++it) {
267 throw cms::Exception(
"StreamTranslation",
"Event deserialization error")
268 <<
"received wrong message type: expected EVENT, got "
269 << eventView.
code() <<
"\n";
270 FDEBUG(9) <<
"Decode event: "
271 << eventView.
event() <<
" "
272 << eventView.
run() <<
" "
273 << eventView.
size() <<
" "
283 unsigned long dest_size;
290 std::cerr <<
"Error from StreamerInputSource: checksum of event data blob failed "
291 <<
" chksum from event = " << adler32_chksum <<
" from header = "
295 if(origsize != 78 && origsize != 0) {
302 dest_.resize(dest_size);
303 unsigned char*
pos = (
unsigned char*) &
dest_[0];
304 unsigned char*
from = (
unsigned char*) eventView.
eventData();
320 throw cms::Exception(
"StreamTranslation",
"Event deserialization error")
321 <<
"got a null event from input stream\n";
325 FDEBUG(5) <<
"Got event: " <<
sd->aux().id() <<
" " <<
sd->products().size() << std::endl;
342 boost::shared_ptr<BranchListIndexes> indexes(
new BranchListIndexes(
sd->branchListIndexes()));
351 for(SendProds::iterator spi = sps.begin(), spe = sps.end(); spi != spe; ++spi) {
352 FDEBUG(10) <<
"check prodpair" << std::endl;
356 <<
" " << spi->desc()->className()
357 <<
" " << spi->desc()->productInstanceName()
358 <<
" " << spi->desc()->branchID()
365 if(spi->prod() != 0) {
366 FDEBUG(10) <<
"addgroup next " << spi->branchID() << std::endl;
368 FDEBUG(10) <<
"addgroup done" << std::endl;
370 FDEBUG(10) <<
"addgroup empty next " << spi->branchID() << std::endl;
372 FDEBUG(10) <<
"addgroup empty done" << std::endl;
392 unsigned int inputSize,
393 std::vector<unsigned char>& outputBuffer,
394 unsigned int expectedFullSize) {
395 unsigned long origSize = expectedFullSize;
396 unsigned long uncompressedSize = expectedFullSize*1.1;
397 FDEBUG(1) <<
"Uncompress: original size = " << origSize
398 <<
", compressed size = " << inputSize
400 outputBuffer.resize(uncompressedSize);
401 int ret = uncompress(&outputBuffer[0], &uncompressedSize,
402 inputBuffer, inputSize);
406 FDEBUG(10) <<
" original size = " << origSize <<
" final size = "
407 << uncompressedSize << std::endl;
408 if(origSize != uncompressedSize) {
409 std::cerr <<
"deserializeEvent: Problem with uncompress, original size = "
410 << origSize <<
" uncompress size = " << uncompressedSize << std::endl;
412 throw cms::Exception(
"StreamDeserialization",
"Uncompression error")
413 <<
"mismatch event lengths should be" << origSize <<
" got "
414 << uncompressedSize <<
"\n";
418 std::cerr <<
"deserializeEvent: Problem with uncompress, return value = "
420 throw cms::Exception(
"StreamDeserialization",
"Uncompression error")
421 <<
"Error code = " << ret <<
"\n ";
423 return (
unsigned int) uncompressedSize;
441 <<
"StreamerInputSource::setRun()\n"
442 <<
"Run number cannot be modified for this type of Input Source\n"
443 <<
"Contact a Storage Manager Developer\n";
452 return eventPrincipal_ ? eventPrincipal_->getIt(
id) :
WrapperHolder();
457 eventPrincipal_ = ep;
void setLuminosityBlockPrincipal(boost::shared_ptr< LuminosityBlockPrincipal > const &lbp)
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)
static bool updateFromInput(BranchIDLists const &bidlists, std::string const &fileName)
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)
static void fixBranchListIndexes(BranchListIndexes &indexes)
std::vector< EventSelectionID > EventSelectionIDVector
void setID(ParameterSetID const &id) const
uint32 adler32_chksum() const
ProcessConfigurationRegistry::vector_type ProcessConfigurationVector
uint32 eventLength() const
void adjustEventToNewProductRegistry(boost::shared_ptr< ProductRegistry const > reg)
uint32 adler32_chksum() const
std::vector< BranchListIndex > BranchListIndexes
std::string hostName() const
void setProcessHistoryID(ProcessHistoryID const &phid)
std::vector< StreamedProduct > SendProds
void fillEventPrincipal(EventAuxiliary const &aux, boost::shared_ptr< LuminosityBlockPrincipal > lbp, 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)
static std::string from(" from ")
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
author Stefano ARGIRO author Bill Tanenbaum
std::string processName() const
void updateFromInput(ProductList const &other)
void setProcessHistoryID(ProcessHistoryID const &phid)
uint32 descLength() const
void loadCap(const std::string &name)