Changeset 2929 for trunk/MagicSoft/Mars
- Timestamp:
- 01/27/04 19:33:39 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
r2582 r2929 55 55 fArray = new TClonesArray("MPedestalPix", 1); 56 56 57 // for (int i=0; i<577; i++)58 // new ((*fArray)[i]) MPedestalPix;59 57 } 60 58 … … 79 77 // -------------------------------------------------------------------------- 80 78 // 79 // Check if position i is inside bounds 80 // 81 Bool_t MPedestalCam::CheckBounds(Int_t i) const 82 { 83 return i < GetSize(); 84 } 85 86 // -------------------------------------------------------------------------- 87 // 88 // This function returns the current size of the TClonesArray 89 // independently if the MPedestalPix is filled with values or not. 90 // 81 91 // Get the size of the MPedestalCam 82 92 // … … 92 102 MPedestalPix &MPedestalCam::operator[](Int_t i) 93 103 { 94 return *static_cast<MPedestalPix*>(fArray->UncheckedAt(i)); 104 if (!CheckBounds(i)) 105 return *static_cast<MPedestalPix*>(NULL); 106 107 return *static_cast<MPedestalPix*>(fArray->UncheckedAt(i)); 95 108 } 96 109 … … 101 114 MPedestalPix &MPedestalCam::operator[](Int_t i) const 102 115 { 103 return *static_cast<MPedestalPix*>(fArray->UncheckedAt(i)); 104 } 105 106 // -------------------------------------------------------------------------- 107 // 108 // Check if position i is inside bounds 109 // 110 Bool_t MPedestalCam::CheckBounds(Int_t i) 111 { 112 return i < fArray->GetEntriesFast(); 113 } 116 if (!CheckBounds(i)) 117 return *static_cast<MPedestalPix*>(NULL); 118 119 return *static_cast<MPedestalPix*>(fArray->UncheckedAt(i)); 120 } 114 121 115 122 void MPedestalCam::Clear(Option_t *o) -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.h
r2416 r2929 31 31 Float_t GetPedestalMax(const MGeomCam *cam) const; 32 32 33 Bool_t CheckBounds(Int_t i) ;33 Bool_t CheckBounds(Int_t i) const; 34 34 35 35 void Print(Option_t *o="") const; -
trunk/MagicSoft/Mars/manalysis/MPedestalPix.cc
r2237 r2929 48 48 void MPedestalPix::Clear(Option_t *o) 49 49 { 50 fPedestal = -1;51 fPedestalRms = -1;50 fPedestal = 0.; 51 fPedestalRms = 0.; 52 52 } 53 53
Note:
See TracChangeset
for help on using the changeset viewer.