Ignore:
Timestamp:
05/27/05 09:46:22 (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/MBadPixelsCalc.cc

    r7035 r7094  
    8686//
    8787MBadPixelsCalc::MBadPixelsCalc(const char *name, const char *title)
    88     : fPedestalLevel(3), fPedestalLevelVariance(5), fNamePedPhotCam("MPedPhotCam")
     88    : fPedestalLevel(3), fPedestalLevelVariance(5), fNamePedPhotCam("MPedPhotCam"),
     89    fCheckInProcess(kTRUE), fCheckInPostProcess(kFALSE)
    8990{
    9091    fName  = name  ? name  : gsDefName.Data();
     
    129130// --------------------------------------------------------------------------
    130131//
    131 // Check the pedestal RMS of every pixel with respect to the mean pedestal RMS
    132 // of the camera (Sigmabar).
    133 //
    134 // The pixels can be set as blind if the pedestalRMS is too big or 0.
    135 //
    136 // If you don't want to use this option set the PedestalLevel<=0;
    137 //
    138 //     MBadPixelsCalc calc;
    139 //     calc.SetPedestalLevel(-1);
    140 /*
    141 void MBadPixelsCalc::CheckPedestalRMS() const
    142 {
    143     const Int_t entries = fPedPhotCam->GetSize();
    144 
    145     const Float_t meanPedRMS = fSigmabar->GetSigmabar();
    146 
    147     for (Int_t i=0; i<entries; i++)
    148     {
    149         //
    150         // get pixel as entry from list
    151         //
    152         const Double_t nratio    = fGeomCam->GetPixRatio(i);
    153         const Double_t pixPedRms = (*fPedPhotCam)[i].GetRms();
    154 
    155         if (pixPedRms*nratio > fPedestalLevel * meanPedRMS || pixPedRms == 0)
    156             (*fBadPixels)[i].SetUnsuitable(MBadPixelsPix::kUnsuitableEvt);
    157     }
    158 }
    159 */
    160 
    161 // --------------------------------------------------------------------------
    162 //
    163132// Check the pedestal Rms of the pixels: compute with 2 iterations the mean
    164133// for inner and outer pixels. Set as blind the pixels with too small or
    165134// too high pedestal Rms with respect to the mean.
    166135//
    167 Bool_t MBadPixelsCalc::CheckPedestalRms() const
    168 {
     136Bool_t MBadPixelsCalc::CheckPedestalRms(MBadPixelsPix::UnsuitableType_t type) const
     137{
     138    if (fPedestalLevel<=0 && fPedestalLevelVariance<=0)
     139        return kTRUE;
     140
    169141    const Int_t entries = fPedPhotCam->GetSize();
    170142
     
    266238            continue;
    267239
    268         (*fBadPixels)[i].SetUnsuitable(MBadPixelsPix::kUnsuitableEvt);
     240        (*fBadPixels)[i].SetUnsuitable(type);
     241        if (type==MBadPixelsPix::kUnsuitableRun)
     242            (*fBadPixels)[i].SetUncalibrated(MBadPixelsPix::kDeadPedestalRms);
     243
    269244        bads++;
    270245    }
     
    281256}
    282257
    283 
    284258// --------------------------------------------------------------------------
    285259//
     
    287261Int_t MBadPixelsCalc::Process()
    288262{
    289     if (fPedestalLevel>0 || fPedestalLevelVariance>0)
    290         CheckPedestalRms();
    291 
    292     return kTRUE;
     263    return fCheckInProcess ? CheckPedestalRms(MBadPixelsPix::kUnsuitableEvt) : kTRUE;
     264}
     265
     266// --------------------------------------------------------------------------
     267//
     268//
     269Int_t MBadPixelsCalc::PostProcess()
     270{
     271    return fCheckInPostProcess ? CheckPedestalRms(MBadPixelsPix::kUnsuitableRun) : kTRUE;
    293272}
    294273
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.h

    r5777 r7094  
    44#ifndef MARS_MTask
    55#include "MTask.h"
     6#endif
     7#ifndef MARS_MBadPixelsPix
     8#include "MBadPixelsPix.h"
    69#endif
    710
     
    2124
    2225    TString fNamePedPhotCam; // name of the 'MPedPhotCam' container
    23    
    24     //    void CheckPedestalRMS() const;
    25     Bool_t CheckPedestalRms() const;
    2626
     27    Bool_t fCheckInProcess;
     28    Bool_t fCheckInPostProcess;
     29
     30    // MBadPixelsCalc
     31    Bool_t CheckPedestalRms(MBadPixelsPix::UnsuitableType_t t) const;
     32
     33    // MTask
    2734    Int_t PreProcess(MParList *pList);
    2835    Int_t Process();
     36    Int_t PostProcess();
     37
     38    // MParContainer
    2939    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
    3040
     
    3242    MBadPixelsCalc(const char *name=NULL, const char *title=NULL);
    3343
     44    // Setter
    3445    void SetPedestalLevel(Float_t f)         { fPedestalLevel=f; }
    3546    void SetPedestalLevelVariance(Float_t f) { fPedestalLevelVariance=f; }
    3647    void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; }
     48
     49    void EnableCheckInProcess(Bool_t b=kTRUE)     { fCheckInProcess = b; }
     50    void EnableCheckInPostProcess(Bool_t b=kTRUE) { fCheckInPostProcess = b; }
    3751
    3852    ClassDef(MBadPixelsCalc, 1) // Task to find bad pixels (star, broken pixels, etc)
Note: See TracChangeset for help on using the changeset viewer.