Diana Software
QFileReader.hh
Go to the documentation of this file.
1 
8 #ifndef _Q_FILEREADER_HH_
9 #define _Q_FILEREADER_HH_
10 
11 #include "QReader.hh"
12 #include "QError.hh"
13 #include <string>
14 #include <vector>
15 #include <list>
16 
18 
19 class QFileReader : public QReader
20 {
21  public:
23  QFileReader();
24 
26  virtual ~QFileReader();
27 
32  virtual const QError& JumpToEvent(Long64_t event);
33 
34  void Init(QEventAssembler& eva);
35  bool Do(Diana::QEventAssembler& eva);
36  void Done();
37 
39  unsigned int GetReadNumber() const {return fFileEventNumber > 0 ? (fFileEventNumber-1) : 0;}
40 
41  protected:
43  virtual void Add(const std::string& fileName,QEventAssembler& eva) = 0;
45  virtual void Open(const std::string& fileName,QEventAssembler& eva) = 0;
47  virtual bool Fill(QEventAssembler& eva) = 0;
48  virtual void Close() = 0;
49 
51  std::list<std::string> fFileList;
52 
54  unsigned int fFileEventNumber;
55 
59  std::string fFileListPath;
60 
61  private:
62  std::list<std::string>::const_iterator fFileListIter;
63 
64  friend class QSequence;
65 
66 };
67 
69 
70 #endif
#define Q_END_NAMESPACE
Definition: QDiana.hh:22
#define Q_BEGIN_NAMESPACE
Definition: QDiana.hh:20
error class with error type and description
Definition: QError.hh:115
Visitor class of QEvent that provides full handling of QEvent.
Abstract class for diana readers.
Definition: QFileReader.hh:20
std::list< std::string >::const_iterator fFileListIter
Definition: QFileReader.hh:62
virtual const QError & JumpToEvent(Long64_t event)
Jump to event.
Definition: QFileReader.cc:85
void Init(QEventAssembler &eva)
Init method is called before event loop, getting the QEventAssembler as argument This method must be ...
Definition: QFileReader.cc:16
std::string fFileListPath
file list path
Definition: QFileReader.hh:59
virtual ~QFileReader()
destructor
Definition: QFileReader.cc:12
virtual void Add(const std::string &fileName, QEventAssembler &eva)=0
Add objects to File, called only once in the Init phase.
void Done()
Done method is called after event loop. This method must be implemented by inheriting classes.
Definition: QFileReader.cc:81
unsigned int GetReadNumber() const
Get read number (entry number in file being read, starting from 0)
Definition: QFileReader.hh:39
virtual void Close()=0
virtual void Open(const std::string &fileName, QEventAssembler &eva)=0
Open File.
std::list< std::string > fFileList
list of files
Definition: QFileReader.hh:51
unsigned int fFileEventNumber
last event read
Definition: QFileReader.hh:54
QFileReader()
Mandatory constructor.
Definition: QFileReader.cc:8
virtual bool Fill(QEventAssembler &eva)=0
Fill event, return false when file has no more events.
bool fReadFileList
read file list
Definition: QFileReader.hh:57
bool Do(Diana::QEventAssembler &eva)
Definition: QFileReader.cc:57
Base class for diana event readers.
Definition: QReader.hh:50
Diana Reconstruction program.
Definition: QSequence.hh:40