Changeset 4679


Ignore:
Timestamp:
08/18/04 10:20:23 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbadpixels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc

    r4678 r4679  
    201201// --------------------------------------------------------------------------
    202202//
     203// Counts the number of neighbors matching NOT UnsuitableType type
     204//
     205Short_t MBadPixelsCam::GetNumSuitableNeighbors(MBadPixelsPix::UnsuitableType_t type, const MGeomPix &pix) const
     206{
     207    const Int_t n2 = pix.GetNumNeighbors();
     208
     209    Int_t cnt=0;
     210    for (int j=0; j<n2; j++)
     211    {
     212        const Int_t id2 = pix.GetNeighbor(j);
     213        if (!(*this)[id2].IsUnsuitable(type))
     214            cnt++;
     215    }
     216
     217    return cnt;
     218}
     219
     220// --------------------------------------------------------------------------
     221//
    203222// Calculate the number of pixels which are - under no circumstances -
    204223// interpolatable, called isolated. This means that a pixel (its own status
     
    227246            continue;
    228247
    229         const Int_t n2 = pix.GetNumNeighbors();
    230 
    231         Int_t cnt=0;
    232         for (int j=0; j<n2; j++)
    233         {
    234             const Int_t id2 = pix.GetNeighbor(j);
    235             if (!(*this)[id2].IsUnsuitable(type))
    236                 cnt++;
    237         }
    238 
    239         if (cnt<2)
     248        if (GetNumSuitableNeighbors(type, pix)<2)
    240249            rc++;
    241250    }
     
    262271        return 0;
    263272
    264     if (!(*this)[idx].IsUnsuitable(type))
     273    if (GetNumSuitableNeighbors(type, *pix)>1)
    265274        return 0;
    266275
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.h

    r4678 r4679  
    99#endif
    1010
     11class MGeomPix;
    1112class TClonesArray;
    1213
     
    1617    TClonesArray *fArray; //->
    1718
     19    Short_t GetNumSuitableNeighbors(MBadPixelsPix::UnsuitableType_t type, const MGeomPix &pix) const;
    1820    Short_t GetNumMaxCluster(MBadPixelsPix::UnsuitableType_t type, TObjArray &list, Int_t idx, Int_t aidx) const;
    1921
Note: See TracChangeset for help on using the changeset viewer.