Changeset 2416


Ignore:
Timestamp:
10/20/03 21:32:30 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc

    r2410 r2416  
    412412}
    413413
    414 void MCerPhotEvt::DrawPixelContent(Int_t num, TVirtualPad *pad=NULL) const
     414void MCerPhotEvt::DrawPixelContent(Int_t num) const
    415415{
    416416    *fLog << warn << "MCerPhotEvt::DrawPixelContent - not available." << endl;
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h

    r2410 r2416  
    7474
    7575    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    76     void DrawPixelContent(Int_t num, TVirtualPad *pad=NULL) const;
     76    void DrawPixelContent(Int_t num) const;
    7777
    7878    ClassDef(MCerPhotEvt, 2)    // class for an event containing cerenkov photons
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc

    r2410 r2416  
    195195}
    196196
    197 void MPedestalCam::DrawPixelContent(Int_t num, TVirtualPad *pad) const
     197void MPedestalCam::DrawPixelContent(Int_t num) const
    198198{
    199199    *fLog << warn << "MPedestalCam::DrawPixelContent - not available." << endl;
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.h

    r2410 r2416  
    3636
    3737    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    38     void DrawPixelContent(Int_t num, TVirtualPad *pad=NULL) const;
     38    void DrawPixelContent(Int_t num) const;
    3939
    4040    ClassDef(MPedestalCam, 1)   // Storage Container for all pedestal information of the camera
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r2386 r2416  
    7272#include <fstream>          // ofstream, SavePrimitive
    7373
     74#include <TRint.h>          // gApplication, TRint::Class()
    7475#include <TTime.h>          // TTime
    7576#include <TFile.h>          // gFile
     
    370371    gSystem->ProcessEvents();
    371372#else
    372     if (fDisplay)
    373         gSystem->ProcessEvents();
    374     else
    375         if (fProgress)
    376             gClient->ProcessEventsFor(fProgress);
     373    // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents
     374    if (gApplication->InheritsFrom(TRint::Class()))
     375    {
     376        if (fDisplay)
     377            gSystem->ProcessEvents();
     378        else
     379            if (fProgress)
     380                gClient->ProcessEventsFor(fProgress);
     381    }
    377382#endif
    378383
     
    469474    {
    470475        fProgress->SetPosition(maxcnt>0 ? TMath::Min(maxcnt, entries) : entries);
     476        // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents
     477        if (gApplication->InheritsFrom(TRint::Class()))
     478        {
    471479#if ROOT_VERSION_CODE < ROOT_VERSION(3,02,06)
    472         gSystem->ProcessEvents();
     480            gSystem->ProcessEvents();
    473481#else
    474         gClient->ProcessEventsFor(fDisplay ? fDisplay->GetBar() : fProgress);
     482            gClient->ProcessEventsFor(fDisplay ? fDisplay->GetBar() : fProgress);
    475483#endif
     484        }
    476485    }
    477486
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r2411 r2416  
    114114TObject *MParContainer::Clone(const char *newname) const
    115115{
     116
    116117   MParContainer *named = (MParContainer*)TObject::Clone();
    117118   if (newname && strlen(newname)) named->SetName(newname);
     
    583584    return ((TEnv&)env).GetValue(prefix, dflt);
    584585}
    585 
    586 // --------------------------------------------------------------------------
    587 //
    588 // DrawTS which is a thread safe version of Draw. Draw
    589 // are also overwritten to call DrawTS. Please overwrite
    590 // the TS version of the member function if you want to implement
    591 // Draw for your class. Classes which overwrites Draw instead
    592 // should work well, too, except in multithreaded environments like Mona.
    593 //
    594 // The static version maybe called dor any TObject. For you class it is
    595 // called with a pointer to 'this' object.
    596 //
    597 void MParContainer::DrawTS(TObject *obj, TVirtualPad *pad, Option_t *option)
    598 {
    599     if (!obj)
    600     {
    601         gLog << warn << "MParContainer::DrawTS: obj==NULL" << endl;
    602         return;
    603     }
    604 
    605     if (!pad)
    606         pad = gPad;
    607 
    608     // FIXME: Move MH to mbase
    609     //if (!pad)
    610     //    pad = MakeDefCanvas(this);
    611 
    612     if (!pad)
    613     {
    614         if (!gROOT->GetMakeDefCanvas())
    615             return;
    616         (gROOT->GetMakeDefCanvas())();
    617         pad = gPad;
    618     }
    619 
    620     if (!pad->IsEditable())
    621         return;
    622 
    623     obj->SetBit(kMustCleanup);
    624 
    625     pad->GetListOfPrimitives()->Add(obj, option);
    626     pad->Modified(kTRUE);
    627 }
    628 
    629 // --------------------------------------------------------------------------
    630 //
    631 // DrawCloneTS which is a thread safe version of DrawClone. DrawClone
    632 // are also overwritten to call DrawCloneTS. Please overwrite
    633 // the TS version of the member function if you want to implement
    634 // DrawClone for your class. Classes which overwrites DrawClone instead
    635 // should work well, too, except in multithreaded environments like Mona
    636 //
    637 // The static version maybe called dor any TObject. For you class it is
    638 // called with a pointer to 'this' object.
    639 //
    640 TObject *MParContainer::DrawCloneTS(const TObject *obj, TVirtualPad *pad, Option_t *option)
    641 {
    642     // Draw a clone of this object in the current pad
    643     if (!obj)
    644         return 0;
    645 
    646     TObject *newobj = obj->Clone();
    647     if (!newobj)
    648         return 0;
    649 
    650     /*
    651      gLog << dbg << "MParConatiner::DrawCloneTS - ";
    652      gLog << (int)newobj->InheritsFrom(MParContainer::Class()) << " ";
    653      gLog << pad << endl;
    654      */
    655     if (newobj->InheritsFrom(MParContainer::Class()))
    656         ((MParContainer*)newobj)->DrawTS(pad, strlen(option) ? option : obj->GetDrawOption());
    657     else
    658         DrawTS(newobj, pad, strlen(option) ? option : obj->GetDrawOption());
    659 
    660     return newobj;
    661 }
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r2411 r2416  
    129129    const char *GetEnvValue(const TEnv &env, TString prefix, const char *dflt) const;
    130130
    131     static  void DrawTS(TObject *obj, TVirtualPad *pad=NULL, Option_t *option="");
    132     virtual void DrawTS(TVirtualPad *pad=NULL, Option_t *option="")
    133     {
    134         DrawTS(this, pad, option);
    135     }
    136     void Draw(Option_t *option="") { DrawTS(NULL, option); }
    137 
    138     static  TObject *DrawCloneTS(const TObject *obj, TVirtualPad *pad=NULL, Option_t *option="");
    139     virtual TObject *DrawCloneTS(TVirtualPad *pad=NULL, Option_t *option="") const
    140     {
    141         return DrawCloneTS(this, pad, option);
    142     }
    143     TObject *DrawClone(Option_t *option="") const
    144     {
    145         return DrawCloneTS(NULL, option);
    146     }
    147 
    148131    ClassDef(MParContainer, 0)  //The basis for all parameter containers
    149132};
  • trunk/MagicSoft/Mars/mhist/MFillH.cc

    r2414 r2416  
    324324    const Ssiz_t length = last-first-1;
    325325
    326     //
    327     // Make a copy before stripping leading and trailing White Spaces.
    328     //
    329326    TString strip = fHName(first+1, length);
    330327    return strip.Strip(TString::kBoth);
     
    343340        return kTRUE;
    344341
     342    if (!fH->OverwritesDraw())
     343        return kTRUE;
     344
    345345    if (TestBit(kDoNotDisplay))
    346346        return kTRUE;
    347347
    348     const Bool_t dr = fH->OverwritesDraw();
    349     const Bool_t ts = fH->OverwritesDraw(NULL, "TS");
    350     if (!dr && !ts)
    351         return kTRUE;
    352 
    353     if (!ts)
    354     {
    355         *fLog << warn << "You overwrote " << fH->ClassName() << "::";
    356         *fLog << "Draw instead of " << fH->ClassName() << "::DrawTS" << endl;
    357         *fLog << "This is not thread safe and might result in trouble using" << endl;
    358         *fLog << "multithreaded programs like MONA." << endl;
    359         *fLog << "" << endl;
    360         return kTRUE;
    361     }
    362 
    363348    fCanvas = &fDisplay->AddTab(fH->GetName());
    364     fH->DrawTS(fCanvas);
    365 
    366     return kTRUE;
    367 }
    368 
    369 // --------------------------------------------------------------------------
    370 //
    371 //
    372 Bool_t MFillH::DrawCloneToDisplay()
    373 {
    374     fH->DrawCloneTS(fCanvas);
    375     fCanvas->Modified();
    376     fCanvas->Update();
     349    fH->Draw();
    377350
    378351    return kTRUE;
     
    533506    //
    534507    if (fDisplay && fDisplay->HasCanvas(fCanvas))
    535         DrawCloneToDisplay();
     508    {
     509        fCanvas->cd();
     510        fH->DrawClone("nonew");
     511        fCanvas->Modified();
     512        fCanvas->Update();
     513    }
    536514
    537515    return kTRUE;
  • trunk/MagicSoft/Mars/mhist/MFillH.h

    r2414 r2416  
    4444
    4545    Bool_t DrawToDisplay();
    46     Bool_t DrawCloneToDisplay();
    4746
    4847public:
     
    6463    Int_t PostProcess();
    6564
    66     MH *GetH() { return fH; }
    6765    TCanvas *GetCanvas() { return fCanvas; }
    6866
  • trunk/MagicSoft/Mars/mhist/MH.cc

    r2413 r2416  
    700700// Also layout the two statistic boxes and a legend.
    701701//
    702 void MH::DrawSame(TH1 &hist1, TH1 &hist2, const TString title, TVirtualPad *pad)
     702void MH::DrawSame(TH1 &hist1, TH1 &hist2, const TString title)
    703703{
    704704    //
    705705    // Draw first histogram
    706706    //
    707     if (!pad)
    708         pad = gPad;
    709 
    710     MParContainer::DrawTS(&hist1, pad);
    711     pad->SetBorderMode(0);
    712     pad->Update();
     707    hist1.Draw();
     708    gPad->SetBorderMode(0);
     709    gPad->Update();
    713710
    714711    if (hist1.GetEntries()>0 && hist2.GetEntries()>0)
     
    729726    }
    730727
    731     TPaveText *t = (TPaveText*)pad->FindObject("title");
     728    TPaveText *t = (TPaveText*)gPad->FindObject("title");
    732729    if (t)
    733730    {
     
    741738        // (see THistPainter::PaintTitle) title
    742739        //
    743         pad->Modified();  // indicates a change
    744         pad->Update();    // recreates the original title
     740        gPad->Modified();  // indicates a change
     741        gPad->Update();    // recreates the original title
    745742        t->Pop();          // bring our title on top
    746743    }
     
    750747    //
    751748    // Where to get the TPaveStats depends on the root version
    752     TPaveStats *s1 = (TPaveStats*)pad->FindObject("stats");
     749    TPaveStats *s1 = (TPaveStats*)gPad->FindObject("stats");
    753750    if (!s1)
    754751        s1 = (TPaveStats*)hist1.GetListOfFunctions()->FindObject("stats");
     
    766763    // Draw second histogram
    767764    //
    768     MParContainer::DrawTS(&hist2, pad, "sames");
    769     pad->Update();
     765    hist2.Draw("sames");
     766    gPad->Update();
    770767
    771768    //
     
    773770    //
    774771    // Where to get the TPaveStats depends on the root version
    775     TPaveStats *s2 = (TPaveStats*)pad->FindObject("stats");
     772    TPaveStats *s2 = (TPaveStats*)gPad->FindObject("stats");
    776773    if (!s2)
    777774        s2 = (TPaveStats*)hist2.GetListOfFunctions()->FindObject("stats");
     
    790787        l.SetBorderSize(s2->GetBorderSize());
    791788        l.SetBit(kCanDelete);
    792         MParContainer::DrawTS(&l, pad);
     789        l.Draw();
    793790    }
    794791}
     
    833830// to the present pad. The kCanDelete bit is set for the clone.
    834831//
    835 TObject *MH::DrawCloneTS(TVirtualPad *pad, Option_t *opt, Int_t w, Int_t h) const
     832TObject *MH::DrawClone(Option_t *opt, Int_t w, Int_t h) const
    836833{
    837834    TString option(opt);
    838835
    839     //gLog << dbg << "DrawCloneTS: Arg=" << pad << " " << gPad << endl;
    840 
    841     TVirtualPad *p = GetNewPad(option) || pad ? pad : NULL;
    842     //gLog << dbg << "DrawCloneTS: nonew&&gpad=" << p << " " << opt << endl;
    843     if (!p)
    844         p = MakeDefCanvas(this, w, h);
    845     else
    846     /*{
    847         gLog << dbg << "--> Clear" << endl;*/
    848         p->Clear();
    849     //}
    850     //gLog << dbg << "DrawCloneTS: " << p << endl;
    851 
    852     TObject *o = MParContainer::DrawCloneTS(pad, option);
    853     o->SetBit(kCanDelete);
    854     return o;
    855 }
    856 
    857 /*
    858 // --------------------------------------------------------------------------
    859 //
    860 // If the opt string contains 'nonew' or gPad is not given a new canvas
    861 // with size w/h is created. Otherwise the object is cloned and drawn
    862 // to the present pad. The kCanDelete bit is set for the clone.
    863 //
    864 TObject *MH::DrawClone(Option_t *opt, Int_t w, Int_t h) const
    865 {
    866     TString option(opt);
    867 
    868     gLog << dbg << "DrawCloneTS: Arg=" << gPad << endl;
    869 
    870     TVirtualPad *p = GetNewPad(option) ? gPad : NULL;
    871     gLog << dbg << "DrawCloneTS: nonew&&gpad=" << p << " " << opt << endl;
     836    TVirtualPad *p = GetNewPad(option);
    872837    if (!p)
    873838        p = MakeDefCanvas(this, w, h);
    874839    else
    875840        p->Clear();
    876     gLog << dbg << "DrawCloneTS: " << p << endl;
    877 
    878     TObject *o = Clone(option);
     841
     842    gROOT->SetSelectedPad(NULL);
     843
     844    TObject *o = MParContainer::DrawClone(option);
    879845    o->SetBit(kCanDelete);
    880846    return o;
    881847}
    882 */
    883848
    884849// --------------------------------------------------------------------------
     
    886851// Check whether a class inheriting from MH overwrites the Draw function
    887852//
    888 Bool_t MH::OverwritesDraw(TClass *cls, const char *ext) const
     853Bool_t MH::OverwritesDraw(TClass *cls) const
    889854{
    890855    if (!cls)
     
    900865    // Check whether the class cls overwrites Draw
    901866    //
    902     TString name("Draw");
    903     name += ext;
    904     if (cls->GetMethodAny(name))
     867    if (cls->GetMethodAny("Draw"))
    905868        return kTRUE;
    906869
     
    912875    while ((base=(TBaseClass*)NextBase()))
    913876    {
    914         if (OverwritesDraw(base->GetClassPointer(), ext))
     877        if (OverwritesDraw(base->GetClassPointer()))
    915878            return kTRUE;
    916879    }
  • trunk/MagicSoft/Mars/mhist/MH.h

    r2413 r2416  
    2222    MH(const char *name=NULL, const char *title=NULL);
    2323
    24     Bool_t OverwritesDraw(TClass *cls=NULL, const char *ext="") const;
     24    Bool_t OverwritesDraw(TClass *cls=NULL) const;
    2525
    2626    virtual Bool_t SetupFill(const MParList *pList) { return kTRUE; }
     
    6464
    6565    static void DrawSameCopy(const TH1 &hist1, const TH1 &hist2, const TString title);
    66     static void DrawSame(TH1 &hist1, TH1 &hist2, const TString title, TVirtualPad *pad=NULL);
     66    static void DrawSame(TH1 &hist1, TH1 &hist2, const TString title);
    6767
    6868    TObject *Clone(const char *name="") const;
    6969
    70     TObject *DrawClone(Option_t *opt, Int_t w, Int_t h) const
    71     {
    72         return MH::DrawCloneTS(NULL, opt, 625, 440);
    73     }
     70    TObject *DrawClone(Option_t *opt, Int_t w, Int_t h) const;
    7471    TObject *DrawClone(Option_t *opt="") const
    7572    {
    76         return MH::DrawCloneTS(NULL, opt, 625, 440);
    77     }
    78     TObject *DrawCloneTS(TVirtualPad *pad, Option_t *opt, Int_t w, Int_t h) const;
    79     TObject *DrawCloneTS(TVirtualPad *pad=NULL, Option_t *opt="") const
    80     {
    81         return MH::DrawCloneTS(pad, opt, 625, 440);
     73        return MH::DrawClone(opt, 625, 440);
    8274    }
    8375
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.cc

    r2415 r2416  
    137137}
    138138
    139 // --------------------------------------------------------------------------
    140 //
    141 // Print pixel indices which value is higher than mean+sigma*rms
    142 //
    143 void MHCamEvent::PrintOutliers(Float_t sigma) const
     139void MHCamEvent::PrintOutliers(Float_t s) const
    144140{
    145141    const Double_t mean = fSum->GetMean();
     
    153149            continue;
    154150
    155         if ((*fSum)[i+1]>mean+sigma*rms)
    156             *fLog << "Contents of Pixel-Index #" << i << ": " << (*fSum)[i+1] << " > " << sigma << "*rms" << endl;
     151        if ((*fSum)[i+1]>mean+s*rms)
     152            *fLog << "Contents of Pixel-Index #" << i << ": " << (*fSum)[i+1] << " > " << s << "*rms" << endl;
    157153        // if ((*fSum)[i+1]==0)
    158154        //     *fLog << "Contents of Pixel-Index #" << i << ": " << (*fSum)[i+1] << " == 0" << endl;
     
    171167}
    172168
    173 void MHCamEvent::DrawTS(TVirtualPad *p, Option_t *)
     169void MHCamEvent::Draw(Option_t *)
    174170{
    175     if (!fSum)
    176     {
    177         *fLog << warn << "MHCamEvent::Draw - fSum==NULL not initialized." << endl;
    178         return;
    179     }
    180 
    181     TVirtualPad *pad = p ? p : MakeDefCanvas(this);
     171    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
    182172    pad->SetBorderMode(0);
    183173
    184174    pad->Divide(1,2);
    185175
    186     p = pad->GetPad(1);
    187     p->SetBorderMode(0);
     176    pad->cd(1);
     177    gPad->SetBorderMode(0);
     178    gPad->Divide(1,1);
     179    gPad->cd(1);
     180    gPad->SetBorderMode(0);
     181    fSum->Draw();
    188182
    189     // fSum doesn't derive from MParContainer
    190     MParContainer::DrawTS(fSum, p);
    191 
    192     p = pad->GetPad(2);
    193     p->SetBorderMode(0);
    194 
    195     // fSum doesn't derive from MParContainer
    196     MParContainer::DrawTS(fSum, p, "EPhist");
    197 
    198     // fSum doesn't derive from MParContainer
    199     //MParContainer::DrawTS(fSum, pad);
     183    pad->cd(2);
     184    gPad->SetBorderMode(0);
     185    fSum->Draw("EPhist");
    200186}
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.h

    r2415 r2416  
    3232    TH1 *GetHistByName(const TString name="");
    3333
    34     void DrawTS(TVirtualPad *pad=NULL, Option_t *o="");
     34    void Draw(Option_t *o="");
    3535
    36     void PrintOutliers(Float_t sigma) const;
     36    void PrintOutliers(Float_t s) const;
    3737
    3838    ClassDef(MHCamEvent, 1) // Histogram to sum camera events
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r2409 r2416  
    11351135    if (fNotify && fNotify->GetSize()>0)
    11361136    {
    1137         TCanvas *c=new TCanvas;
    1138         fNotify->ForEach(MCamEvent, DrawPixelContent)(idx, c);
     1137        new TCanvas;
     1138        fNotify->ForEach(MCamEvent, DrawPixelContent)(idx);
    11391139    }
    11401140}
     
    11481148{
    11491149    gPad=NULL;
    1150     return TH1D::DrawCopy();
     1150    return TH1D::DrawCopy(fName+";cpy");
    11511151}
  • trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.cc

    r2414 r2416  
    171171}
    172172
    173 void MHTriggerLvl0::DrawTS(TVirtualPad *p=NULL, Option_t * ="")
     173void MHTriggerLvl0::Draw(Option_t *)
    174174{
    175     TVirtualPad *pad = p ? p : MakeDefCanvas(this);
     175    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
    176176    pad->SetBorderMode(0);
    177177
    178     //-----------------------------
    179178    pad->Divide(1,2);
    180179
    181     p = pad->GetPad(1);
    182     p->SetBorderMode(0);
    183     p->Divide(1,1);
    184     p->cd(1);
    185     p->SetBorderMode(0);
    186     // fSum does not derive from MParContainer
    187     MParContainer::DrawTS(fSum, p);
     180    pad->cd(1);
     181    gPad->SetBorderMode(0);
     182    gPad->Divide(1,1);
     183    gPad->cd(1);
     184    gPad->SetBorderMode(0);
     185    fSum->Draw();
    188186
    189     p = pad->GetPad(2);
    190     p->SetBorderMode(0);
    191     // fSum does not derive from MParContainer
    192     MParContainer::DrawTS(fSum, p, "EPhist");
    193     //-----------------------------
    194 
    195     //MParContainer::DrawTS(fSum, p);
     187    pad->cd(2);
     188    gPad->SetBorderMode(0);
     189    fSum->Draw("EPhist");
    196190}
  • trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.h

    r2414 r2416  
    3434    TH1 *GetHistByName(const TString name="");
    3535
    36     //void Draw(Option_t * ="");
    37     void DrawTS(TVirtualPad *pad=NULL, Option_t * ="");
     36    void Draw(Option_t * ="");
    3837
    3938    void PrintOutlayers(Float_t s) const;
  • trunk/MagicSoft/Mars/mimage/MHHillas.cc

    r2414 r2416  
    278278    gStyle->SetPalette(50, c);
    279279}
    280 /*
     280
    281281// --------------------------------------------------------------------------
    282282//
     
    296296    pad->cd(1);
    297297    gPad->SetBorderMode(0);
    298     MH::Draw(*fWidth, *fLength, "Width'n'Length");
     298    MH::DrawSame(*fWidth, *fLength, "Width'n'Length");
    299299
    300300    pad->cd(2);
     
    323323    pad->Update();
    324324}
    325 */
    326 
    327 // --------------------------------------------------------------------------
    328 //
    329 // Creates a new canvas and draws the four histograms into it.
    330 // Be careful: The histograms belongs to this object and won't get deleted
    331 // together with the canvas.
    332 //
    333 void MHHillas::DrawTS(TVirtualPad *p, Option_t *)
    334 {
    335     TVirtualPad *pad = p ? p : MakeDefCanvas(this);
    336     pad->SetBorderMode(0);
    337 
    338     MParContainer::DrawTS(pad);
    339 
    340     pad->Divide(2,3);
    341 
    342     p = pad->GetPad(1);
    343     p->SetBorderMode(0);
    344     MH::DrawSame(*fWidth, *fLength, "Width'n'Length", p);
    345 
    346     p = pad->GetPad(2);
    347     p->SetBorderMode(0);
    348     MParContainer::DrawTS(fDistC, p);
    349 
    350     p = pad->GetPad(3);
    351     p->SetBorderMode(0);
    352     p->SetLogx();
    353     MParContainer::DrawTS(fSize, p);
    354 
    355     p = pad->GetPad(4);
    356     p->SetBorderMode(0);
    357     p->SetPad(0.51, 0.01, 0.99, 0.65);
    358     SetColors();
    359     MParContainer::DrawTS(fCenter, p, "colz");
    360 
    361     p = pad->GetPad(5);
    362     p->SetBorderMode(0);
    363     MParContainer::DrawTS(fDelta, p);
    364 
    365     delete pad->GetPad(6);
    366 
    367     pad->Modified();
    368     pad->Update();
    369 }
    370 
    371325
    372326TH1 *MHHillas::GetHistByName(const TString name)
  • trunk/MagicSoft/Mars/mimage/MHHillas.h

    r2414 r2416  
    5151    TH2F *GetHistCenter() { return fCenter; }
    5252
    53     //void Draw(Option_t *opt=NULL);
    54     void DrawTS(TVirtualPad *pad=NULL, Option_t *opt=NULL);
     53    void Draw(Option_t *opt=NULL);
    5554
    5655    //Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; }
  • trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc

    r2414 r2416  
    198198// together with the canvas.
    199199//
    200 void MHHillasSrc::DrawTS(TVirtualPad *p, Option_t *)
    201 {
    202     TVirtualPad *pad = p ? p : MakeDefCanvas(this);
     200void MHHillasSrc::Draw(Option_t *)
     201{
     202    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
    203203    pad->SetBorderMode(0);
    204204
    205     //
    206     // Add this object to the given pad
    207     //
    208     MParContainer::DrawTS(pad);
     205    AppendPad("");
    209206
    210207    // FIXME: Display Source position
    211208
    212     //
    213     // Fill the pad with histograms
    214     //
    215209    pad->Divide(2, 2);
    216210
    217     p = pad->GetPad(1);
    218     p->SetBorderMode(0);
    219     MParContainer::DrawTS(fAlpha, p);
    220 
    221     p = pad->GetPad(2);
    222     p->SetBorderMode(0);
    223     MParContainer::DrawTS(fDist, p);
    224 
    225     delete pad->GetPad(3);
    226 
    227     p = pad->GetPad(4);
    228     p->SetBorderMode(0);
    229     MParContainer::DrawTS(fCosDA, p);
     211    pad->cd(1);
     212    gPad->SetBorderMode(0);
     213    fAlpha->Draw();
     214
     215    pad->cd(2);
     216    gPad->SetBorderMode(0);
     217    fDist->Draw();
     218
     219    pad->cd(4);
     220    gPad->SetBorderMode(0);
     221    //gPad->SetLogy();
     222    fCosDA->Draw();
    230223
    231224    pad->Modified();
  • trunk/MagicSoft/Mars/mimage/MHHillasSrc.h

    r2414 r2416  
    3535    TH1F *GetHistCosDeltaAlpha() { return fCosDA; }
    3636
    37     //void Draw(Option_t *opt=NULL);
    38     void DrawTS(TVirtualPad *pad=NULL, Option_t *opt=NULL);
     37    void Draw(Option_t *opt=NULL);
    3938    void Paint(Option_t *opt);
    4039
  • trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc

    r2386 r2416  
    7575#include <TObjArray.h>            // TObjArray
    7676#include <TPostScript.h>          // TPostScript
     77
     78#include <TRint.h>                // gApplication, TRint::Class()
    7779#include <TInterpreter.h>         // gInterpreter
    7880
     
    374376
    375377        // make it visible
    376         gClient->ProcessEventsFor(fTab);
     378        // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents
     379        if (gApplication->InheritsFrom(TRint::Class()))
     380            gClient->ProcessEventsFor(fTab);
    377381    }
    378382
     
    470474        return;
    471475    fStatusBar->SetText(txt, 0);
    472     gClient->ProcessEventsFor(fStatusBar);
     476    // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents
     477    if (gApplication->InheritsFrom(TRint::Class()))
     478        gClient->ProcessEventsFor(fStatusBar);
    473479}
    474480
     
    482488        return;
    483489    fStatusBar->SetText(txt, 1);
    484     gClient->ProcessEventsFor(fStatusBar);
     490    // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents
     491    if (gApplication->InheritsFrom(TRint::Class()))
     492        gClient->ProcessEventsFor(fStatusBar);
    485493}
    486494
     
    567575    MapWindow();
    568576
    569     gSystem->ProcessEvents();
     577    // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents
     578    if (gApplication->InheritsFrom(TRint::Class()))
     579        gSystem->ProcessEvents();
    570580}
    571581
     
    732742
    733743    // display new tab in the main frame
    734     gClient->ProcessEventsFor(fTab);
     744    // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents
     745    if (gApplication->InheritsFrom(TRint::Class()))
     746        gClient->ProcessEventsFor(fTab);
    735747
    736748    *fLog << inf << "Adding Raw Tab '" << name << "' (" << f->GetWidth() << "x";
     
    784796
    785797    // display new tab in the main frame
    786     gClient->ProcessEventsFor(fTab);
     798    // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents
     799    if (gApplication->InheritsFrom(TRint::Class()))
     800        gClient->ProcessEventsFor(fTab);
    787801
    788802    *fLog << inf << "Adding Tab '" << name << "' (" << f->GetWidth() << "x";
     
    910924
    911925    // display new tab in the main frame
    912     gClient->ProcessEventsFor(fTab);
     926    // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents
     927    if (gApplication->InheritsFrom(TRint::Class()))
     928        gClient->ProcessEventsFor(fTab);
    913929
    914930    *fLog << inf << "Removed Tab #" << i << " '" << name << "'" << endl;
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.cc

    r2414 r2416  
    215215//     <index>      The pixel with the given index is drawn
    216216//
    217 // Rem: DrawTS is the thread-safe version of Draw. In most cases
    218 //      you can use Draw instead
    219 //
    220 void MRawEvtData::DrawTS(TVirtualPad *pad=NULL, Option_t *opt="")
     217void MRawEvtData::Draw(Option_t *opt)
    221218{
    222219    if (GetNumPixels()==0)
    223220    {
    224221        *fLog << warn << "Sorry, no pixel to draw!" << endl;
    225         return;
    226     }
    227     if (!pad)
    228     {
    229         *fLog << warn << "MRawEvtData::DrawTS - No pad available..." << endl;
    230222        return;
    231223    }
     
    246238    if (!pix.Jump(id))
    247239    {
    248         *fLog << warn << "Pixel Idx #" << dec << id << " doesn't exist!" << endl;
     240        *fLog << warn << dec << "Pixel Idx #" << id << " doesn't exist!" << endl;
    249241        return;
    250242    }
     
    275267
    276268        graphhi->SetBit(kCanDelete);
    277         MParContainer::DrawTS(graphhi, pad, same ? "C*" : "AC*");
     269        graphhi->Draw(same ? "C*" : "AC*");
    278270
    279271        TH1F *histhi = graphhi->GetHistogram();
     
    294286
    295287            graphlo->SetBit(kCanDelete);
    296             MParContainer::DrawTS(graphlo, pad, "C*");
     288            graphlo->Draw("C*");
    297289
    298290            TH1F *histlo = graphlo->GetHistogram();
     
    308300    {
    309301        // FIXME: Add Legend
    310         *fLog << inf << "Drawing Histogram of Pixel with Idx #";
    311         *fLog << dec << pix.GetPixelId() << endl;
     302        *fLog << inf << "Drawing Histogram of Pixel with Idx #" << dec << pix.GetPixelId() << endl;
    312303
    313304        TH1F *histh = new TH1F(name, "FADC Samples", nh, -0.5, nh-.5);
     
    318309            histh->Fill(i, higains[i]);
    319310        histh->SetBit(kCanDelete);
    320         MParContainer::DrawTS(histh, pad, same ? "same" : "");
     311        histh->Draw(same ? "same" : "");
    321312
    322313        if (nl>0)
     
    328319                histl->Fill(i, logains[i]);
    329320            histl->SetBit(kCanDelete);
    330             MParContainer::DrawTS(histl, pad, "same");
     321            histl->Draw("same");
    331322        }
    332323        return;
     
    543534    evt.fArraySize       = fArraySize;
    544535}
    545 
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.h

    r2414 r2416  
    5252    void Clear(Option_t * = NULL);
    5353    void Print(Option_t * = NULL) const;
    54     void DrawTS(TVirtualPad *pad=NULL, Option_t *option="");
    55     void Copy(TObject &named)
    56 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01)
    57 const
    58 #endif
    59         ;
     54    void Draw (Option_t * = NULL);
    6055
    6156    void DeletePixels(Bool_t flag=kFALSE);
     
    7065
    7166    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    72     void   DrawPixelContent(Int_t num, TVirtualPad *pad=NULL) const
     67    void   DrawPixelContent(Int_t num) const
    7368    {
    7469        TString s("HIST");
    7570        s += num;
    76         const_cast<MRawEvtData*>(this)->DrawTS(pad, s);
    77         //const_cast<MRawEvtData*>(this)->Draw(s);
     71        const_cast<MRawEvtData*>(this)->Draw(s);
    7872    }
     73
     74    void Copy(TObject &named)
     75#if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01)
     76        const
     77#endif
     78        ;
    7979
    8080    ClassDef(MRawEvtData, 2) //Container to store the raw Event Data
Note: See TracChangeset for help on using the changeset viewer.