Changeset 2445 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 10/30/03 17:09:40 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
r2416 r2445 124 124 Bool_t MCerPhotEvt::IsPixelExisting(Int_t id) const 125 125 { 126 const MCerPhotPix *pix = GetPixById(id); 127 return pix ? kTRUE : kFALSE; 126 return GetPixById(id) ? kTRUE : kFALSE; 128 127 } 129 128 … … 163 162 Float_t minval = FLT_MAX; 164 163 165 for (UInt_t i= 1; i<fNumPixels; i++)164 for (UInt_t i=0; i<fNumPixels; i++) 166 165 { 167 166 const MCerPhotPix &pix = (*this)[i]; … … 170 169 171 170 const UInt_t id = pix.GetPixId(); 172 if (id >=n)171 if (id<0 || id>=n) 173 172 continue; 174 173 … … 200 199 Float_t maxval = -FLT_MAX; 201 200 202 for (UInt_t i= 1; i<fNumPixels; i++)201 for (UInt_t i=0; i<fNumPixels; i++) 203 202 { 204 203 const MCerPhotPix &pix = (*this)[i]; … … 207 206 208 207 const UInt_t id = pix.GetPixId(); 209 if (id >=n)208 if (id<0 || id>=n) 210 209 continue; 211 210 … … 229 228 return -5.; 230 229 231 Float_t minval = (*this)[0].GetNumPhotons()/(*this)[0].GetErrorPhot();232 233 for (UInt_t i= 1; i<fNumPixels; i++)230 Float_t minval = FLT_MAX; 231 232 for (UInt_t i=0; i<fNumPixels; i++) 234 233 { 235 234 const MCerPhotPix &pix = (*this)[i]; … … 259 258 Float_t maxval = -FLT_MAX; 260 259 261 for (UInt_t i= 1; i<fNumPixels; i++)260 for (UInt_t i=0; i<fNumPixels; i++) 262 261 { 263 262 const MCerPhotPix &pix = (*this)[i]; … … 289 288 Float_t minval = FLT_MAX; 290 289 291 for (UInt_t i= 1; i<fNumPixels; i++)290 for (UInt_t i=0; i<fNumPixels; i++) 292 291 { 293 292 const MCerPhotPix &pix = (*this)[i]; … … 319 318 Float_t maxval = -FLT_MAX; 320 319 321 for (UInt_t i= 1; i<fNumPixels; i++)320 for (UInt_t i=0; i<fNumPixels; i++) 322 321 { 323 322 const MCerPhotPix &pix = (*this)[i]; … … 356 355 // try to search in the array. 357 356 // 358 MCerPhotPix *MCerPhotEvt::GetPixById(int idx) const 359 { 357 MCerPhotPix *MCerPhotEvt::GetPixById(Int_t idx) const 358 { 359 if (idx<0) 360 return 0; 361 360 362 if (fLut.GetSize()>0) 361 return idx>=0 && idx<fLut.GetSize() ? (MCerPhotPix*)(fPixels->UncheckedAt(fLut[idx])) : 0; 363 { 364 if (idx>=fLut.GetSize()) 365 return 0; 366 367 return fLut[idx]<0 ? 0 : (MCerPhotPix*)(fPixels->UncheckedAt(fLut[idx])); 368 } 362 369 363 370 TIter Next(fPixels); -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
r2416 r2445 39 39 // 40 40 if (idx>=fLut.GetSize()) 41 { 42 const Int_t n = fLut.GetSize(); 41 43 fLut.Set(idx+1); 44 for (int i=n; i<idx; i++) 45 fLut[i] = -1; 46 } 42 47 43 48 fLut[idx] = fNumPixels; … … 66 71 void RemoveUnusedPixels(); 67 72 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.73 MCerPhotPix *GetPixById(Int_t idx) const; 69 74 70 75 void Reset();
Note:
See TracChangeset
for help on using the changeset viewer.