CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StreamerInputFile.h
Go to the documentation of this file.
1 #ifndef IOPool_Streamer_StreamerInputFile_h
2 #define IOPool_Streamer_StreamerInputFile_h
3 
10 
11 #include <boost/shared_ptr.hpp>
12 
13 #include<string>
14 #include<vector>
15 
16 namespace edm {
17  class EventSkipperByID;
19  public:
20 
22  explicit StreamerInputFile(std::string const& name,
23  boost::shared_ptr<EventSkipperByID> eventSkipperByID = boost::shared_ptr<EventSkipperByID>());
24 
26  explicit StreamerInputFile(std::vector<std::string> const& names,
27  boost::shared_ptr<EventSkipperByID> eventSkipperByID = boost::shared_ptr<EventSkipperByID>());
28 
30 
31  bool next();
33  InitMsgView const* startMessage() const { return startMsg_.get(); }
36  EventMsgView const* currentRecord() const { return currentEvMsg_.get(); }
39  bool eofRecordMessage(uint32 const& hlt_path_cnt, EOFRecordView*&);
42  bool newHeader() { bool tmp = newHeader_; newHeader_ = false; return tmp;}
44  void closeStreamerFile();
46 
47  private:
48 
49  void openStreamerFile(std::string const& name);
50  IOSize readBytes(char* buf, IOSize nBytes);
51  IOOffset skipBytes(IOSize nBytes);
52 
53  void readStartMessage();
54  int readEventMessage();
55 
56  bool openNextFile();
59  bool compareHeader();
60 
61  void logFileAction(char const* msg);
62 
63  boost::shared_ptr<InitMsgView> startMsg_;
64  boost::shared_ptr<EventMsgView> currentEvMsg_;
65 
66  std::vector<char> headerBuf_;
67  std::vector<char> eventBuf_;
69  unsigned int currentFile_;
70  std::vector<std::string> streamerNames_;
74 
75  boost::shared_ptr<EventSkipperByID> eventSkipperByID_;
76 
79 
80  bool newHeader_;
81 
82  boost::shared_ptr<Storage> storage_;
83 
84  bool endOfFile_;
85  };
86 }
87 
88 #endif
std::vector< char > eventBuf_
static const HistoName names[]
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
void closeStreamerFile()
Needs to be public because of forking.
StreamerInputFile(std::string const &name, boost::shared_ptr< EventSkipperByID > eventSkipperByID=boost::shared_ptr< EventSkipperByID >())
boost::shared_ptr< EventMsgView > currentEvMsg_
IOOffset skipBytes(IOSize nBytes)
std::vector< std::string > streamerNames_
bool eofRecordMessage(uint32 const &hlt_path_cnt, EOFRecordView *&)
boost::shared_ptr< Storage > storage_
InitMsgView const * startMessage() const
unsigned int uint32
Definition: MsgTools.h:13
boost::shared_ptr< InitMsgView > startMsg_
void logFileAction(char const *msg)
IOSize readBytes(char *buf, IOSize nBytes)
int64_t IOOffset
Definition: IOTypes.h:19
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
EventMsgView const * currentRecord() const
std::vector< char > headerBuf_
size_t IOSize
Definition: IOTypes.h:14
void openStreamerFile(std::string const &name)