Changeset 2410 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 10/20/03 17:49:59 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
r2409 r2410 351 351 // -------------------------------------------------------------------------- 352 352 // 353 // Return a pointer to the pixel with the requested id. NULL if it doesn't 354 // exist. 353 // Return a pointer to the pixel with the requested idx. NULL if it doesn't 354 // exist. The Look-up-table fLut is used. If its size is zero (according 355 // to Rene this will happen if an old class object is loaded) we still 356 // try to search in the array. 355 357 // 356 358 MCerPhotPix *MCerPhotEvt::GetPixById(int idx) const -
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 -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
r2377 r2410 92 92 MPedestalPix &MPedestalCam::operator[](Int_t i) 93 93 { 94 return * (MPedestalPix*)fArray->UncheckedAt(i);94 return *static_cast<MPedestalPix*>(fArray->UncheckedAt(i)); 95 95 } 96 96 … … 101 101 MPedestalPix &MPedestalCam::operator[](Int_t i) const 102 102 { 103 return * (MPedestalPix*)fArray->UncheckedAt(i);103 return *static_cast<MPedestalPix*>(fArray->UncheckedAt(i)); 104 104 } 105 105 … … 194 194 return val>=0; 195 195 } 196 197 void MPedestalCam::DrawPixelContent(Int_t num, TVirtualPad *pad) const 198 { 199 *fLog << warn << "MPedestalCam::DrawPixelContent - not available." << endl; 200 } -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.h
r2237 r2410 36 36 37 37 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 38 void DrawPixelContent(Int_t num) const 39 { 40 } 38 void DrawPixelContent(Int_t num, TVirtualPad *pad=NULL) const; 41 39 42 40 ClassDef(MPedestalCam, 1) // Storage Container for all pedestal information of the camera
Note:
See TracChangeset
for help on using the changeset viewer.