Ignore:
Timestamp:
02/15/05 16:18:28 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r5690 r6489  
    339339                           const char *name, const char *title)
    340340    : fCleaningMethod(kStandard), fCleanLvl1(lvl1),
    341     fCleanLvl2(lvl2), fCleanRings(1), fNamePedPhotCam(gsNamePedPhotCam),
    342     fNameGeomCam(gsNameGeomCam), fNameCerPhotEvt(gsNameCerPhotEvt)
    343 
     341    fCleanLvl2(lvl2), fCleanRings(1), fKeepSinglePixels(kFALSE),
     342    fNamePedPhotCam(gsNamePedPhotCam), fNameGeomCam(gsNameGeomCam),
     343    fNameCerPhotEvt(gsNameCerPhotEvt)
    344344{
    345345    fName  = name  ? name  : gsDefName.Data();
     
    386386//
    387387//  Check if the survived pixel have a neighbor, that also
    388 //  survived, otherwise set pixel to unused (removes pixels without
    389 //  neighbors).
    390 //
    391 void MImgCleanStd::CleanStep2()
    392 {
     388//  survived. Set all single pixels Unused if !fKeepSinglePixels. Now we
     389//  declare all pixels that survived previous CleanSteps as CorePixels.
     390//  Return number of single pixels, and there cumulative size in size.
     391//
     392Short_t MImgCleanStd::CleanStep2(Float_t &size)
     393{
     394    Short_t n=0;
     395    size = 0;
     396
    393397    MCerPhotPix *pix;
    394398
     
    420424        }
    421425
    422         if (hasNeighbor == kFALSE)
    423             pix->SetPixelUnused();
    424     }
    425 
    426     //
    427     // now we declare all pixels that survive as CorePixels
    428     //
     426        if (hasNeighbor == kFALSE)
     427        {
     428            if (!fKeepSinglePixels)
     429                pix->SetPixelUnused();
     430            size += pix->GetNumPhotons();
     431            n++;
     432        }
     433    }
    429434
    430435    Next.Reset();
     
    434439            pix->SetPixelCore();
    435440    }
     441
     442    return n;
    436443}
    437444
     
    613620    *fLog << all << "CleanStep 2" << endl;
    614621#endif
    615     CleanStep2();
     622    Float_t size;
     623    const Short_t n = CleanStep2(size);
     624    fEvt->SetSinglePixels(n, size);
    616625
    617626    // For speed reasons skip the rest of the cleaning if no
     
    812821    if (gsNameCerPhotEvt!=fNameCerPhotEvt)
    813822        out << "   " << GetUniqueName() << ".SetNameCerPhotEvt(\"" << fNameCerPhotEvt << "\");" << endl;
     823    if (fKeepSinglePixels)
     824        out << "   " << GetUniqueName() << ".SetKeepSinglePixels();" << endl;
     825
    814826}
    815827
     
    821833//   MImgCleanStd.CleanMethod: Standard, Scaled, Democratic, Probability, Absolute
    822834//   MImgCleanStd.CleanRings:  1
     835//   MImgCleanStd.KeepSinglePixels: yes, no
    823836//
    824837Int_t MImgCleanStd::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     
    839852        rc = kTRUE;
    840853        fCleanLvl2 = GetEnvValue(env, prefix, "CleanLevel2", fCleanLvl2);
     854    }
     855    if (IsEnvDefined(env, prefix, "KeepSinglePixels", print))
     856    {
     857        rc = kTRUE;
     858        fKeepSinglePixels = GetEnvValue(env, prefix, "KeepSinglePixels", fKeepSinglePixels);
    841859    }
    842860
Note: See TracChangeset for help on using the changeset viewer.