Ignore:
Timestamp:
06/02/05 16:16:04 (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

    r7109 r7126  
    8686//
    8787MBadPixelsCalc::MBadPixelsCalc(const char *name, const char *title)
    88     : fPedestalLevel(3), fPedestalLevelVariance(5), fNamePedPhotCam("MPedPhotCam"),
     88    : fPedestalLevel(3), fPedestalLevelVarianceLo(5),
     89    fPedestalLevelVarianceHi(5), fNamePedPhotCam("MPedPhotCam"),
    8990    fCheckInProcess(kTRUE), fCheckInPostProcess(kFALSE)
    9091{
     
    120121
    121122    *fLog << inf << "Name of MPedPhotCam to get pedestal rms from: " << fNamePedPhotCam << endl;
    122     if (fPedestalLevel)
     123    if (fPedestalLevel>0)
    123124        *fLog << "Checking mean 'pedestal rms' against absolute value with level " << fPedestalLevel << endl;
    124     if (fPedestalLevelVariance)
    125         *fLog << "Checking mean 'pedestal rms' against its variance with level " << fPedestalLevelVariance << endl;
     125    if (fPedestalLevelVarianceLo>0)
     126        *fLog << "Checking mean 'pedestal rms' against its lower variance with level " << fPedestalLevelVarianceLo << endl;
     127    if (fPedestalLevelVarianceHi>0)
     128        *fLog << "Checking mean 'pedestal rms' against its upper variance with level " << fPedestalLevelVarianceHi << endl;
    126129
    127130    return kTRUE;
     
    142145    }
    143146
    144     if (fPedestalLevel<=0 && fPedestalLevelVariance<=0)
     147    const Bool_t checklo  = fPedestalLevelVarianceLo>0;
     148    const Bool_t checkhi  = fPedestalLevelVarianceHi>0;
     149
     150    if (fPedestalLevel<=0 && !checklo && !checkhi)
    145151        return kTRUE;
    146152
     
    219225        }
    220226
    221         if (fPedestalLevelVariance>0)
     227        if (checklo || checkhi)
    222228        {
    223229            varrms2[i] /= npix[i];
    224230            varrms2[i]  = TMath::Sqrt(varrms2[i]-meanrms2[i]*meanrms2[i]);
    225231
    226             lolim2[i]   = meanrms2[i]-fPedestalLevelVariance*varrms2[i];
    227             uplim2[i]   = meanrms2[i]+fPedestalLevelVariance*varrms2[i];
     232            lolim2[i]   = meanrms2[i]-fPedestalLevelVarianceLo*varrms2[i];
     233            uplim2[i]   = meanrms2[i]+fPedestalLevelVarianceHi*varrms2[i];
    228234        }
    229235    }
     
    240246        const Byte_t  aidx = (*fGeomCam)[i].GetAidx();
    241247
    242         if ((fPedestalLevel<=0         || (rms>lolim1[aidx] && rms<=uplim1[aidx])) &&
    243             (fPedestalLevelVariance<=0 || (rms>lolim2[aidx] && rms<=uplim2[aidx])))
     248        if ((fPedestalLevel<=0 || (rms> lolim1[aidx] && rms<=uplim1[aidx])) &&
     249            (!checklo          ||  rms> lolim2[aidx])                       &&
     250            (!checkhi          ||  rms<=uplim2[aidx])
     251           )
    244252            continue;
    245253
     
    303311// Read the setup from a TEnv, eg:
    304312//   MBadPixelsCalc.PedestalLevel:         3.0
    305 //   MBadPixelsCalc.PedestalLevelVariance: 3.0
     313//
     314//   MBadPixelsCalc.PedestalLevelVariance:   5.0
     315//     overwrites
     316//   MBadPixelsCalc.PedestalLevelVarianceLo: 5.0
     317//     and
     318//   MBadPixelsCalc.PedestalLevelVarianceHi: 5.0
    306319//
    307320Int_t MBadPixelsCalc::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     
    313326        SetPedestalLevel(GetEnvValue(env, prefix, "PedestalLevel", fPedestalLevel));
    314327    }
     328    if (IsEnvDefined(env, prefix, "PedestalLevelVarianceLo", print))
     329    {
     330        rc = kTRUE;
     331        SetPedestalLevelVarianceLo(GetEnvValue(env, prefix, "PedestalLevelVarianceLo", fPedestalLevelVarianceLo));
     332    }
     333    if (IsEnvDefined(env, prefix, "PedestalLevelVarianceHi", print))
     334    {
     335        rc = kTRUE;
     336        SetPedestalLevelVarianceHi(GetEnvValue(env, prefix, "PedestalLevelVarianceHi", fPedestalLevelVarianceHi));
     337    }
    315338
    316339    if (IsEnvDefined(env, prefix, "PedestalLevelVariance", print))
    317340    {
    318341        rc = kTRUE;
    319         SetPedestalLevelVariance(GetEnvValue(env, prefix, "PedestalLevelVariance", fPedestalLevelVariance));
     342        SetPedestalLevelVariance(GetEnvValue(env, prefix, "PedestalLevelVariance", -1));
    320343    }
    321344    return rc;
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.h

    r7109 r7126  
    2222
    2323    Float_t fPedestalLevel;
    24     Float_t fPedestalLevelVariance;
     24    Float_t fPedestalLevelVarianceLo;
     25    Float_t fPedestalLevelVarianceHi;
    2526
    2627    TString fNamePedPhotCam; // name of the 'MPedPhotCam' container
     
    4142
    4243    // Setter
    43     void SetPedestalLevel(Float_t f)         { fPedestalLevel=f; }
    44     void SetPedestalLevelVariance(Float_t f) { fPedestalLevelVariance=f; }
    45     void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; }
     44    void SetPedestalLevel(Float_t f=-1)           { fPedestalLevel=f; }
     45    void SetPedestalLevelVariance(Float_t f=-1)   { fPedestalLevelVarianceLo=fPedestalLevelVarianceHi=f; }
     46    void SetPedestalLevelVarianceLo(Float_t f=-1) { fPedestalLevelVarianceLo=f; }
     47    void SetPedestalLevelVarianceHi(Float_t f=-1) { fPedestalLevelVarianceHi=f; }
    4648
    47     void SetGeomCam(const MGeomCam *geom) { fGeomCam = geom; }
     49    void SetNamePedPhotCam(const char *name)      { fNamePedPhotCam = name; }
     50    void SetGeomCam(const MGeomCam *geom)         { fGeomCam = geom; }
    4851
    4952    void EnableCheckInProcess(Bool_t b=kTRUE)     { fCheckInProcess = b; }
Note: See TracChangeset for help on using the changeset viewer.