source: trunk/Mars/msim/MPhotonEvent.h@ 9851

Last change on this file since 9851 was 9616, checked in by rohlfs, 14 years ago
can read also EventIO files
File size: 2.8 KB
Line 
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
14using namespace std;
15
16class MPhotonData;
17class MCorsikaRunHeader;
18class MCorsikaFormat;
19
20class MPhotonEvent : public MParContainer
21{
22private:
23 TClonesArray fData;
24
25public:
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 TClonesArray &GetArray() { return fData; }
40 const TClonesArray &GetArray() const { return fData; }
41
42 MPhotonData &Add(Int_t n);
43 MPhotonData &Add();
44
45 MPhotonData *GetFirst() const;
46 MPhotonData *GetLast() const;
47
48 MPhotonData &operator[](UInt_t idx);
49 const MPhotonData &operator[](UInt_t idx) const;
50
51 Int_t Shrink(Int_t n);
52 void Resize(Int_t n);
53
54 // I/O
55 Int_t ReadCorsikaEvt(MCorsikaFormat * fInFormat);
56 Int_t ReadCorsikaEvt(istream &fin);
57 Int_t ReadRflEvt(istream &fin);
58
59 // TObject
60 void Paint(Option_t *o="");
61 void Print(Option_t * = NULL) const;
62 //void Clear(Option_t * = NULL);
63
64 ClassDef(MPhotonEvent, 1) //Container to store the raw Event Data
65};
66
67// FIXME: Should we merge this into MPhotonEvent?
68class MPhotonStatistics : public MParContainer
69{
70private:
71 Float_t fTimeFirst; //! Start of (simulated) sampling window
72 Float_t fTimeLast; //! Start of (simulated) sampling window
73
74 Float_t fLength; // Time between first and last photon
75 Float_t fTimeMedDev; // Median deviation
76
77// Float_t fOffset;
78// Float_t fWindow;
79
80 Int_t fMaxIndex; //!
81
82public:
83 MPhotonStatistics(const char *name=NULL, const char *title=NULL) : fMaxIndex(-1)
84 {
85 fName = name ? name : "MPhotonStatistics";
86 fTitle = title ? title : "Corsika Event Data Information";
87 }
88
89 void SetTime(Float_t first, Float_t last) { fTimeFirst=first; fTimeLast=last; }
90 void SetLength(Float_t len) { fLength=len; }
91 void SetMaxIndex(UInt_t idx) { fMaxIndex=idx; }
92 void SetTimeMedDev(Float_t dev) { fTimeMedDev=dev; }
93
94// Float_t GetRawTimeFirst() const { return fTimeFirst; }
95// Float_t GetRawTimeLast() const { return fTimeLast; }
96
97 Float_t GetTimeFirst() const { return fTimeFirst; }
98 Float_t GetTimeLast() const { return fTimeLast; }
99
100 Float_t GetLength() const { return fLength; }
101 Float_t GetTimeMedDev() const { return fTimeMedDev; }
102
103 Int_t GetMaxIndex() const { return fMaxIndex; }
104
105// Bool_t IsValid() const { return fTimeLast>=fTimeFirst; }
106
107 ClassDef(MPhotonStatistics, 1)
108};
109#endif
Note: See TracBrowser for help on using the repository browser.