Ignore:
Timestamp:
01/21/02 20:52:12 (23 years ago)
Author:
rkb
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mgui
Files:
2 edited

Legend:

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

    r1082 r1203  
    1111
    1212#include "MHexagon.h"
     13
     14#include "MGeomPix.h"
    1315#include "MGeomCam.h"
    1416
     
    2729    : fAutoScale(kTRUE), fMinPhe(-2), fMaxPhe(50), fW(0), fH(0), fDrawingPad(NULL)
    2830{
     31    fGeomCam = geom; // FIXME: Clone doesn't work! (MGeomCam*)geom->Clone();
     32
    2933    //
    3034    //  create the hexagons of the display
     
    8084    delete fLegend;
    8185    delete fLegText;
    82 }
    83 
    84 inline void MCamDisplay::SetPixColor(const MCerPhotPix &pix)
    85 {
    86     (*this)[pix.GetPixId()].SetFillColor(GetColor(pix.GetNumPhotons()));
     86
     87    delete fGeomCam;
     88}
     89
     90inline void MCamDisplay::SetPixColor(const MCerPhotPix &pix, const Int_t i)
     91{
     92    //
     93    // Fixme: Divide pnum by the (real) area of the pixel
     94    //
     95
     96    const Float_t ratio = (*fGeomCam)[0].GetA()/(*fGeomCam)[i].GetA();
     97    const Float_t pnum  = ratio*pix.GetNumPhotons();
     98
     99    (*this)[pix.GetPixId()].SetFillColor(GetColor(pnum));
    87100}
    88101
     
    221234    if (fAutoScale)
    222235    {
    223         fMinPhe = event->GetNumPhotonsMin();
    224         fMaxPhe = event->GetNumPhotonsMax();
     236        fMinPhe = event->GetNumPhotonsMin(fGeomCam);
     237        fMaxPhe = event->GetNumPhotonsMax(fGeomCam);
    225238
    226239        if (fMaxPhe < 20.)
     
    242255            continue;
    243256
    244         SetPixColor(pix);
     257        SetPixColor(pix, i);
    245258    }
    246259
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.h

    r1023 r1203  
    2121{
    2222private:
     23    MGeomCam      *fGeomCam;     // pointer to camera geometry
     24
    2325    Bool_t         fAutoScale;   // indicating the autoscale function
    2426
     
    4244    MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); }
    4345
    44     void  SetPixColor(const MCerPhotPix &pix);
     46    void  SetPixColor(const MCerPhotPix &pix, const Int_t i);
    4547    Int_t GetColor(Float_t wert);
    4648
Note: See TracChangeset for help on using the changeset viewer.