Changeset 5761 for trunk


Ignore:
Timestamp:
01/10/05 11:19:15 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r5728 r5761  
    469469        const MGeomPix &gpix = (*fGeomCam)[i];
    470470
    471         const Int_t n0 = gpix.GetNumNeighbors();
    472 
    473         MArrayD time(n0);
    474         for (int j=0; j<n0; j++)
    475             time[j] = (*fTimes)[gpix.GetNeighbor(j)];
    476 
    477         Int_t p0=0;
    478         Int_t p1=0;
     471        MArrayD time(gpix.GetNumNeighbors());
     472
     473        Int_t n0 = 0;
     474        for (unsigned int j=0; j<time.GetSize(); j++)
     475        {
     476            const Double_t t = (*fTimes)[gpix.GetNeighbor(j)];
     477            if (t>=0)
     478                time[n0++] = t;
     479        }
     480
     481        Int_t p0=-1;
     482        Int_t p1=-1;
    479483
    480484        Double_t min=FLT_MAX;
     
    492496            }
    493497
    494         if (TMath::Abs(time[p0] - time[p1])<250)
     498        if (p0>=0 && p1>=0 && TMath::Abs(time[p0] - time[p1])<250)
    495499            fTimes->SetTime(i, (time[p0]+time[p1])/2);
    496500    }
Note: See TracChangeset for help on using the changeset viewer.