Ignore:
Timestamp:
05/30/05 18:12:10 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbadpixels
Files:
2 edited

Legend:

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

    r7094 r7109  
    136136Bool_t MBadPixelsCalc::CheckPedestalRms(MBadPixelsPix::UnsuitableType_t type) const
    137137{
     138    if (!fGeomCam || !fPedPhotCam || !fBadPixels)
     139    {
     140        *fLog << err << "MBadPixelsCalc::CheckPedestalRms: ERROR - One of the necessary container are not initialized..." << endl;
     141        return kFALSE;
     142    }
     143
    138144    if (fPedestalLevel<=0 && fPedestalLevelVariance<=0)
    139145        return kTRUE;
     
    247253    // Check if the number of pixels to blind is > 60% of total number of pixels
    248254    //
    249     //    if (bads>0.6*entries)
    250     //    {
    251     //    fErrors[2]++;
    252     //    return kFALSE;
    253     //    }
     255    if (bads>0.5*entries)
     256    {
     257        *fLog << err << "ERROR - More than 50% unsuitable pixels... something must be wrong!" << endl;
     258        return kFALSE;
     259    }
    254260
    255261    return kTRUE;
     262}
     263
     264Bool_t MBadPixelsCalc::CheckPedestalRms(MBadPixelsCam &cam, const MPedPhotCam &ped, MBadPixelsPix::UnsuitableType_t t)
     265{
     266    MBadPixelsCam *store1 = fBadPixels;
     267    const MPedPhotCam *store2 = fPedPhotCam;
     268
     269    fBadPixels  = &cam;
     270    fPedPhotCam = &ped;
     271
     272    const Bool_t rc = CheckPedestalRms(t);
     273
     274    fBadPixels  = store1;
     275    fPedPhotCam = store2;
     276
     277    return rc;
     278}
     279
     280Bool_t MBadPixelsCalc::CheckPedestalRms(MBadPixelsCam &cam, const MPedestalCam &ped, MBadPixelsPix::UnsuitableType_t t)
     281{
     282    return CheckPedestalRms(cam, MPedPhotCam(ped), t);
    256283}
    257284
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.h

    r7094 r7109  
    1212class MGeomCam;
    1313class MPedPhotCam;
     14class MPedestalCam;
    1415
    1516class MBadPixelsCalc : public MTask
    1617{
    1718private:
    18     MGeomCam      *fGeomCam;    //! Input container storing the pixel sizes
    19     MPedPhotCam   *fPedPhotCam; //! Input container storing the pedestal and pedestal rms of all pixels
    20     MBadPixelsCam *fBadPixels;  //! Output container holding the bad pixels
     19    const MGeomCam      *fGeomCam;    //! Input container storing the pixel sizes
     20    const MPedPhotCam   *fPedPhotCam; //! Input container storing the pedestal and pedestal rms of all pixels
     21          MBadPixelsCam *fBadPixels;  //! Output container holding the bad pixels
    2122
    2223    Float_t fPedestalLevel;
     
    2728    Bool_t fCheckInProcess;
    2829    Bool_t fCheckInPostProcess;
    29 
    30     // MBadPixelsCalc
    31     Bool_t CheckPedestalRms(MBadPixelsPix::UnsuitableType_t t) const;
    3230
    3331    // MTask
     
    4745    void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; }
    4846
     47    void SetGeomCam(const MGeomCam *geom) { fGeomCam = geom; }
     48
    4949    void EnableCheckInProcess(Bool_t b=kTRUE)     { fCheckInProcess = b; }
    5050    void EnableCheckInPostProcess(Bool_t b=kTRUE) { fCheckInPostProcess = b; }
     51
     52    // MBadPixelsCalc
     53    Bool_t CheckPedestalRms(MBadPixelsPix::UnsuitableType_t t) const;
     54    Bool_t CheckPedestalRms(MBadPixelsCam &cam, const MPedPhotCam  &ped, MBadPixelsPix::UnsuitableType_t t=MBadPixelsPix::kUnsuitableRun);
     55    Bool_t CheckPedestalRms(MBadPixelsCam &cam, const MPedestalCam &ped, MBadPixelsPix::UnsuitableType_t t=MBadPixelsPix::kUnsuitableRun);
    5156
    5257    ClassDef(MBadPixelsCalc, 1) // Task to find bad pixels (star, broken pixels, etc)
Note: See TracChangeset for help on using the changeset viewer.