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

Last change on this file since 19344 was 19338, checked in by tbretz, 6 years ago
This allows to distinguish between the thinning file format (8 floats per bunch) and the normal one (7 floats per bunch)
File size: 3.1 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 Double_t GetMeanX() const;
40 Double_t GetMeanY() const;
41 Double_t GetMeanT() const;
42
43 TClonesArray &GetArray() { return fData; }
44 const TClonesArray &GetArray() const { return fData; }
45
46 Bool_t AsciiWrite(ostream &out) const;
47
48 MPhotonData &Add(Int_t n);
49 MPhotonData &Add();
50
51 MPhotonData *GetFirst() const;
52 MPhotonData *GetLast() const;
53
54 MPhotonData &operator[](UInt_t idx);
55 const MPhotonData &operator[](UInt_t idx) const;
56
57 Int_t Shrink(Int_t n);
58 void Resize(Int_t n);
59
60 void AddXY(Double_t x, Double_t y);
61 void SimWavelength(Float_t wmin, Float_t wmax);
62
63 // I/O
64 Int_t ReadEventIoEvt(MCorsikaFormat *fInFormat);
65 Int_t ReadEventIoEvtCompact(MCorsikaFormat *fInFormat);
66 Int_t ReadCorsikaEvt(const vector<Float_t> &data, const uint32_t &blocklength, const Int_t &arrayIdx);
67
68 // TObject
69 void Paint(Option_t *o="");
70 void Print(Option_t * = NULL) const;
71 //void Clear(Option_t * = NULL);
72
73 ClassDef(MPhotonEvent, 1) //Container to store the raw Event Data
74};
75
76// FIXME: Should we merge this into MPhotonEvent?
77class MPhotonStatistics : public MParContainer
78{
79private:
80 Float_t fTimeFirst; //! Start of (simulated) sampling window
81 Float_t fTimeLast; //! Start of (simulated) sampling window
82
83 Float_t fLength; // Time between first and last photon
84 Float_t fTimeMedDev; // Median deviation
85
86// Float_t fOffset;
87// Float_t fWindow;
88
89 Int_t fMaxIndex; //!
90
91public:
92 MPhotonStatistics(const char *name=NULL, const char *title=NULL) : fMaxIndex(-1)
93 {
94 fName = name ? name : "MPhotonStatistics";
95 fTitle = title ? title : "Corsika Event Data Information";
96 }
97
98 void SetTime(Float_t first, Float_t last) { fTimeFirst=first; fTimeLast=last; }
99 void SetLength(Float_t len) { fLength=len; }
100 void SetMaxIndex(UInt_t idx) { fMaxIndex=idx; }
101 void SetTimeMedDev(Float_t dev) { fTimeMedDev=dev; }
102
103// Float_t GetRawTimeFirst() const { return fTimeFirst; }
104// Float_t GetRawTimeLast() const { return fTimeLast; }
105
106 Float_t GetTimeFirst() const { return fTimeFirst; }
107 Float_t GetTimeLast() const { return fTimeLast; }
108
109 Float_t GetLength() const { return fLength; }
110 Float_t GetTimeMedDev() const { return fTimeMedDev; }
111
112 Int_t GetMaxIndex() const { return fMaxIndex; }
113
114// Bool_t IsValid() const { return fTimeLast>=fTimeFirst; }
115
116 ClassDef(MPhotonStatistics, 1)
117};
118#endif
Note: See TracBrowser for help on using the repository browser.