source: branches/Mars_use_drstimefiles/mraw/MRawFileRead.h@ 18066

Last change on this file since 18066 was 17780, checked in by tbretz, 11 years ago
Added a possibility to access the stream in a constant manner.
File size: 1.6 KB
Line 
1#ifndef MARS_MRawFileRead
2#define MARS_MRawFileRead
3
4#ifndef MARS_MRawRead
5#include "MRawRead.h"
6#endif
7
8class TList;
9class MTaskList;
10
11class MRawFileRead : public MRawRead
12{
13private:
14 TList *fFileNames; // list of file names
15 UInt_t fNumFile; //! number of next file
16 UInt_t fNumEvents; //! input stream (file to read from)
17 UInt_t fNumTotalEvents; //! total number of events in all files
18
19 std::istream *fIn; //! input stream (file to read from)
20
21 MParList *fParList; //! tasklist to call ReInit from
22
23 UInt_t fInterleave;
24
25 Bool_t fForce;
26
27 virtual std::istream *OpenFile(const char *filename);
28 virtual Bool_t ReadRunHeader(std::istream &fin);
29 virtual Bool_t InitReadData(std::istream &/*fin*/) { return kTRUE; }
30
31 Int_t OpenNextFile(Bool_t print=kTRUE);
32 Bool_t CalcNumTotalEvents();
33
34protected:
35 Int_t PreProcess(MParList *pList);
36 Int_t Process();
37 Int_t PostProcess();
38
39 Bool_t fIsMc;
40
41public:
42 MRawFileRead(const char *filename=NULL, const char *name=NULL, const char *title=NULL);
43 ~MRawFileRead();
44
45 static Byte_t IsFileValid(const char *name);
46
47 void SetInterleave(UInt_t i) { fInterleave = i; }
48 void SetForce(Bool_t b=kTRUE) { fForce=b; }
49
50 TString GetFullFileName() const;
51
52 Int_t AddFile(const char *fname, Int_t entries=-1);
53 Bool_t Rewind();
54 UInt_t GetEntries() { return fNumTotalEvents/fInterleave; }
55
56 const std::istream *GetStream() const { return fIn; }
57
58 ClassDef(MRawFileRead, 0) // Task to read the raw data binary file
59};
60
61#endif
Note: See TracBrowser for help on using the repository browser.