Changeset 7358 for trunk/MagicSoft/Mars/mimage
- Timestamp:
- 09/21/05 14:26:45 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r7208 r7358 377 377 for (UInt_t idx=0; idx<npixevt; idx++) 378 378 { 379 // The default for pixels is "used" set by 380 // MParContainer::Reset before processing 379 381 if (data[idx]>fCleanLvl1) 380 382 continue; 381 383 384 // Setting a pixel to unused if it is unmapped would overwrite 385 // the unmapped-status. Therefor this pixels are excluded. 382 386 MSignalPix &pix = (*fEvt)[idx]; 383 387 if (!pix.IsPixelUnmapped()) … … 401 405 for (UInt_t idx=0; idx<npixevt; idx++) 402 406 { 407 // Exclude all unused (this includes all unmapped) pixels 403 408 MSignalPix &pix = (*fEvt)[idx]; 404 409 if (!pix.IsPixelUsed()) … … 416 421 const Int_t idx2 = gpix.GetNeighbor(j); 417 422 418 // when you find an used neighbor, break the loop 419 if (fEvt->IsPixelUsed(idx2)) 423 // when you find an used neighbor (this excludes unused 424 // and unmapped pixels) break the loop 425 if ((*fEvt)[idx2].IsPixelUsed()) 420 426 { 421 427 hasNeighbor = kTRUE; … … 424 430 } 425 431 426 if (hasNeighbor == kFALSE) 427 { 428 if (!fKeepSinglePixels) 429 pix.SetPixelUnused(); 430 size += pix.GetNumPhotons(); 431 n++; 432 } 433 } 434 432 // If the pixel has at least one core-neighbor 433 // go on with the next pixel 434 if (hasNeighbor) 435 continue; 436 437 // If the pixel has no neighbors and the single pixels 438 // should not be kept turn the used- into an unused-status 439 if (!fKeepSinglePixels) 440 pix.SetPixelUnused(); 441 442 // count size and number of single core-pixels 443 size += pix.GetNumPhotons(); 444 n++; 445 } 446 447 // Now turn the used-status into the core-status 448 // (FIXME: A more intelligent handling of used/core in clean step1/2 449 // would make this loop obsolete!) 435 450 for (UInt_t idx=0; idx<npixevt; idx++) 436 451 { 437 452 MSignalPix &pix = (*fEvt)[idx]; 438 if (pix.IsPixelUsed()) 439 pix.SetPixelCore(); 453 pix.SetPixelCore(pix.IsPixelUsed()); 440 454 } 441 455 … … 458 472 const Int_t idx2 = gpix.GetNeighbor(j); 459 473 460 if (!fEvt->IsPixelCore(idx2)) 474 // Check if the neighbor pixel is a core pixel. (Rem: Unampped 475 // pixels are never assigned the core-pixel status) 476 if (!(*fEvt)[idx2].IsPixelCore()) 461 477 continue; 462 478 … … 475 491 // If a value<2 for fCleanRings is used, no CleanStep4 is done. 476 492 // 477 void MImgCleanStd::CleanStep4(UShort_t r, Int_t idx /*MSignalPix &pix*/)493 void MImgCleanStd::CleanStep4(UShort_t r, Int_t idx) 478 494 { 479 495 MSignalPix &pix = (*fEvt)[idx]; … … 490 506 // and tell to which ring it belongs to. 491 507 // 492 MGeomPix &gpix 508 MGeomPix &gpix = (*fCam)[idx]; 493 509 494 510 const Int_t nnmax = gpix.GetNumNeighbors(); … … 498 514 const Int_t idx2 = gpix.GetNeighbor(j); 499 515 500 MSignalPix *npix = fEvt->GetPixById(idx2);501 if (!npix || !npix->IsPixelUsed() || npix->GetRing()>r-1 )516 const MSignalPix &npix = (*fEvt)[idx2]; 517 if (!npix.IsPixelUsed() || npix.GetRing()>r-1 ) 502 518 continue; 503 519
Note:
See TracChangeset
for help on using the changeset viewer.