1 | #ifndef MARS_MCorsikaRead
|
---|
2 | #define MARS_MCorsikaRead
|
---|
3 |
|
---|
4 | #ifndef MARS_MRead
|
---|
5 | #include "MRead.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef ROOT_TArrayF
|
---|
9 | #include <TArrayF.h>
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | class TList;
|
---|
13 | //class MZlib;
|
---|
14 | class MTaskList;
|
---|
15 |
|
---|
16 | class MCorsikaRunHeader;
|
---|
17 | class MCorsikaEvtHeader;
|
---|
18 | class MPhotonEvent;
|
---|
19 | class MCorsikaFormat;
|
---|
20 |
|
---|
21 | class MCorsikaRead : public MRead
|
---|
22 | {
|
---|
23 | private:
|
---|
24 | MCorsikaRunHeader *fRunHeader; //! run header information container to fill from file
|
---|
25 | MCorsikaEvtHeader *fEvtHeader; //! event header information container to fill from file
|
---|
26 | MPhotonEvent *fEvent; //! event information
|
---|
27 |
|
---|
28 | Int_t fTelescopeIdx; // Index of telescope to be extracted
|
---|
29 | Bool_t fForceMode; // Force mode skipping defect RUNE
|
---|
30 |
|
---|
31 | TList *fFileNames; // list of file names
|
---|
32 | UInt_t fNumFile; //! number of next file
|
---|
33 | UInt_t fNumEvents; //! input stream (file to read from)
|
---|
34 | UInt_t fNumTotalEvents; //! total number of events in all files
|
---|
35 |
|
---|
36 | // ifstream *fIn; //! input stream (file to read from)
|
---|
37 | MCorsikaFormat *fInFormat; //! access to input corsika data
|
---|
38 |
|
---|
39 | MParList *fParList; //! tasklist to call ReInit from
|
---|
40 |
|
---|
41 | Int_t fNumTelescopes; //! Number of telescopes in array
|
---|
42 | Int_t fNumTelescope; //! Number of telescope currently being read
|
---|
43 | TArrayF fTelescopeX; //! x pos (measured towards north, unit: cm)
|
---|
44 | TArrayF fTelescopeY; //! y pos (measured towards west, unit: cm)
|
---|
45 | TArrayF fTelescopeZ; //! z pos (from detection level, unit: cm)
|
---|
46 | TArrayF fTelescopeR; //! Radii of spheres around tel. (unit: cm)
|
---|
47 |
|
---|
48 | //UInt_t fInterleave;
|
---|
49 | //Bool_t fForce;
|
---|
50 |
|
---|
51 | // virtual Bool_t OpenStream() { return kTRUE; }
|
---|
52 |
|
---|
53 | Bool_t ReadEvtEnd();
|
---|
54 | Int_t OpenNextFile(Bool_t print=kTRUE);
|
---|
55 | Bool_t CalcNumTotalEvents();
|
---|
56 | Int_t ReadEvent();
|
---|
57 |
|
---|
58 | // MTask
|
---|
59 | Int_t PreProcess(MParList *pList);
|
---|
60 | Int_t Process();
|
---|
61 | Int_t PostProcess();
|
---|
62 |
|
---|
63 | // MParContainer
|
---|
64 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
65 |
|
---|
66 | public:
|
---|
67 | MCorsikaRead(const char *filename=NULL, const char *name=NULL, const char *title=NULL);
|
---|
68 | ~MCorsikaRead();
|
---|
69 |
|
---|
70 | void SetForceMode(Bool_t b=kTRUE) { fForceMode=b; }
|
---|
71 | void SetTelescopeIdx(Int_t idx=-1) { fTelescopeIdx = idx; }
|
---|
72 |
|
---|
73 | TString GetFullFileName() const;
|
---|
74 |
|
---|
75 | Int_t AddFile(const char *fname, Int_t entries=-1);
|
---|
76 | Bool_t Rewind();
|
---|
77 | UInt_t GetEntries() { return fNumTotalEvents/*/fInterleave*/; }
|
---|
78 |
|
---|
79 | ClassDef(MCorsikaRead, 0) // Task to read the raw data binary file
|
---|
80 | };
|
---|
81 |
|
---|
82 | #endif
|
---|