CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::StreamerInputFile Class Reference

#include <StreamerInputFile.h>

Public Member Functions

void closeStreamerFile ()
 Needs to be public because of forking. More...
 
EventMsgView const * currentRecord () const
 
bool newHeader ()
 
bool next ()
 
InitMsgView const * startMessage () const
 
 StreamerInputFile (std::string const &name, std::shared_ptr< EventSkipperByID > eventSkipperByID=std::shared_ptr< EventSkipperByID >())
 
 StreamerInputFile (std::vector< std::string > const &names, std::shared_ptr< EventSkipperByID > eventSkipperByID=std::shared_ptr< EventSkipperByID >())
 
 ~StreamerInputFile ()
 

Private Member Functions

bool compareHeader ()
 
void logFileAction (char const *msg)
 
bool openNextFile ()
 
void openStreamerFile (std::string const &name)
 
IOSize readBytes (char *buf, IOSize nBytes)
 
int readEventMessage ()
 
void readStartMessage ()
 
IOOffset skipBytes (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< Storage > > 
storage_
 
std::vector< std::string > streamerNames_
 

Detailed Description

Definition at line 18 of file StreamerInputFile.h.

Constructor & Destructor Documentation

edm::StreamerInputFile::StreamerInputFile ( std::string const &  name,
std::shared_ptr< EventSkipperByID eventSkipperByID = std::shared_ptr<EventSkipperByID>() 
)
explicit

Reads a Streamer file

Definition at line 22 of file StreamerInputFile.cc.

edm::StreamerInputFile::StreamerInputFile ( std::vector< std::string > const &  names,
std::shared_ptr< EventSkipperByID eventSkipperByID = std::shared_ptr<EventSkipperByID>() 
)
explicit

Multiple Streamer files

Definition at line 43 of file StreamerInputFile.cc.

edm::StreamerInputFile::~StreamerInputFile ( )

Definition at line 18 of file StreamerInputFile.cc.

Member Function Documentation

void edm::StreamerInputFile::closeStreamerFile ( )

Needs to be public because of forking.

Test bit if a new header is encountered

Definition at line 97 of file StreamerInputFile.cc.

bool edm::StreamerInputFile::compareHeader ( )
private

Compares current File header with the newly opened file header Returns false in case of mismatch

Definition at line 206 of file StreamerInputFile.cc.

EventMsgView const* edm::StreamerInputFile::currentRecord ( ) const
inline

Points to File Start Header/Message

Definition at line 36 of file StreamerInputFile.h.

References currentEvMsg_, and edm::propagate_const< T >::get().

36 { return currentEvMsg_.get(); }
element_type const * get() const
edm::propagate_const< std::shared_ptr< EventMsgView > > currentEvMsg_
void edm::StreamerInputFile::logFileAction ( char const *  msg)
private

Definition at line 285 of file StreamerInputFile.cc.

bool edm::StreamerInputFile::newHeader ( )
inline

Points to current Record

Definition at line 39 of file StreamerInputFile.h.

References newHeader_, and tmp.

39 { bool tmp = newHeader_; newHeader_ = false; return tmp;}
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool edm::StreamerInputFile::next ( void  )

Definition at line 168 of file StreamerInputFile.cc.

bool edm::StreamerInputFile::openNextFile ( )
private

Definition at line 184 of file StreamerInputFile.cc.

void edm::StreamerInputFile::openStreamerFile ( std::string const &  name)
private

Definition at line 67 of file StreamerInputFile.cc.

IOSize edm::StreamerInputFile::readBytes ( char *  buf,
IOSize  nBytes 
)
private

Definition at line 105 of file StreamerInputFile.cc.

int edm::StreamerInputFile::readEventMessage ( )
private

Definition at line 224 of file StreamerInputFile.cc.

void edm::StreamerInputFile::readStartMessage ( )
private

Not an init message should return

Definition at line 133 of file StreamerInputFile.cc.

IOOffset edm::StreamerInputFile::skipBytes ( IOSize  nBytes)
private

Definition at line 118 of file StreamerInputFile.cc.

InitMsgView const* edm::StreamerInputFile::startMessage ( ) const
inline

Moves the handler to next Event Record

Definition at line 33 of file StreamerInputFile.h.

References edm::propagate_const< T >::get(), and startMsg_.

33 { return startMsg_.get(); }
element_type const * get() const
edm::propagate_const< std::shared_ptr< InitMsgView > > startMsg_

Member Data Documentation

edm::propagate_const<std::shared_ptr<EventMsgView> > edm::StreamerInputFile::currentEvMsg_
private

Definition at line 61 of file StreamerInputFile.h.

Referenced by currentRecord().

unsigned int edm::StreamerInputFile::currentFile_
private

Buffer to store Event Data

Definition at line 66 of file StreamerInputFile.h.

std::string edm::StreamerInputFile::currentFileName_
private

True if Multiple Streams are Read

Definition at line 69 of file StreamerInputFile.h.

bool edm::StreamerInputFile::currentFileOpen_
private

Definition at line 70 of file StreamerInputFile.h.

uint32 edm::StreamerInputFile::currProto_
private

Definition at line 75 of file StreamerInputFile.h.

uint32 edm::StreamerInputFile::currRun_
private

Definition at line 74 of file StreamerInputFile.h.

bool edm::StreamerInputFile::endOfFile_
private

Definition at line 81 of file StreamerInputFile.h.

std::vector<char> edm::StreamerInputFile::eventBuf_
private

Buffer to store file Header

Definition at line 64 of file StreamerInputFile.h.

edm::propagate_const<std::shared_ptr<EventSkipperByID> > edm::StreamerInputFile::eventSkipperByID_
private

Definition at line 72 of file StreamerInputFile.h.

std::vector<char> edm::StreamerInputFile::headerBuf_
private

Definition at line 63 of file StreamerInputFile.h.

bool edm::StreamerInputFile::multiStreams_
private

names of Streamer files

Definition at line 68 of file StreamerInputFile.h.

bool edm::StreamerInputFile::newHeader_
private

Definition at line 77 of file StreamerInputFile.h.

Referenced by newHeader().

edm::propagate_const<std::shared_ptr<InitMsgView> > edm::StreamerInputFile::startMsg_
private

Definition at line 60 of file StreamerInputFile.h.

Referenced by startMessage().

edm::propagate_const<std::unique_ptr<Storage> > edm::StreamerInputFile::storage_
private

Definition at line 79 of file StreamerInputFile.h.

std::vector<std::string> edm::StreamerInputFile::streamerNames_
private

keeps track of which file is in use at the moment

Definition at line 67 of file StreamerInputFile.h.