Ignore:
Timestamp:
09/21/05 14:26:45 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc

    r7208 r7358  
    377377    for (UInt_t idx=0; idx<npixevt; idx++)
    378378    {
     379        // The default for pixels is "used" set by
     380        // MParContainer::Reset before processing
    379381        if (data[idx]>fCleanLvl1)
    380382            continue;
    381383
     384        // Setting a pixel to unused if it is unmapped would overwrite
     385        // the unmapped-status. Therefor this pixels are excluded.
    382386        MSignalPix &pix = (*fEvt)[idx];
    383387        if (!pix.IsPixelUnmapped())
     
    401405    for (UInt_t idx=0; idx<npixevt; idx++)
    402406    {
     407        // Exclude all unused (this includes all unmapped) pixels
    403408        MSignalPix &pix = (*fEvt)[idx];
    404409        if (!pix.IsPixelUsed())
     
    416421            const Int_t idx2 = gpix.GetNeighbor(j);
    417422
    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())
    420426            {
    421427                hasNeighbor = kTRUE;
     
    424430        }
    425431
    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!)
    435450    for (UInt_t idx=0; idx<npixevt; idx++)
    436451    {
    437452        MSignalPix &pix = (*fEvt)[idx];
    438         if (pix.IsPixelUsed())
    439             pix.SetPixelCore();
     453        pix.SetPixelCore(pix.IsPixelUsed());
    440454    }
    441455
     
    458472        const Int_t idx2 = gpix.GetNeighbor(j);
    459473
    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())
    461477            continue;
    462478
     
    475491//   If a value<2 for fCleanRings is used, no CleanStep4 is done.
    476492//
    477 void MImgCleanStd::CleanStep4(UShort_t r, Int_t idx/*MSignalPix &pix*/)
     493void MImgCleanStd::CleanStep4(UShort_t r, Int_t idx)
    478494{
    479495    MSignalPix &pix = (*fEvt)[idx];
     
    490506    // and tell to which ring it belongs to.
    491507    //
    492     MGeomPix  &gpix  = (*fCam)[idx];
     508    MGeomPix  &gpix = (*fCam)[idx];
    493509
    494510    const Int_t nnmax = gpix.GetNumNeighbors();
     
    498514        const Int_t idx2 = gpix.GetNeighbor(j);
    499515
    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 )
    502518            continue;
    503519
Note: See TracChangeset for help on using the changeset viewer.