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

Last change on this file since 10060 was 10060, checked in by rohlfs, 10 years ago
two new command line arguments of readcorsika: -A=arrayNo and -T=telescopeNo. New design of program flow in MCorsikaRead: It is now determined by the order of the data blocks in the input file.
File size: 3.1 KB
Line 
1#ifndef MARS_MCorsikaRead
2#define MARS_MCorsikaRead
3
4#include <vector>
5
6#ifndef MARS_MRead
7#include "MRead.h"
8#endif
9
10#ifndef ROOT_TArrayF
11#include <TArrayF.h>
12#endif
13
14class TList;
15//class MZlib;
16class MTaskList;
17
18class MCorsikaRunHeader;
19class MCorsikaEvtHeader;
20class MPhotonEvent;
21class MCorsikaFormat;
22
23class MCorsikaRead : public MRead
24{
25private:
26    MCorsikaRunHeader *fRunHeader;  //! run header information container to fill from file
27    MCorsikaEvtHeader *fEvtHeader;  //! event header information container to fill from file
28    MPhotonEvent      *fEvent;      //! event information
29
30    Int_t           fTelescopeIdx;  // Index of telescope to be extracted
31    Int_t           fArrayIdx;      // Index of telescope-array to be extracted
32    Bool_t          fForceMode;     // Force mode skipping defect RUNE
33
34    TList    *fFileNames;      // list of file names
35    UInt_t    fNumFile;        //! number of next file
36    UInt_t    fNumEvents;      //! input stream (file to read from)
37    UInt_t    fNumTotalEvents; //! total number of events in all files
38
39    MCorsikaFormat *fInFormat; //! access to input corsika data
40
41    MParList *fParList;        //! tasklist to call ReInit from
42
43    Int_t  fNumTelescopes;     //! Number of telescopes in array
44    Int_t  fNumTelescope;      //! Number of telescope currently being read
45    TArrayF fTelescopeX;       //! x pos (measured towards north, unit: cm)
46    TArrayF fTelescopeY;       //! y pos (measured towards west,  unit: cm)
47    TArrayF fTelescopeZ;       //! z pos (from detection level,   unit: cm)
48    TArrayF fTelescopeR;       //! Radii of spheres around tel. (unit: cm)
49
50    Int_t   fReadState;        //! 0: nothing read yet
51                               //  1: RUNH is already read
52                               //  2: EVTH is already read
53                               //  3: EVTE is already read, run still open
54                               //  4: inside of a top level block (1205)
55                               //  5: RUNE is already read
56                               // 10: raw events are currently read
57                               // 11: raw events are currently saved
58    Int_t   fTopBlockLength;   // remaining length of the current top-level block 1204
59
60    std::vector<Float_t>  fRawEvemtBuffer;     //! buffer of raw event data
61    //UInt_t    fInterleave;
62    //Bool_t    fForce;
63
64
65    Int_t  OpenNextFile(Bool_t print=kTRUE);
66    Bool_t CalcNumTotalEvents();
67    Int_t  ReadTelescopePosition();
68
69    // MTask
70    Int_t PreProcess(MParList *pList);
71    Int_t Process();
72    Int_t PostProcess();
73
74
75public:
76    MCorsikaRead(const char *filename=NULL, const char *name=NULL, const char *title=NULL);
77    ~MCorsikaRead();
78
79    void SetForceMode(Bool_t b=kTRUE) { fForceMode=b; }
80    void SetTelescopeIdx(Int_t idx)   { fTelescopeIdx = idx; }
81    void SetArrayIdx(Int_t idx)       { fArrayIdx = idx; }
82
83    TString GetFullFileName() const;
84
85    Int_t  AddFile(const char *fname, Int_t entries=-1);
86    Bool_t Rewind();
87    UInt_t GetEntries() { return fNumTotalEvents/*/fInterleave*/; }
88
89    ClassDef(MCorsikaRead, 0)   // Task to read the raw data binary file
90};
91
92#endif
Note: See TracBrowser for help on using the repository browser.