1 | #ifndef MARS_MPhotonEvent
|
---|
2 | #define MARS_MPhotonEvent
|
---|
3 |
|
---|
4 | #ifndef MARS_MParContainer
|
---|
5 | #include "MParContainer.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef ROOT_TClonesArray
|
---|
9 | #include <TClonesArray.h>
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | #include <iosfwd>
|
---|
13 |
|
---|
14 | using namespace std;
|
---|
15 |
|
---|
16 | class MPhotonData;
|
---|
17 | class MCorsikaRunHeader;
|
---|
18 | class MCorsikaFormat;
|
---|
19 |
|
---|
20 | class MPhotonEvent : public MParContainer
|
---|
21 | {
|
---|
22 | private:
|
---|
23 | TClonesArray fData;
|
---|
24 |
|
---|
25 | public:
|
---|
26 | MPhotonEvent(const char *name=NULL, const char *title=NULL);
|
---|
27 |
|
---|
28 | void Sort(Bool_t force=kFALSE);
|
---|
29 | Bool_t IsSorted() const { return fData.IsSorted(); }
|
---|
30 |
|
---|
31 | // Getter/Setter
|
---|
32 | Int_t GetNumPhotons() const { return fData.GetEntriesFast(); }
|
---|
33 | Int_t GetNumExternal() const;
|
---|
34 |
|
---|
35 | Float_t GetTimeFirst() const;
|
---|
36 | Float_t GetTimeLast() const;
|
---|
37 | Double_t GetTimeMedianDev() const;
|
---|
38 |
|
---|
39 | Double_t GetMeanX() const;
|
---|
40 | Double_t GetMeanY() const;
|
---|
41 |
|
---|
42 | TClonesArray &GetArray() { return fData; }
|
---|
43 | const TClonesArray &GetArray() const { return fData; }
|
---|
44 |
|
---|
45 | MPhotonData &Add(Int_t n);
|
---|
46 | MPhotonData &Add();
|
---|
47 |
|
---|
48 | MPhotonData *GetFirst() const;
|
---|
49 | MPhotonData *GetLast() const;
|
---|
50 |
|
---|
51 | MPhotonData &operator[](UInt_t idx);
|
---|
52 | const MPhotonData &operator[](UInt_t idx) const;
|
---|
53 |
|
---|
54 | Int_t Shrink(Int_t n);
|
---|
55 | void Resize(Int_t n);
|
---|
56 |
|
---|
57 | // I/O
|
---|
58 | Int_t ReadCorsikaEvt(MCorsikaFormat *fInFormat, Int_t i);
|
---|
59 | Int_t ReadCorsikaEvt(istream &fin, Int_t i);
|
---|
60 | //Int_t ReadRflEvt(istream &fin, Int_t i);
|
---|
61 |
|
---|
62 | // TObject
|
---|
63 | void Paint(Option_t *o="");
|
---|
64 | void Print(Option_t * = NULL) const;
|
---|
65 | //void Clear(Option_t * = NULL);
|
---|
66 |
|
---|
67 | ClassDef(MPhotonEvent, 1) //Container to store the raw Event Data
|
---|
68 | };
|
---|
69 |
|
---|
70 | // FIXME: Should we merge this into MPhotonEvent?
|
---|
71 | class MPhotonStatistics : public MParContainer
|
---|
72 | {
|
---|
73 | private:
|
---|
74 | Float_t fTimeFirst; //! Start of (simulated) sampling window
|
---|
75 | Float_t fTimeLast; //! Start of (simulated) sampling window
|
---|
76 |
|
---|
77 | Float_t fLength; // Time between first and last photon
|
---|
78 | Float_t fTimeMedDev; // Median deviation
|
---|
79 |
|
---|
80 | // Float_t fOffset;
|
---|
81 | // Float_t fWindow;
|
---|
82 |
|
---|
83 | Int_t fMaxIndex; //!
|
---|
84 |
|
---|
85 | public:
|
---|
86 | MPhotonStatistics(const char *name=NULL, const char *title=NULL) : fMaxIndex(-1)
|
---|
87 | {
|
---|
88 | fName = name ? name : "MPhotonStatistics";
|
---|
89 | fTitle = title ? title : "Corsika Event Data Information";
|
---|
90 | }
|
---|
91 |
|
---|
92 | void SetTime(Float_t first, Float_t last) { fTimeFirst=first; fTimeLast=last; }
|
---|
93 | void SetLength(Float_t len) { fLength=len; }
|
---|
94 | void SetMaxIndex(UInt_t idx) { fMaxIndex=idx; }
|
---|
95 | void SetTimeMedDev(Float_t dev) { fTimeMedDev=dev; }
|
---|
96 |
|
---|
97 | // Float_t GetRawTimeFirst() const { return fTimeFirst; }
|
---|
98 | // Float_t GetRawTimeLast() const { return fTimeLast; }
|
---|
99 |
|
---|
100 | Float_t GetTimeFirst() const { return fTimeFirst; }
|
---|
101 | Float_t GetTimeLast() const { return fTimeLast; }
|
---|
102 |
|
---|
103 | Float_t GetLength() const { return fLength; }
|
---|
104 | Float_t GetTimeMedDev() const { return fTimeMedDev; }
|
---|
105 |
|
---|
106 | Int_t GetMaxIndex() const { return fMaxIndex; }
|
---|
107 |
|
---|
108 | // Bool_t IsValid() const { return fTimeLast>=fTimeFirst; }
|
---|
109 |
|
---|
110 | ClassDef(MPhotonStatistics, 1)
|
---|
111 | };
|
---|
112 | #endif
|
---|