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

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