Ignore:
Timestamp:
06/03/05 18:02:36 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7126 r7130  
    139139Bool_t MBadPixelsCalc::CheckPedestalRms(MBadPixelsPix::UnsuitableType_t type) const
    140140{
    141     if (!fGeomCam || !fPedPhotCam || !fBadPixels)
    142     {
    143         *fLog << err << "MBadPixelsCalc::CheckPedestalRms: ERROR - One of the necessary container are not initialized..." << endl;
    144         return kFALSE;
    145     }
    146 
    147     const Bool_t checklo  = fPedestalLevelVarianceLo>0;
    148     const Bool_t checkhi  = fPedestalLevelVarianceHi>0;
     141    const Bool_t checklo = fPedestalLevelVarianceLo>0;
     142    const Bool_t checkhi = fPedestalLevelVarianceHi>0;
    149143
    150144    if (fPedestalLevel<=0 && !checklo && !checkhi)
    151145        return kTRUE;
    152146
     147    if (!fGeomCam || !fPedPhotCam || !fBadPixels)
     148    {
     149        *fLog << err << "MBadPixelsCalc::CheckPedestalRms: ERROR - One of the necessary container are not initialized..." << endl;
     150        return kFALSE;
     151    }
     152
    153153    const Int_t entries = fPedPhotCam->GetSize();
    154154
     
    175175
    176176    //if no pixel has a minimum signal, return
     177    Int_t counter=0;
    177178    for (int i=0; i<na; i++)
    178179    {
    179         if (npix[i]==0 || meanrms[i]==0)
    180         {
    181             //fErrors[1]++;          //no valid Pedestals Rms
    182             return kFALSE;
     180        if (npix[i]==0 || meanrms[i]==0) //no valid Pedestals Rms
     181        {
     182            counter++;
     183            continue;
    183184        }
    184185
    185186        meanrms[i] /= npix[i];
    186187        npix[i]=0;
     188    }
     189
     190    if (counter==na)
     191    {
     192        *fLog << err << "MBadPixelsCalc::CheckPedestalRms: ERROR - No pixel seems to contain a valid pedestal RMS..." << endl;
     193        return kFALSE;
    187194    }
    188195
     
    209216    MArrayD lolim1(na), lolim2(na); // Precalcualtion of limits
    210217    MArrayD uplim1(na), uplim2(na); // for speeed reasons
     218    counter = 0;
    211219    for (int i=0; i<na; i++)
    212220    {
    213221        if (npix[i]==0 || meanrms2[i]==0)
    214222        {
    215             //fErrors[1]++;          //no valid Pedestals Rms
    216             return kFALSE;
     223            counter++;
     224            continue;
    217225        }
    218226
     
    233241            uplim2[i]   = meanrms2[i]+fPedestalLevelVarianceHi*varrms2[i];
    234242        }
     243    }
     244
     245    if (counter==na)
     246    {
     247        *fLog << err << "MBadPixelsCalc::CheckPedestalRms: ERROR - No pixel seems to contain a valid pedestal RMS anymore..." << endl;
     248        return kFALSE;
    235249    }
    236250
Note: See TracChangeset for help on using the changeset viewer.