#include <StreamerInputFile.h>
Public Types | |
enum | Next { Next::kEvent, Next::kFile, Next::kStop } |
Public Member Functions | |
void | closeStreamerFile () |
EventMsgView const * | currentRecord () const |
bool | newHeader () |
Next | next () |
bool | openNextFile () |
InitMsgView const * | startMessage () const |
StreamerInputFile (std::string const &name, std::string const &LFN, std::shared_ptr< EventSkipperByID > eventSkipperByID=std::shared_ptr< EventSkipperByID >(), unsigned int prefetchMBytes=0) | |
StreamerInputFile (std::string const &name, std::shared_ptr< EventSkipperByID > eventSkipperByID=std::shared_ptr< EventSkipperByID >(), unsigned int prefetchMBytes=0) | |
StreamerInputFile (std::vector< FileCatalogItem > const &names, std::shared_ptr< EventSkipperByID > eventSkipperByID=std::shared_ptr< EventSkipperByID >(), unsigned int prefetchMBytes=0) | |
~StreamerInputFile () | |
Private Member Functions | |
bool | compareHeader () |
void | logFileAction (char const *msg) |
void | openStreamerFile (std::string const &name, std::string const &LFN) |
std::pair< storage::IOSize, char * > | readBytes (char *buf, storage::IOSize nBytes, bool zeroCopy, unsigned int skippedHdr=0) |
int | readEventMessage () |
void | readStartMessage () |
storage::IOOffset | skipBytes (storage::IOSize nBytes) |
Private Attributes | |
edm::propagate_const< std::shared_ptr< EventMsgView > > | currentEvMsg_ |
unsigned int | currentFile_ |
std::string | currentFileName_ |
bool | currentFileOpen_ |
uint32 | currProto_ |
uint32 | currRun_ |
bool | endOfFile_ |
std::vector< char > | eventBuf_ |
edm::propagate_const< std::shared_ptr< EventSkipperByID > > | eventSkipperByID_ |
std::vector< char > | headerBuf_ |
bool | multiStreams_ |
bool | newHeader_ |
edm::propagate_const< std::shared_ptr< InitMsgView > > | startMsg_ |
edm::propagate_const< std::unique_ptr< edm::storage::Storage > > | storage_ |
std::vector< FileCatalogItem > | streamerNames_ |
std::vector< char > | tempBuf_ |
unsigned int | tempLen_ = 0 |
unsigned int | tempPos_ = 0 |
Definition at line 19 of file StreamerInputFile.h.
|
strong |
|
explicit |
Reads a Streamer file
Definition at line 21 of file StreamerInputFile.cc.
References Skims_PA_cff::name, openStreamerFile(), and readStartMessage().
|
explicit |
Definition at line 45 of file StreamerInputFile.cc.
|
explicit |
Multiple Streamer files
Definition at line 50 of file StreamerInputFile.cc.
References currentFile_, currProto_, currRun_, names, openStreamerFile(), readStartMessage(), and startMsg_.
edm::StreamerInputFile::~StreamerInputFile | ( | ) |
Definition at line 19 of file StreamerInputFile.cc.
References closeStreamerFile().
void edm::StreamerInputFile::closeStreamerFile | ( | ) |
Test bit if a new header is encountered
Definition at line 112 of file StreamerInputFile.cc.
References currentFileOpen_, logFileAction(), and storage_.
Referenced by openStreamerFile(), and ~StreamerInputFile().
|
private |
Compares current File header with the newly opened file header Returns false in case of mismatch
Definition at line 253 of file StreamerInputFile.cc.
References currentFile_, currProto_, currRun_, Exception, edm::errors::MismatchedInputFiles, readStartMessage(), startMsg_, and streamerNames_.
Referenced by openNextFile().
|
inline |
Points to File Start Header/Message
Definition at line 43 of file StreamerInputFile.h.
References currentEvMsg_, and edm::propagate_const< T >::get().
|
private |
Definition at line 335 of file StreamerInputFile.cc.
References currentFileName_, edm::FlushMessageLog(), and mps_check::msg.
Referenced by closeStreamerFile(), and openStreamerFile().
|
inline |
Points to current Record
Definition at line 46 of file StreamerInputFile.h.
References newHeader_, and createJobs::tmp.
StreamerInputFile::Next edm::StreamerInputFile::next | ( | void | ) |
Definition at line 219 of file StreamerInputFile.cc.
References currentFile_, kEvent, kFile, kStop, multiStreams_, newHeader_, readEventMessage(), and streamerNames_.
bool edm::StreamerInputFile::openNextFile | ( | ) |
Definition at line 233 of file StreamerInputFile.cc.
References compareHeader(), currentFile_, endOfFile_, FDEBUG, openStreamerFile(), startMsg_, and streamerNames_.
|
private |
Definition at line 75 of file StreamerInputFile.cc.
References cms::Exception::addContext(), edm::check(), cms::Exception::clearMessage(), closeStreamerFile(), currentFileName_, currentFileOpen_, MillePedeFileConverter_cfg::e, Exception, edm::errors::FileOpenError, get, logFileAction(), Skims_PA_cff::name, edm::storage::IOFlags::OpenRead, findQualityFiles::size, and storage_.
Referenced by openNextFile(), and StreamerInputFile().
|
private |
Definition at line 120 of file StreamerInputFile.cc.
References cms::Exception::addContext(), visDQMUpload::buf, edm::errors::FileReadError, dqmiodumpmetadata::n, storage_, tempBuf_, tempLen_, and tempPos_.
Referenced by readEventMessage(), and readStartMessage().
|
private |
Definition at line 267 of file StreamerInputFile.cc.
References HeaderView::code(), convert32(), convert64(), currentEvMsg_, endOfFile_, Header::EVENT, EventHeader::event_, eventBuf_, eventSkipperByID_, Exception, edm::errors::FileReadError, EventHeader::lumi_, readBytes(), EventHeader::run_, HeaderView::size(), and skipBytes().
Referenced by next().
|
private |
Not an init message should return
Definition at line 180 of file StreamerInputFile.cc.
References HeaderView::code(), Exception, edm::errors::FileReadError, headerBuf_, Header::INIT, readBytes(), HeaderView::size(), and startMsg_.
Referenced by compareHeader(), and StreamerInputFile().
|
private |
Definition at line 166 of file StreamerInputFile.cc.
References cms::Exception::addContext(), edm::storage::Storage::CURRENT, edm::errors::FileReadError, dqmiodumpmetadata::n, and storage_.
Referenced by readEventMessage().
|
inline |
Moves the handler to next Event Record
Definition at line 40 of file StreamerInputFile.h.
References edm::propagate_const< T >::get(), and startMsg_.
|
private |
Definition at line 73 of file StreamerInputFile.h.
Referenced by currentRecord(), and readEventMessage().
|
private |
Definition at line 82 of file StreamerInputFile.h.
Referenced by compareHeader(), next(), openNextFile(), and StreamerInputFile().
|
private |
True if Multiple Streams are Read
Definition at line 85 of file StreamerInputFile.h.
Referenced by logFileAction(), and openStreamerFile().
|
private |
Definition at line 86 of file StreamerInputFile.h.
Referenced by closeStreamerFile(), and openStreamerFile().
|
private |
Definition at line 91 of file StreamerInputFile.h.
Referenced by compareHeader(), and StreamerInputFile().
|
private |
Definition at line 90 of file StreamerInputFile.h.
Referenced by compareHeader(), and StreamerInputFile().
|
private |
Definition at line 97 of file StreamerInputFile.h.
Referenced by openNextFile(), and readEventMessage().
|
private |
Buffer to store file Header
Definition at line 76 of file StreamerInputFile.h.
Referenced by readEventMessage().
|
private |
Definition at line 88 of file StreamerInputFile.h.
Referenced by readEventMessage().
|
private |
Definition at line 75 of file StreamerInputFile.h.
Referenced by readStartMessage().
|
private |
|
private |
Definition at line 93 of file StreamerInputFile.h.
Referenced by newHeader(), and next().
|
private |
Definition at line 72 of file StreamerInputFile.h.
Referenced by compareHeader(), openNextFile(), readStartMessage(), startMessage(), and StreamerInputFile().
|
private |
Definition at line 95 of file StreamerInputFile.h.
Referenced by closeStreamerFile(), openStreamerFile(), readBytes(), and skipBytes().
|
private |
keeps track of which file is in use at the moment
Definition at line 83 of file StreamerInputFile.h.
Referenced by compareHeader(), next(), and openNextFile().
|
private |
Buffer to store Event Data
Definition at line 78 of file StreamerInputFile.h.
Referenced by readBytes().
|
private |
Buffer to store prefetched bytes
Definition at line 79 of file StreamerInputFile.h.
Referenced by readBytes().
|
private |
Definition at line 80 of file StreamerInputFile.h.
Referenced by readBytes().