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

Last change on this file since 19947 was 19662, checked in by tbretz, 5 years ago
Added some comments about units
File size: 3.2 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#include "MClonesArray.h"
14
15using namespace std;
16
17class MPhotonData;
18class MCorsikaRunHeader;
19class MCorsikaFormat;
20
21class MPhotonEvent : public MParContainer
22{
23private:
24 MClonesArray fData;
25
26public:
27 MPhotonEvent(const char *name=NULL, const char *title=NULL);
28
29 void Sort(Bool_t force=kFALSE);
30 Bool_t IsSorted() const { return fData.IsSorted(); }
31
32 // Getter/Setter
33 Int_t GetNumPhotons() const { return fData.GetEntriesFast(); }
34 Int_t GetNumExternal() const;
35
36 Float_t GetTimeFirst() const;
37 Float_t GetTimeLast() const;
38 Double_t GetTimeMedianDev() const;
39
40 Double_t GetMeanX() const;
41 Double_t GetMeanY() const;
42 Double_t GetMeanT() const;
43
44 MClonesArray &GetArray() { return fData; }
45 const MClonesArray &GetArray() const { return fData; }
46
47 Bool_t AsciiWrite(ostream &out) const;
48
49 MPhotonData &Add(Int_t n);
50 MPhotonData &Add();
51
52 MPhotonData *GetFirst() const;
53 MPhotonData *GetLast() const;
54
55 MPhotonData &operator[](UInt_t idx);
56 const MPhotonData &operator[](UInt_t idx) const;
57
58 Int_t Shrink(Int_t n);
59 void Resize(Int_t n);
60
61 void AddXY(Double_t x, Double_t y);
62 void SimWavelength(Float_t wmin, Float_t wmax);
63
64 // I/O
65 Int_t ReadEventIoEvt(MCorsikaFormat *fInFormat);
66 Int_t ReadEventIoEvtCompact(MCorsikaFormat *fInFormat);
67 Int_t ReadCorsikaEvt(const vector<Float_t> &data, const uint32_t &blocklength, const Int_t &arrayIdx);
68
69 // TObject
70 void Paint(Option_t *o="");
71 void Print(Option_t * = NULL) const;
72 //void Clear(Option_t * = NULL);
73
74 ClassDef(MPhotonEvent, 2) //Container to store the raw Event Data
75};
76
77// FIXME: Should we merge this into MPhotonEvent?
78class MPhotonStatistics : public MParContainer
79{
80private:
81 Float_t fTimeFirst; //! [ns] Start of (simulated) sampling window
82 Float_t fTimeLast; //! [ns] End of (simulated) sampling window
83
84 Float_t fLength; // [ns] Time between first and last photon
85 Float_t fTimeMedDev; // [ns] Median deviation
86
87// Float_t fOffset;
88// Float_t fWindow;
89
90 Int_t fMaxIndex; //!
91
92public:
93 MPhotonStatistics(const char *name=NULL, const char *title=NULL) : fMaxIndex(-1)
94 {
95 fName = name ? name : "MPhotonStatistics";
96 fTitle = title ? title : "Corsika Event Data Information";
97 }
98
99 void SetTime(Float_t first, Float_t last) { fTimeFirst=first; fTimeLast=last; }
100 void SetLength(Float_t len) { fLength=len; }
101 void SetMaxIndex(UInt_t idx) { fMaxIndex=idx; }
102 void SetTimeMedDev(Float_t dev) { fTimeMedDev=dev; }
103
104// Float_t GetRawTimeFirst() const { return fTimeFirst; }
105// Float_t GetRawTimeLast() const { return fTimeLast; }
106
107 Float_t GetTimeFirst() const { return fTimeFirst; }
108 Float_t GetTimeLast() const { return fTimeLast; }
109
110 Float_t GetLength() const { return fLength; }
111 Float_t GetTimeMedDev() const { return fTimeMedDev; }
112
113 Int_t GetMaxIndex() const { return fMaxIndex; }
114
115// Bool_t IsValid() const { return fTimeLast>=fTimeFirst; }
116
117 ClassDef(MPhotonStatistics, 1)
118};
119#endif
Note: See TracBrowser for help on using the repository browser.