23 std::shared_ptr<EventSkipperByID> eventSkipperByID,
24 unsigned int prefetchMBytes)
27 headerBuf_(1000 * 1000),
28 eventBuf_(1000 * 1000 * 7),
29 tempBuf_(1024 * 1024 * prefetchMBytes),
34 currentFileOpen_(
false),
35 eventSkipperByID_(eventSkipperByID),
46 std::shared_ptr<EventSkipperByID> eventSkipperByID,
47 unsigned int prefetchMBytes)
51 std::shared_ptr<EventSkipperByID> eventSkipperByID,
52 unsigned int prefetchMBytes)
55 headerBuf_(1000 * 1000),
56 eventBuf_(1000 * 1000 * 7),
57 tempBuf_(1024 * 1024 * prefetchMBytes),
59 streamerNames_(
names),
62 currentFileOpen_(
false),
63 eventSkipperByID_(eventSkipperByID),
83 throw cms::Exception(
"LogicalFileNameNotFound",
"StreamerInputFile::openStreamerFile()\n")
84 <<
"Logical file name '" << LFN <<
"' was not found in the file catalog.\n" 85 <<
"If you wanted a local file, you forgot the 'file:' prefix\n" 86 <<
"before the file name in your configuration file.\n";
99 ex.
addContext(
"Calling StreamerInputFile::openStreamerFile()");
101 ex <<
"Error Opening Streamer Input File: " <<
name <<
"\n";
106 <<
"Error Opening Streamer Input File, file does not exist: " <<
name <<
"\n";
123 unsigned int skippedHdr) {
127 char* ptr =
buf - skippedHdr;
135 return std::pair<storage::IOSize, char*>(0, ptr);
139 if (!zeroCopy || skippedHdr >
tempPos_) {
153 char* tmpPtr =
buf + len;
154 n = len +
readBytes(tmpPtr, nBytes - len,
false).first;
160 ex.
addContext(
"Calling StreamerInputFile::readBytes()");
163 return std::pair<storage::IOSize, char*>(
n, ptr);
174 ex.
addContext(
"Calling StreamerInputFile::skipBytes()");
186 <<
"Failed reading streamer file, first read in readStartMessage\n";
196 <<
"Expecting an init Message at start of file\n";
199 headerSize = head.
size();
208 if (
res.first != nWant) {
210 <<
"Failed reading streamer file, second read in readStartMessage\n";
215 <<
"Failed reading streamer file, init header size from data too small\n";
243 FDEBUG(10) <<
"Comparing Header" << std::endl;
261 <<
"\nhas different run number or protocol version than previous\n";
272 bool eventRead =
false;
283 <<
"Failed reading streamer file, first read in readEventMessage\n" 284 <<
"Requested " << nWant <<
" bytes, read function returned " << nGot <<
" bytes\n";
294 <<
"Failed reading streamer file, unknown code in event header\n" 295 <<
"code = " << code <<
"\n";
297 eventSize = head.
size();
301 <<
"Failed reading streamer file, event header size from data too small\n";
316 if (
res.first != nWant) {
318 <<
"Failed reading streamer file, second read in readEventMessage\n" 319 <<
"Requested " << nWant <<
" bytes, read function returned " <<
res.first <<
" bytes\n";
322 std::make_shared<EventMsgView>((
void*)
res.second);
327 <<
"Failed reading streamer file, skip event in readEventMessage\n" 328 <<
"Requested " << nWant <<
" bytes skipped, seek function returned " << nGot <<
" bytes\n";
const std::string names[nVars_]
void addContext(std::string const &context)
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts, bool iVerbose)
Log< level::System, true > LogAbsolute