source: trunk/Mars/mcorsika/MCorsikaRead.h@ 10009

Last change on this file since 10009 was 9943, checked in by tbretz, 14 years ago
Implemented a working version of eventio which reads all telescope's data and all array's data.
File size: 2.5 KB
Line 
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
12class TList;
13//class MZlib;
14class MTaskList;
15
16class MCorsikaRunHeader;
17class MCorsikaEvtHeader;
18class MPhotonEvent;
19class MCorsikaFormat;
20
21class MCorsikaRead : public MRead
22{
23private:
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
66public:
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
Note: See TracBrowser for help on using the repository browser.