source: trunk/Mars/mraw/MRawFileRead.h@ 11431

Last change on this file since 11431 was 11431, checked in by tbretz, 13 years ago
Outsourced OpenFile and ReadRunHeader to their own funtions.
File size: 1.4 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 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 istream *OpenFile(const char *filename);
28 virtual Bool_t ReadRunHeader(istream &fin);
29
30 Int_t OpenNextFile(Bool_t print=kTRUE);
31 Bool_t CalcNumTotalEvents();
32
33 Int_t PreProcess(MParList *pList);
34 Int_t Process();
35 Int_t PostProcess();
36
37public:
38 MRawFileRead(const char *filename=NULL, const char *name=NULL, const char *title=NULL);
39 ~MRawFileRead();
40
41 static Byte_t IsFileValid(const char *name);
42
43 void SetInterleave(UInt_t i) { fInterleave = i; }
44 void SetForce(Bool_t b=kTRUE) { fForce=b; }
45
46 TString GetFullFileName() const;
47
48 Int_t AddFile(const char *fname, Int_t entries=-1);
49 Bool_t Rewind();
50 UInt_t GetEntries() { return fNumTotalEvents/fInterleave; }
51
52 ClassDef(MRawFileRead, 0) // Task to read the raw data binary file
53};
54
55#endif
Note: See TracBrowser for help on using the repository browser.