Changeset 4633


Ignore:
Timestamp:
08/16/04 17:17:27 (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/MBadPixelsTreat.cc

    r4608 r4633  
    5656#include <fstream>
    5757
     58#include <TEnv.h>
    5859#include <TArrayD.h>
    5960
     
    579580    if (TESTBIT(fFlags, kUseCentralPixel))
    580581        out << "   " << GetUniqueName() << ".SetUseCentralPixel();" << endl;
    581 }
     582    if (TESTBIT(fFlags, kProcessRMS))
     583        out << "   " << GetUniqueName() << ".SetProcessRMS();" << endl;
     584    if (TESTBIT(fFlags, kHardTreatment))
     585        out << "   " << GetUniqueName() << ".SetHardTreatment();" << endl;
     586    if (fNumMinNeighbors!=3)
     587        out << "   " << GetUniqueName() << ".SetNumMinNeighbors(" << (int)fNumMinNeighbors << ");" << endl;
     588}
     589
     590// --------------------------------------------------------------------------
     591//
     592// Read the setup from a TEnv, eg:
     593//   MBadPixelsCalc.UseInterpolation: no
     594//   MBadPixelsCalc.UseCentralPixel:  no
     595//   MBadPixelsCalc.HardTreatment:    no
     596//   MBadPixelsCalc.ProcessRMS:       no
     597//   MBadPixelsCalc.NumMinNeighbors:  3
     598//
     599Int_t MBadPixelsTreat::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     600{
     601    Bool_t rc = kFALSE;
     602    if (IsEnvDefined(env, prefix, "UseInterpolation"))
     603    {
     604        rc = kTRUE;
     605        SetUseInterpolation(GetEnvValue(env, prefix, "UseInterpolation", IsUseInterpolation()));
     606    }
     607    if (IsEnvDefined(env, prefix, "UseCentralPixel"))
     608    {
     609        rc = kTRUE;
     610        SetUseCentralPixel(GetEnvValue(env, prefix, "UseCentralPixel", IsUseCentralPixel()));
     611    }
     612    if (IsEnvDefined(env, prefix, "HardTreatment"))
     613    {
     614        rc = kTRUE;
     615        SetHardTreatment(GetEnvValue(env, prefix, "HardTreatment", IsHardTreatment()));
     616    }
     617    if (IsEnvDefined(env, prefix, "ProcessRMS"))
     618    {
     619        rc = kTRUE;
     620        SetProcessRMS(GetEnvValue(env, prefix, "ProcessRMS", IsProcessRMS()));
     621    }
     622    if (IsEnvDefined(env, prefix, "NumMinNeighbors"))
     623    {
     624        rc = kTRUE;
     625        SetNumMinNeighbors(GetEnvValue(env, prefix, "NumMinNeighbors", fNumMinNeighbors));
     626    }
     627    return rc;
     628}
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h

    r4586 r4633  
    2828        kUseCentralPixel  = 2,
    2929        kProcessRMS       = 3,
    30         kHardTreatment  = 4
     30        kHardTreatment    = 4
    3131    };
    3232
     
    3737
    3838    void   Unmap() const;
    39     void   StreamPrimitive(ofstream &out) const;
     39    Bool_t IsPixelBad(Int_t idx) const;
    4040
    4141    Bool_t ReInit(MParList *pList);
    4242    Int_t  PreProcess(MParList *pList);
    4343    Int_t  Process();
    44 
    45     Bool_t IsPixelBad(Int_t idx) const;
     44    Int_t  ReadEnv(const TEnv &env, TString prefix, Bool_t print);
     45    void   StreamPrimitive(ofstream &out) const;
    4646
    4747public:
     
    6464        b ? SETBIT(fFlags, kHardTreatment) : CLRBIT(fFlags, kHardTreatment);
    6565    }
     66
     67    Bool_t IsHardTreatment() const    { return TESTBIT(fFlags, kHardTreatment); }
     68    Bool_t IsProcessRMS() const       { return TESTBIT(fFlags, kProcessRMS); }
     69    Bool_t IsUseCentralPixel() const  { return TESTBIT(fFlags, kUseCentralPixel); }
     70    Bool_t IsUseInterpolation() const { return TESTBIT(fFlags, kUseInterpolation); }
     71
    6672    void SetNumMinNeighbors(Byte_t num) { fNumMinNeighbors=num; }
    6773    void SetNamePedPhotContainer(const char *name)    { fNamePedPhotContainer = name; }
Note: See TracChangeset for help on using the changeset viewer.