source: trunk/MagicSoft/Mars/msim/MPhotonEvent.h@ 9408

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