Changeset 3142 for trunk


Ignore:
Timestamp:
02/13/04 16:52:50 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3141 r3142  
    7979   * macros/readMagic.C:
    8080     - changed to use MInteractiveTask
     81
     82   * mbase/MPrint.cc:
     83     - fixed debugging level of some output
     84     
     85   * mhist/MHCamera.[h,cc]:
     86     - fixed handling in AddNotify (necessayr due to change of
     87       inheritance from MCamEvent)
     88     - replaced cout by gLog
     89     - added fNotify to list of cleanups
     90
     91   * mhist/MHEvent.cc, mjobs/MJCalibration.cc,
     92     mjobs/MJPedestal.cc:
     93     - fixed usage of AddNotify
    8194
    8295
  • trunk/MagicSoft/Mars/mbase/MPrint.cc

    r2580 r3142  
    131131    // If it couldn't get found stop Eventloop
    132132    //
    133     *fLog << err << dbginf << fObjName << " not found... ";
    134133    if (TestBit(kSkip))
    135134    {
    136         *fLog << "removing task from list." << endl;
     135        *fLog << warn << fObjName << " not found... removing task from list." << endl;
    137136        return kSKIP;
    138137    }
    139138    else
    140139    {
    141         *fLog << "aborting." << endl;
     140        *fLog << err << fObjName << " not found... aborting." << endl;
    142141        return kFALSE;
    143142    }
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r2947 r3142  
    3535// Be carefull: Entries in this context means Entries/bin or Events
    3636//
     37// FIXME? Maybe MHCamera can take the fLog object from MGeomCam?
     38//
    3739////////////////////////////////////////////////////////////////////////////
    3840#include "MHCamera.h"
     
    8385
    8486    fNotify  = new TList;
     87    fNotify->SetBit(kMustCleanup);
     88    gROOT->GetListOfCleanups()->Add(fNotify);
    8589
    8690#if ROOT_VERSION_CODE < ROOT_VERSION(3,01,06)
     
    611615void MHCamera::Print(Option_t *) const
    612616{
    613     cout << "Minimum: " << GetMinimum();
     617    gLog << all << "Minimum: " << GetMinimum();
    614618    if (fMinimum==-1111)
    615         cout << " <autoscaled>";
    616     cout << endl;
    617     cout << "Maximum: " << GetMaximum();
     619        gLog << " <autoscaled>";
     620    gLog << endl;
     621    gLog << "Maximum: " << GetMaximum();
    618622    if (fMaximum==-1111)
    619         cout << " <autoscaled>";
    620     cout << endl;
     623        gLog << " <autoscaled>";
     624    gLog << endl;
    621625}
    622626
     
    718722    if (ncolors>1 && ncolors<50)
    719723    {
    720         cout << "MHCamera::SetPalette: Only default palettes with 50 colors are allowed... ignored." << endl;
     724        gLog << err << "MHCamera::SetPalette: Only default palettes with 50 colors are allowed... ignored." << endl;
    721725        return;
    722726    }
     
    11571161void MHCamera::SavePrimitive(ofstream &out, Option_t *opt)
    11581162{
    1159     cout << "MHCamera::SavePrimitive: Must be rewritten!" << endl;
     1163    gLog << err << "MHCamera::SavePrimitive: Must be rewritten!" << endl;
    11601164    /*
    11611165    if (!gROOT->ClassSaved(TCanvas::Class()))
     
    12571261// ------------------------------------------------------------------------
    12581262//
     1263// Add a MCamEvent which should be displayed when the user clicks on a
     1264// pixel.
     1265// Warning: The object MUST inherit from TObject AND MCamEvent
     1266//
     1267void MHCamera::AddNotify(TObject *obj)
     1268{
     1269    // Make sure, that the object derives from MCamEvent!
     1270    MCamEvent *evt = dynamic_cast<MCamEvent*>(obj);
     1271    if (!evt)
     1272    {
     1273        gLog << err << "ERROR: MHCamera::AddNotify - TObject doesn't inherit from MCamEvent... ignored." << endl;
     1274        return;
     1275    }
     1276
     1277    // Make sure, that it is deleted from the list too, if the obj is deleted
     1278    obj->SetBit(kMustCleanup);
     1279
     1280    // Add object to list
     1281    fNotify->Add(obj);
     1282}
     1283
     1284// ------------------------------------------------------------------------
     1285//
    12591286// Execute a mouse event on the camera
    12601287//
     
    12751302        return;
    12761303
    1277     cout << GetTitle() << " <" << GetName() << ">" << endl;
    1278     cout << "Software Pixel Index: " << idx << endl;
    1279     cout << "Hardware Pixel Id:    " << idx+1 << endl;
    1280     cout << "Contents:             " << GetBinContent(idx+1);
     1304    gLog << all << GetTitle() << " <" << GetName() << ">" << endl;
     1305    gLog << "Software Pixel Index: " << idx << endl;
     1306    gLog << "Hardware Pixel Id:    " << idx+1 << endl;
     1307    gLog << "Contents:             " << GetBinContent(idx+1);
    12811308    if (GetBinError(idx+1)>0)
    1282         cout << " +/- " << GetBinError(idx+1);
    1283     cout << "  <" << (IsUsed(idx)?"on":"off") << ">" << endl;
     1309        gLog << " +/- " << GetBinError(idx+1);
     1310    gLog << "  <" << (IsUsed(idx)?"on":"off") << ">" << endl;
    12841311
    12851312    if (fNotify && fNotify->GetSize()>0)
     
    13061333        // FIXME: Make sure, that the old histograms are really deleted.
    13071334        //        Are they already deleted?
    1308         fNotify->ForEach(MCamEvent, DrawPixelContent)(idx);
     1335
     1336        // The dynamic_cast is necessary here: We cannot use ForEach
     1337        TIter Next(fNotify);
     1338        MCamEvent *evt;
     1339        while ((evt=dynamic_cast<MCamEvent*>(Next())))
     1340            evt->DrawPixelContent(idx);
     1341
    13091342        gPad->Modified();
    13101343        gPad->Update();
  • trunk/MagicSoft/Mars/mhist/MHCamera.h

    r2894 r3142  
    179179    //void  SetOptStat(Int_t os=-1) { fOptStat = os; } // *MENU*
    180180
    181     void     AddNotify(const MCamEvent &event) { fNotify->Add((TObject*)(&event)); }
     181    void     AddNotify(TObject *event);
    182182
    183183    Stat_t   GetMean(Int_t axis=-1) const;
     
    187187
    188188    TH1D    *Projection(const char *name="_py") const;
    189 
    190     //void SetStatusBar(TGStatusBar *bar) { fStatusBar = bar; }
    191189
    192190    const MGeomCam &GetGeomCam() const { return *fGeomCam; }
  • trunk/MagicSoft/Mars/mhist/MHEvent.cc

    r2979 r3142  
    118118
    119119    fHist = new MHCamera(*cam);
    120     fHist->AddNotify(*fClone);
     120    fHist->AddNotify(fClone);
    121121
    122122    switch (fType)
     
    182182    switch (fType)
    183183    {
    184     case kEvtSignal:
     184    case kEvtSignal: // Get NumPhotons without pixel-size scaling
     185        //        fHist->SetCamContent(*event, 3);
     186        //        break;
    185187    case kEvtPedestal:
    186188        fHist->SetCamContent(*event, 0);
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r3112 r3142  
    166166void MJCalibration::CamDraw(TCanvas &c, const Int_t x, const Int_t y, const MHCamera &cam1, const Int_t fit)
    167167{
    168 
    169 
    170168    c.cd(x);
    171169    gPad->SetBorderMode(0);
    172170    MHCamera *obj1=(MHCamera*)cam1.DrawCopy("hist");
    173     obj1->AddNotify(fCalibrationCam);
     171    obj1->AddNotify(static_cast<TObject*>(&fCalibrationCam));
    174172
    175173    c.cd(x+y);
     
    177175    obj1->Draw();
    178176
    179     if (fit)
    180       {
    181         c.cd(x+2*y);
    182         gPad->SetBorderMode(0);
    183         DrawProjection(obj1, fit);
    184       }
     177    if (!fit)
     178        return;
     179
     180    c.cd(x+2*y);
     181    gPad->SetBorderMode(0);
     182    DrawProjection(obj1, fit);
    185183}
    186184
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r3069 r3142  
    174174    gPad->SetBorderMode(0);
    175175    MHCamera *obj1=(MHCamera*)cam1.DrawCopy("hist");
    176     obj1->AddNotify(fPedestalCam);
     176    obj1->AddNotify(static_cast<TObject*>(&fPedestalCam));
    177177
    178178    c.cd(x+y);
Note: See TracChangeset for help on using the changeset viewer.