Ignore:
Timestamp:
10/22/03 20:59:40 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r2416 r2421  
    818818// ------------------------------------------------------------------------
    819819//
    820 // Fill the colors in respect to the cleaning levels
    821 //
    822 void MHCamera::FillLevels(const MCerPhotEvt &event, Float_t lvl1, Float_t lvl2)
     820// The array must be in increasing order, eg: 2.5, 3.7, 4.9
     821// The values in each bin are replaced by the interval in which the value
     822// fits. In the example we have four intervals
     823// (<2.5, 2.5-3.7, 3.7-4.9, >4.9). Maximum and minimum are set
     824// accordingly.
     825//
     826void MHCamera::SetLevels(const TArrayF &arr)
    823827{
    824828    if (fNcells<=1)
    825829        return;
    826 
    827     SetCamContent(event, 2);
    828830
    829831    for (Int_t i=0; i<fNcells-2; i++)
     
    832834            continue;
    833835
    834         if (fArray[i+1]>lvl1)
    835             fArray[i+1] = 0;
    836         else
    837             if (fArray[i+1]>lvl2)
    838                 fArray[i+1] = 1;
    839             else
    840                 fArray[i+1] = 2;
    841     }
    842 }
    843 
    844 // ------------------------------------------------------------------------
    845 //
    846 // Fill the colors in respect to the cleaning levels
    847 //
    848 void MHCamera::FillLevels(const MCerPhotEvt &event, const MImgCleanStd &clean)
    849 {
    850     FillLevels(event, clean.GetCleanLvl1(), clean.GetCleanLvl2());
     836        Int_t j = arr.GetSize();
     837        while (j && fArray[i+1]<arr[j-1])
     838            j--;
     839
     840        fArray[i+1] = j;
     841    }
     842    SetMaximum(arr.GetSize());
     843    SetMinimum(0);
    851844}
    852845
  • trunk/MagicSoft/Mars/mhist/MHCamera.h

    r2409 r2421  
    138138    Double_t GetMaximum() const { return GetMaximum(0/*kTRUE*/); }
    139139
    140     void  FillLevels(const MCerPhotEvt &event, Float_t lvl1, Float_t lvl2);
    141     void  FillLevels(const MCerPhotEvt &event, const MImgCleanStd &clean);
     140    void SetLevels(const TArrayF &arr);
    142141
    143142    void  FillRandom(const char *fname, Int_t ntimes=5000) { TH1::FillRandom(fname, ntimes); }
     
    152151    void  Reset() { Reset(""); } // *MENU*
    153152    TH1  *DrawCopy() const/* { gPad=NULL; return TH1D::DrawCopy(); }*/; // *MENU*
     153    TH1  *DrawCopy(Option_t *o) const { return TH1D::DrawCopy(o); }
    154154
    155155    void  Print(Option_t *) const;
  • trunk/MagicSoft/Mars/mhist/MHMatrix.cc

    r2419 r2421  
    126126//
    127127Bool_t MHMatrix::SetNumRow(Int_t row)
    128     {
    129       if (row>=fM.GetNrows() || row<0) return kFALSE;
    130       fRow = row;
    131       return kTRUE;
    132     }
    133 
     128{
     129    if (row>=fM.GetNrows() || row<0) return kFALSE;
     130    fRow = row;
     131    return kTRUE;
     132}
    134133
    135134// --------------------------------------------------------------------------
     
    11911190    return kTRUE;
    11921191}
    1193 
Note: See TracChangeset for help on using the changeset viewer.