Ignore:
Timestamp:
05/02/03 08:56:31 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mimage
Files:
2 edited

Legend:

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

    r2040 r2052  
    285285//
    286286MImgCleanStd::MImgCleanStd(const Float_t lvl1, const Float_t lvl2,
    287                      const char *name, const char *title)
     287                           const char *name, const char *title)
    288288    : fSgb(NULL), fCleaningMethod(kStandard), fCleanLvl1(lvl1),
    289289    fCleanLvl2(lvl2), fCleanRings(1)
     
    324324        MCerPhotPix &pix = (*fEvt)[i];
    325325
    326         const Float_t entry = pix.GetNumPhotons();
    327         const Float_t noise = pix.GetErrorPhot();
    328 
    329326        const Int_t id = pix.GetPixId();
     327
     328        const Float_t  entry = pix.GetNumPhotons();
     329        const Float_t  noise = pix.GetErrorPhot();
    330330        const Double_t ratio = TMath::Sqrt(fCam->GetPixRatio(id));
    331331
    332332        // COBB: '<=' to skip entry=noise=0
    333         if (entry <= fCleanLvl1 * noise / ratio)
     333        if (entry * ratio <= fCleanLvl1 * noise)
    334334            pix.SetPixelUnused();
    335335
     
    366366        MCerPhotPix &pix = (*fEvt)[i];
    367367
    368         const Float_t entry = pix.GetNumPhotons();
    369 
    370368        const Int_t id = pix.GetPixId();
    371369
     370        const Float_t  entry = pix.GetNumPhotons();
    372371        const Double_t ratio = fCam->GetPixRatio(id);
    373372
    374373        // COBB: '<=' to skip entry=noise=0
    375         if (entry <= fCleanLvl1 * fInnerNoise / ratio)
     374        if (entry * ratio <= fCleanLvl1 * fInnerNoise)
    376375            pix.SetPixelUnused();
    377376
     
    451450            const Int_t id2 = gpix.GetNeighbor(j);
    452451
    453             // when you find an used  neighbor, break the loop
     452            // when you find an used neighbor, break the loop
    454453            if (ispixused[id2] == 1)
    455454            {
    456                 hasNeighbor = kTRUE ;
     455                hasNeighbor = kTRUE;
    457456                break;
    458457            }
     
    460459       
    461460        if (hasNeighbor == kFALSE)
    462           pix.SetPixelUnused();
     461            pix.SetPixelUnused();
    463462    }
    464463
     
    493492    // check the num of photons against the noise level
    494493    //
    495     const Float_t entry = pix.GetNumPhotons();
    496     const Float_t noise = pix.GetErrorPhot();
    497 
     494    const Float_t  entry = pix.GetNumPhotons();
     495    const Float_t  noise = pix.GetErrorPhot();
    498496    const Double_t ratio = TMath::Sqrt(fCam->GetPixRatio(id));
    499497
    500     return (entry <= fCleanLvl2 * noise / ratio);
     498    return (entry * ratio <= fCleanLvl2 * noise);
    501499}
    502500
     
    517515    // check the num of photons against the noise level
    518516    //
    519     const Float_t entry = pix.GetNumPhotons();
    520 
     517    const Float_t  entry = pix.GetNumPhotons();
    521518    const Double_t ratio = fCam->GetPixRatio(id);
    522519
    523     return (entry <= fCleanLvl2 * fInnerNoise / ratio);
     520    return (entry * ratio <= fCleanLvl2 * fInnerNoise);
    524521}
    525522
     
    583580
    584581        pix.SetRing(r);
    585             break;
     582        break;
    586583    }
    587584}
     
    819816    }
    820817    out << ");" << endl;
    821 }
     818
     819    if (fCleaningMethod!=kDemocratic)
     820        return;
     821
     822    out << "   " << GetUniqueName() << ".SetMethod(MImgCleanStd::kDemocratic);" << endl;
     823
     824    if (fCleanRings==1)
     825        return;
     826
     827    out << "   " << GetUniqueName() << ".SetCleanRings(" << fCleanRings << ");" << endl;
     828}
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.h

    r2038 r2052  
    6262    UShort_t GetCleanRings() const { return fCleanRings;}
    6363
    64     void SetCleanRings(UShort_t r) { fCleanRings=r; }
     64    void SetCleanRings(UShort_t r) { if(r==0) r=1; fCleanRings=r; }
    6565    void SetMethod(CleaningMethod_t m) { fCleaningMethod = m; }
    6666
Note: See TracChangeset for help on using the changeset viewer.