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

Last change on this file since 19329 was 18562, checked in by tbretz, 8 years ago
Made fParList accessible from MFitsFileRead
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
21protected:
22 MParList *fParList; //! tasklist to call ReInit from
23
24private:
25 UInt_t fInterleave;
26
27 Bool_t fForce;
28
29 virtual std::istream *OpenFile(const char *filename);
30 virtual Bool_t ReadRunHeader(std::istream &fin);
31 virtual Bool_t InitReadData(std::istream &/*fin*/) { return kTRUE; }
32
33 Int_t OpenNextFile(Bool_t print=kTRUE);
34 Bool_t CalcNumTotalEvents();
35
36protected:
37 Int_t PreProcess(MParList *pList);
38 Int_t Process();
39 Int_t PostProcess();
40
41 Bool_t fIsMc;
42
43public:
44 MRawFileRead(const char *filename=NULL, const char *name=NULL, const char *title=NULL);
45 ~MRawFileRead();
46
47 static Byte_t IsFileValid(const char *name);
48
49 void SetInterleave(UInt_t i) { fInterleave = i; }
50 void SetForce(Bool_t b=kTRUE) { fForce=b; }
51
52 TString GetFullFileName() const;
53
54 Int_t AddFile(const char *fname, Int_t entries=-1);
55 Bool_t Rewind();
56 UInt_t GetEntries() { return fNumTotalEvents/fInterleave; }
57
58 const std::istream *GetStream() const { return fIn; }
59
60 ClassDef(MRawFileRead, 0) // Task to read the raw data binary file
61};
62
63#endif
Note: See TracBrowser for help on using the repository browser.