Ignore:
Timestamp:
09/12/05 16:35:04 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mgui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mgui/MCamEvent.cc

    r4577 r7349  
    5555    InitSize(geom.GetNumPixels());
    5656}
     57
     58// --------------------------------------------------------------------------
     59//
     60// Return the mean of all corresponding GetPixelContent
     61//
     62Double_t MCamEvent::GetCameraMean(const MGeomCam &cam, Int_t type) const
     63{
     64    Int_t    num  = 0;
     65    Double_t mean = 0;
     66    for (unsigned int i=0; i<cam.GetNumPixels(); i++)
     67    {
     68        Double_t val;
     69        if (!GetPixelContent(val, i, cam, type))
     70            continue;
     71
     72        mean += val;
     73        num ++;
     74    }
     75    return num == 0 ? 0 : mean/num;
     76}
  • trunk/MagicSoft/Mars/mgui/MCamEvent.h

    r4577 r7349  
    1717    virtual void   InitSize(const UInt_t i) { } // Used by MGeomApply see Init()
    1818
     19    virtual Double_t GetCameraMean(const MGeomCam &cam, Int_t type=0) const;
     20
    1921    ClassDef(MCamEvent, 0) // A camera event
    2022};
Note: See TracChangeset for help on using the changeset viewer.