Ignore:
Timestamp:
03/31/03 10:37:56 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
8 edited

Legend:

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

    r1647 r1880  
    414414}
    415415
     416void MImgCleanStd::SetLvl1(Float_t lvl)
     417{
     418    fCleanLvl1 = lvl;
     419    *fLog << inf << "Cleaning level 1 set to " << lvl << " sigma." << endl;
     420}
     421
     422void MImgCleanStd::SetLvl2(Float_t lvl)
     423{
     424    fCleanLvl2 = lvl;
     425    *fLog << inf << "Cleaning level 2 set to " << lvl << " sigma." << endl;
     426}
     427
    416428// --------------------------------------------------------------------------
    417429//
     
    433445    {
    434446    case kImgCleanLvl1:
    435         fCleanLvl1 = lvl;
    436         *fLog << "Cleaning level 1 set to " << lvl << " sigma." << endl;
     447        SetLvl1(lvl);
    437448        return kTRUE;
    438449
    439450    case kImgCleanLvl2:
    440         fCleanLvl2 = lvl;
    441         *fLog << "Cleaning level 2 set to " << lvl << " sigma." << endl;
     451        SetLvl2(lvl);
    442452        return kTRUE;
    443453    }
     
    465475    out << ");" << endl;
    466476}
     477
     478// --------------------------------------------------------------------------
     479//
     480// Read the setup from a TEnv:
     481//   Float_t fCleanLvl1: CleaningLevel1
     482//   Float_t fCleanLvl2: CleaningLevel2
     483//
     484Bool_t MImgCleanStd::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     485{
     486    Bool_t rc = kTRUE;
     487    if (!IsEnvDefined(env, prefix, "CleaningLevel1", print))
     488        rc = kFALSE;
     489    else
     490    {
     491        SetLvl1(GetEnvValue(env, prefix, "CleaningLevel1", fCleanLvl1));
     492        if (fCleanLvl1<0)
     493        {
     494            *fLog << err << "ERROR - Negative values for Cleaning Level 1 forbidden." << endl;
     495            return kERROR;
     496        }
     497    }
     498
     499    if (!IsEnvDefined(env, prefix, "CleaningLevel2", print))
     500        rc = kFALSE;
     501    else
     502    {
     503        SetLvl2(GetEnvValue(env, prefix, "CleaningLevel2", fCleanLvl2));
     504        if (fCleanLvl2<0)
     505        {
     506            *fLog << err << "ERROR - Negative values for Cleaning Level 2 forbidden." << endl;
     507            return kERROR;
     508        }
     509    }
     510
     511    return rc;
     512}
  • trunk/MagicSoft/Mars/manalysis/MImgCleanStd.h

    r1540 r1880  
    2020    Float_t fCleanLvl2;
    2121
     22    void SetLvl1(Float_t lvl);
     23    void SetLvl2(Float_t lvl);
     24
    2225    void CreateGuiElements(MGGroupFrame *f);
    2326    void StreamPrimitive(ofstream &out) const;
     
    4043
    4144    Bool_t ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2);
     45    Bool_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
    4246
    4347    ClassDef(MImgCleanStd, 0)    // task doing a standard image cleaning
  • trunk/MagicSoft/Mars/manalysis/MNewImagePar.cc

    r1872 r1880  
    7272                          const MHillas *hillas)
    7373{
    74     fHillas = hillas;
     74    //fHillas = (MHillas*)hillas;
    7575
    7676    const UInt_t npixevt = evt.GetNumPixels();
     
    9696    }
    9797
    98 
    99     fLeakage1 = edgepix1 / fHillas->GetSize();
    100     fLeakage2 = edgepix2 / fHillas->GetSize();
     98    fLeakage1 = edgepix1 / hillas->GetSize();
     99    fLeakage2 = edgepix2 / hillas->GetSize();
    101100
    102101    SetReadyToSave();
  • trunk/MagicSoft/Mars/manalysis/MNewImagePar.h

    r1872 r1880  
    1111{
    1212private:
    13     const MHillas    *fHillas; //! Input parameters
    14     const MSrcPosCam *fSrcPos; //! Source position in the camera
    15 
    1613    Float_t fLeakage1;   // (photons in most outer ring of pixels) over fSize
    1714    Float_t fLeakage2;   // (photons in the 2 outer rings of pixels) over fSize
     
    2017    MNewImagePar(const char *name=NULL, const char *title=NULL);
    2118
    22     void SetSrcPos(const MSrcPosCam *pos) { fSrcPos = pos; }
    23     const MSrcPosCam *GetSrcPos() const   { return fSrcPos; }
     19    //    void SetSrcPos(MSrcPosCam *pos) { fSrcPos = pos; }
     20    //    const MSrcPosCam *GetSrcPos() const   { return fSrcPos; }
    2421
    2522    void Reset();
  • trunk/MagicSoft/Mars/manalysis/MNewImageParCalc.cc

    r1872 r1880  
    107107        return kFALSE;
    108108
    109     fNewImagePar->SetSrcPos(fSrcPos);
    110 
    111109    fErrors = 0;
    112110
  • trunk/MagicSoft/Mars/manalysis/MNewImageParCalc.h

    r1872 r1880  
    1515{
    1616private:
    17     const MGeomCam    *fGeomCam;
    18     const MCerPhotEvt *fCerPhotEvt;
     17    MGeomCam    *fGeomCam;
     18    MCerPhotEvt *fCerPhotEvt;
    1919
    2020    MHillas      *fHillas;       //! Pointer to the source independent hillas parameters
  • trunk/MagicSoft/Mars/manalysis/MRanForest.cc

    r1871 r1880  
    288288
    289289    // give running output
    290     TString str=Form("%.2f",100.*fErr);
    291     cout.width(5);  cout<<fTreeNo;
    292     cout.width(15); cout<<str<<endl;
     290    cout << setw(5) << fTreeNo << setw(15) << Form("%.2f",100.*fErr) << endl;
    293291
    294292    // adding tree to forest
  • trunk/MagicSoft/Mars/manalysis/MSigmabar.cc

    r1748 r1880  
    9191  Int_t outerPixels[6]       = {0,0,0,0,0,0};
    9292
    93   Int_t currentSector;
    94   Float_t angle;
    95  
    9693  // sum up sigma**2 for each sector, separately for inner and outer region;
    9794  // all pixels are renormalized to the area of pixel 0
     
    117114
    118115      Int_t j = cerpix.GetPixId();
    119       Double_t Area = geom.GetPixRatio(j);
     116      Double_t area = geom.GetPixRatio(j);
    120117
    121118      const MGeomPix    &gpix = geom[j];
     
    125122      //if (angle<0.0) angle+=6.0;
    126123
    127       angle = 6.0*atan2(gpix.GetY(),gpix.GetX()) / (2.0*TMath::Pi());
    128       if (angle<0.0) angle+=6.0;
    129       currentSector=(Int_t)angle;
     124      Float_t angle = atan2(gpix.GetY(),gpix.GetX())*6 / (TMath::Pi()*2);
     125      if (angle<0) angle+=6;
     126
     127      Int_t currentSector=(Int_t)angle;
    130128       
    131129      // count only those pixels which have a sigma != 0.0
     
    134132      if ( sigma != 0.0 )
    135133      { 
    136         if (Area < 1.5)
     134        if (area < 1.5)
    137135        {
    138136          innerPixels[currentSector]++;
    139           innerSquaredSum[currentSector]+= sigma*sigma / Area;
     137          innerSquaredSum[currentSector]+= sigma*sigma / area;
    140138        }
    141139        else
    142140        {
    143141          outerPixels[currentSector]++;
    144           outerSquaredSum[currentSector]+= sigma*sigma / Area;
     142          outerSquaredSum[currentSector]+= sigma*sigma / area;
    145143        }
    146144      }
     
    191189  }
    192190   
    193   return (fSigmabar);
     191  return fSigmabar;
    194192}
    195193
Note: See TracChangeset for help on using the changeset viewer.