Ignore:
Timestamp:
06/26/03 17:00:06 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc

    r2233 r2237  
    263263
    264264#include "MParList.h"
     265#include "MSigmabar.h"
     266
    265267#include "MGeomPix.h"
    266268#include "MGeomCam.h"
     269
    267270#include "MCerPhotPix.h"
    268271#include "MCerPhotEvt.h"
    269 #include "MSigmabar.h"
     272
     273#include "MPedestalPix.h"
     274#include "MPedestalCam.h"
    270275
    271276#include "MGGroupFrame.h" // MGGroupFrame
     
    328333        MCerPhotPix &pix = (*fEvt)[i];
    329334
    330         const Int_t id = pix.GetPixId();
    331 
    332         const Float_t  entry = pix.GetNumPhotons();
    333         const Float_t  noise = pix.GetErrorPhot();
    334 
    335         //
     335        const Int_t idx = pix.GetPixId();
     336
     337        const Float_t entry = pix.GetNumPhotons();
     338        const Float_t noise = (*fPed)[idx].GetSigma();
     339
     340        //
    336341        // We calculate a correction factor which accounts for the
    337342        // fact that pixels have different size (see TDAS 02-14).
    338343        //
    339         const Double_t factor = TMath::Sqrt(fCam->GetPixRatio(id));
     344        const Double_t factor = TMath::Sqrt(fCam->GetPixRatio(idx));
    340345
    341346        // COBB: '<=' to skip entry=noise=0
     
    485490    // get pixel id of this entry
    486491    //
    487     const Int_t id = pix.GetPixId();
     492    const Int_t idx = pix.GetPixId();
    488493
    489494    //
    490495    // check the num of photons against the noise level
    491496    //
    492     const Float_t  entry = pix.GetNumPhotons();
    493     const Float_t  noise = pix.GetErrorPhot();
     497    const Float_t entry = pix.GetNumPhotons();
     498    const Float_t noise = (*fPed)[idx].GetSigma();
    494499
    495500    //
     
    497502    // fact that pixels have different size (see TDAS 02-14).
    498503    //
    499     const Double_t factor = TMath::Sqrt(fCam->GetPixRatio(id));
     504    const Double_t factor = TMath::Sqrt(fCam->GetPixRatio(idx));
    500505
    501506    return (entry * factor <= fCleanLvl2 * noise);
     
    653658    }
    654659
    655     if (fCleaningMethod != kDemocratic)
    656         return kTRUE;
    657 
    658     fSgb = (MSigmabar*)pList->FindObject("MSigmabar");
    659     if (!fSgb)
    660     {
    661         *fLog << dbginf << "MSigmabar not found... aborting." << endl;
    662         return kFALSE;
     660    if (fCleaningMethod == kDemocratic)
     661    {
     662        fSgb = (MSigmabar*)pList->FindObject("MSigmabar");
     663        if (!fSgb)
     664        {
     665            *fLog << dbginf << "MSigmabar not found... aborting." << endl;
     666            return kFALSE;
     667        }
     668    }
     669    else
     670    {
     671        fPed = (MPedestalCam*)pList->FindObject("MPedestalCam");
     672        if (!fPed)
     673        {
     674            *fLog << dbginf << "MPedestalCam not found... aborting." << endl;
     675            return kFALSE;
     676        }
    663677    }
    664678
     
    674688    if (fSgb)
    675689        fInnerNoise = fSgb->GetSigmabarInner();
    676 
     690#ifdef DEBUG
     691    *fLog << all << "CleanStep 1" << endl;
     692#endif
    677693    CleanStep1();
     694#ifdef DEBUG
     695    *fLog << all << "CleanStep 2" << endl;
     696#endif
    678697    CleanStep2();
     698#ifdef DEBUG
     699    *fLog << all << "CleanStep 3" << endl;
     700#endif
    679701    CleanStep3();
     702#ifdef DEBUG
     703    *fLog << all << "Done." << endl;
     704#endif
    680705
    681706    return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.