Changeset 2929 for trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
- Timestamp:
- 01/27/04 19:33:39 (21 years ago)
- File:
-
- 1 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)
Note:
See TracChangeset
for help on using the changeset viewer.