Changeset 9239 for trunk/MagicSoft/Mars/msim/MPhotonEvent.h
- Timestamp:
- 01/22/09 19:07:37 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msim/MPhotonEvent.h
r9232 r9239 5 5 #include "MParContainer.h" 6 6 #endif 7 /* 8 #ifndef MARS_MCamEvent 9 #include "MCamEvent.h" 10 #endif 11 */ 7 12 8 #ifndef ROOT_TClonesArray 13 9 #include <TClonesArray.h> 14 10 #endif 15 11 16 // gcc 3.217 //class ifstream;18 12 #include <iosfwd> 19 20 /*21 class TH1;22 class TH2;23 class TH3;24 */25 13 26 14 class MPhotonData; … … 71 59 Changed(); 72 60 } 61 62 void SetSorted() { fSorted = kTRUE; } 73 63 }; 74 64 75 class MPhotonEvent : public MParContainer //, public MCamEvent65 class MPhotonEvent : public MParContainer 76 66 { 77 67 private: … … 81 71 MPhotonEvent(const char *name=NULL, const char *title=NULL); 82 72 83 //void Clear(Option_t * = NULL); 84 void Print(Option_t * = NULL) const; 73 // TObjArray, FIXME: This could be improved if checking for IsSortable is omitted 74 void Sort(Bool_t force=kFALSE) { if (force) fData.UnSort(); fData.Sort(); } 75 Bool_t IsSorted() const { return fData.IsSorted(); } 85 76 86 const char *GetClassName() const; 77 78 // Getter/Setter 79 Int_t GetNumPhotons() const { return fData.GetEntriesFast(); } 87 80 88 81 TClonesArray &GetArray() { return fData; } 89 82 const TClonesArray &GetArray() const { return fData; } 90 void Remove(TObject *o) { fData.Remove(o); }91 83 92 84 MPhotonData &Add(Int_t n); 93 85 MPhotonData &Add(); 86 87 MPhotonData *GetFirst() const; 88 MPhotonData *GetLast() const; 94 89 95 90 MPhotonData &operator[](UInt_t idx); … … 106 101 // for (int i=fData.GetSize()-1; i>=n; i--) 107 102 // fData.RemoveAt(i); 108 static_cast<MyClonesArray&>(fData).FastRemove(n, fData.GetSize()-1); 103 const Bool_t sorted = fData.IsSorted(); 104 105 MyClonesArray &loc = static_cast<MyClonesArray&>(fData); 106 107 loc.FastRemove(n, fData.GetSize()-1); 108 109 // If it was sorted before it is also sorted now. 110 if (sorted) 111 loc.SetSorted(); 109 112 110 113 return fData.GetEntriesFast(); 111 114 } 112 /* 113 void Expand(Int_t n) 114 { 115 for (int i=fData.GetSize(); i<n; i++) 116 fData.New(i); 117 } 118 */ 115 116 // I/O 119 117 Int_t ReadCorsikaEvt(istream &fin); 120 118 Int_t ReadRflEvt(istream &fin); 121 119 122 Int_t GetNumPhotons() const { return fData.GetEntriesFast(); } 123 /* 124 void FillRad(TH1 &hist, Float_t scale=1) const; 125 void FillRad(TH2 &hist, Double_t x, Float_t scale=1) const; 126 void Fill(TH2 &hist, Float_t scale=1) const; 127 void Fill(TH3 &hist, Double_t z, Float_t scale=1) const; 128 */ 120 // TObject 129 121 void Paint(Option_t *o=""); 130 131 // Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 132 // void DrawPixelContent(Int_t num) const; 133 134 void Sort() { fData.Sort(); } 122 void Print(Option_t * = NULL) const; 123 //void Clear(Option_t * = NULL); 135 124 136 125 ClassDef(MPhotonEvent, 1) //Container to store the raw Event Data
Note:
See TracChangeset
for help on using the changeset viewer.