Changeset 2410 for trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
- Timestamp:
- 10/20/03 17:49:59 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
r2216 r2410 4 4 #ifndef ROOT_TClonesArray 5 5 #include <TClonesArray.h> 6 #endif 7 #ifndef ROOT_TArrayI 8 #include <TArrayI.h> 6 9 #endif 7 10 #ifndef MARS_MCamEvent … … 19 22 private: 20 23 UInt_t fNumPixels; 24 TArrayI fLut; // Lookup tabel to lookup pixel by index 21 25 TClonesArray *fPixels; //-> FIXME: Change TClonesArray away from a pointer? 22 26 … … 28 32 //void InitSize(UInt_t num) { fPixels->Expand(num); } 29 33 30 void AddPixel(Int_t id , Float_t nph, Float_t er)34 void AddPixel(Int_t idx, Float_t nph, Float_t er) 31 35 { 32 new ((*fPixels)[fNumPixels++]) MCerPhotPix(id, nph, er); 36 // 37 // If this is too slow or takes to much space we might use 38 // MGeomApply and an InitSize member function instead. 39 // 40 if (idx>=fLut.GetSize()) 41 fLut.Set(idx+1); 42 43 fLut[idx] = fNumPixels; 44 new ((*fPixels)[fNumPixels++]) MCerPhotPix(idx, nph, er); 33 45 } 34 46 35 47 void FixSize(); 36 37 //Bool_t AddEvent(const MCerPhotEvt &evt);38 48 39 49 Bool_t IsPixelExisting(Int_t id) const; … … 53 63 MCerPhotPix &operator[](int i) const { return *(MCerPhotPix*)(fPixels->UncheckedAt(i)); } 54 64 55 void Scale(Double_t f) ;65 void Scale(Double_t f) { fPixels->ForEach(MCerPhotPix, Scale)(f); } 56 66 void RemoveUnusedPixels(); 57 67 58 MCerPhotPix *GetPixById(int id ) const;68 MCerPhotPix *GetPixById(int idx) const;// { return idx>=0 && idx<fLut.GetSize() ? (MCerPhotPix*)(fPixels->UncheckedAt(fLut[idx])) : 0; } // Return a pointer to the pixel with the requested id. NULL if it doesn't exist. 59 69 60 70 void Reset(); 61 71 62 void Draw(Option_t* option = "");63 72 void Print(Option_t *opt=NULL) const; 64 73 void Clear(Option_t *opt=NULL) { Reset(); } 65 74 66 75 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 67 void DrawPixelContent(Int_t num) const 68 { 69 } 76 void DrawPixelContent(Int_t num, TVirtualPad *pad=NULL) const; 70 77 71 ClassDef(MCerPhotEvt, 1) // class for an event containing cerenkov photons78 ClassDef(MCerPhotEvt, 2) // class for an event containing cerenkov photons 72 79 }; 73 80 74 81 #endif 75
Note:
See TracChangeset
for help on using the changeset viewer.