1 | #ifndef MARS_MCorsikaRead
|
---|
2 | #define MARS_MCorsikaRead
|
---|
3 |
|
---|
4 | #ifndef MARS_MRead
|
---|
5 | #include "MRead.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class TList;
|
---|
9 | //class MZlib;
|
---|
10 | class MTaskList;
|
---|
11 |
|
---|
12 | class MCorsikaRunHeader;
|
---|
13 | class MCorsikaEvtHeader;
|
---|
14 | class MPhotonEvent;
|
---|
15 | class MCorsikaFormat;
|
---|
16 |
|
---|
17 | class MCorsikaRead : public MRead
|
---|
18 | {
|
---|
19 | private:
|
---|
20 | MCorsikaRunHeader *fRunHeader; //! run header information container to fill from file
|
---|
21 | MCorsikaEvtHeader *fEvtHeader; //! event header information container to fill from file
|
---|
22 | MPhotonEvent *fEvent; //! event information
|
---|
23 |
|
---|
24 | Bool_t fForceMode; // Force mode skipping defect RUNE
|
---|
25 |
|
---|
26 | TList *fFileNames; // list of file names
|
---|
27 | UInt_t fNumFile; //! number of next file
|
---|
28 | UInt_t fNumEvents; //! input stream (file to read from)
|
---|
29 | UInt_t fNumTotalEvents; //! total number of events in all files
|
---|
30 |
|
---|
31 | ifstream *fIn; //! input stream (file to read from)
|
---|
32 | MCorsikaFormat * fInFormat; //! access to input corsika data
|
---|
33 |
|
---|
34 | MParList *fParList; //! tasklist to call ReInit from
|
---|
35 |
|
---|
36 | //UInt_t fInterleave;
|
---|
37 | //Bool_t fForce;
|
---|
38 |
|
---|
39 | virtual Bool_t OpenStream() { return kTRUE; }
|
---|
40 |
|
---|
41 | Bool_t ReadEvtEnd();
|
---|
42 | Int_t OpenNextFile(Bool_t print=kTRUE);
|
---|
43 | Bool_t CalcNumTotalEvents();
|
---|
44 | Bool_t ReadEvent();
|
---|
45 |
|
---|
46 | Int_t PreProcess(MParList *pList);
|
---|
47 | Int_t Process();
|
---|
48 | Int_t PostProcess();
|
---|
49 |
|
---|
50 | public:
|
---|
51 | MCorsikaRead(const char *filename=NULL, const char *name=NULL, const char *title=NULL);
|
---|
52 | ~MCorsikaRead();
|
---|
53 |
|
---|
54 | //static Byte_t IsFileValid(const char *name);
|
---|
55 |
|
---|
56 | //void SetInterleave(UInt_t i) { fInterleave = i; }
|
---|
57 | void SetForceMode(Bool_t b=kTRUE) { fForceMode=b; }
|
---|
58 |
|
---|
59 | TString GetFullFileName() const;
|
---|
60 |
|
---|
61 | Int_t AddFile(const char *fname, Int_t entries=-1);
|
---|
62 | Bool_t Rewind();
|
---|
63 | UInt_t GetEntries() { return fNumTotalEvents/*/fInterleave*/; }
|
---|
64 |
|
---|
65 | ClassDef(MCorsikaRead, 0) // Task to read the raw data binary file
|
---|
66 | };
|
---|
67 |
|
---|
68 | #endif
|
---|