Changeset 11086


Ignore:
Timestamp:
06/21/11 10:17:40 (13 years ago)
Author:
tbretz
Message:
Make sure that gPad is always set correctly; replaces gPad by canv where possible in slot_RootEventProcess; do only AbsPixelToX/Y; added warning output if the mapping files are not well read.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/FactGui.h

    r11085 r11086  
    187187        gStyle->SetPalette(fPalette.size(), fPalette.data());
    188188
    189 
    190189        const double r   = double(gPad->GetWw())/gPad->GetWh();
    191190        const double max = 20.5; // 20.5 rings in x and y
     
    196195            gPad->Range(-max, -max/r, max, max/r);
    197196
     197        Double_t x1, x2, y1, y2;
     198        gPad->GetRange(x1, x2, y1, y2);
     199
    198200        double dmin = fData[0];
    199201        double dmax = fData[0];
     
    212214        const double min   = dmin;
    213215        const double scale = dmax==dmin ? 1 : dmax-dmin;
    214 
    215 //        const double min   = fData.min();
    216 //        const double scale = fData.max()==fData.min() ? 1 : fData.max()-fData.min();
    217216
    218217        TAttFill fill(0, 1001);
     
    314313        static string       str;
    315314
    316         const float x = gPad->PadtoX(gPad->AbsPixeltoX(px));
    317         const float y = gPad->PadtoY(gPad->AbsPixeltoY(py));
     315        const float x = gPad->AbsPixeltoX(px);
     316        const float y = gPad->AbsPixeltoY(py);
    318317
    319318        const int idx = GetIdx(x, y);
     
    331330    Int_t DistancetoPrimitive(Int_t px, Int_t py)
    332331    {
    333         const float x = gPad->PadtoX(gPad->AbsPixeltoX(px));
    334         const float y = gPad->PadtoY(gPad->AbsPixeltoY(py));
     332        const float x = gPad->AbsPixeltoX(px);
     333        const float y = gPad->AbsPixeltoY(py);
    335334
    336335        return GetIdx(x, y)>=0 ? 0 : 99999;
     
    18601859
    18611860#ifdef HAVE_ROOT
    1862     void slot_RootEventProcessed(TObject *obj, unsigned int evt, TCanvas *)
     1861    void slot_RootEventProcessed(TObject *obj, unsigned int evt, TCanvas *canv)
    18631862    {
    18641863        // kMousePressEvent       // TCanvas processed QEvent mousePressEvent
     
    18781877            if (dynamic_cast<Camera*>(obj))
    18791878            {
    1880                 const float xx = gPad->PadtoX(gPad->AbsPixeltoX(tipped->GetEventX()));
    1881                 const float yy = gPad->PadtoY(gPad->AbsPixeltoY(tipped->GetEventY()));
     1879                const float xx = canv->AbsPixeltoX(tipped->GetEventX());
     1880                const float yy = canv->AbsPixeltoY(tipped->GetEventY());
    18821881
    18831882                Camera *cam = static_cast<Camera*>(obj);
     
    18941893            if (dynamic_cast<Camera*>(obj))
    18951894            {
    1896                 const float xx = gPad->PadtoX(gPad->AbsPixeltoX(tipped->GetEventX()));
    1897                 const float yy = gPad->PadtoY(gPad->AbsPixeltoY(tipped->GetEventY()));
     1895                const float xx = canv->AbsPixeltoX(tipped->GetEventX());
     1896                const float yy = canv->AbsPixeltoY(tipped->GetEventY());
    18981897
    18991898                Camera *cam = static_cast<Camera*>(obj);
     
    19201919        // our own GetObjectInfo which make everything a bit more
    19211920        // complicated.
     1921        canv->cd();
    19221922#if ROOT_VERSION_CODE > ROOT_VERSION(5,22,00)
    19231923        const char *objectInfo =
     
    19371937        if (dynamic_cast<Camera*>(obj))
    19381938        {
    1939             const float xx = gPad->PadtoX(gPad->AbsPixeltoX(tipped->GetEventX()));
    1940             const float yy = gPad->PadtoY(gPad->AbsPixeltoY(tipped->GetEventY()));
     1939            const float xx = canv->AbsPixeltoX(tipped->GetEventX());
     1940            const float yy = canv->AbsPixeltoY(tipped->GetEventY());
    19411941
    19421942            Camera *cam = static_cast<Camera*>(obj);
     
    22212221        }
    22222222
     2223        if (l!=160)
     2224            cerr << "WARNING - Problems reading Trigger-Patches.txt" << endl;
     2225
    22232226        // --------------------------------------------------------------------------
    22242227
     
    22492252        }
    22502253
     2254        if (l!=1440)
     2255            cerr << "WARNING - Problems reading MasterList-v3.txt" << endl;
     2256
    22512257        // --------------------------------------------------------------------------
    22522258
     
    22752281            l++;
    22762282        }
     2283
     2284        if (l!=160)
     2285            cerr << "WARNING - Problems reading PatchList.txt" << endl;
    22772286
    22782287        // --------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.