Changeset 2015


Ignore:
Timestamp:
04/28/03 09:52:57 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
52 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/NEWS

    r1992 r2015  
    4545
    4646   - made compatible with the latest PRO version of root (3.04/02)
     47     (this means, that it is compiling, but not yet fully tested)
    4748
    4849   - added a new status display which can show the present status
  • trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc

    r1966 r2015  
    185185        nphot[i] = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetNumPhotons() : 0;
    186186        perr[i]  = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetErrorPhot()  : 0;
     187
     188        nphot[i] *= fGeomCam->GetPixRatio(id);
     189        // FIXME: perr[i] ???
     190
    187191        for (int j=0; j<n; j++)
    188192        {
     
    195199            if (evtpix)
    196200            {
    197                 nphot[i] += evtpix->GetNumPhotons();
     201                nphot[i] += evtpix->GetNumPhotons()*fGeomCam->GetPixRatio(nid);
    198202                perr[i]  += evtpix->GetErrorPhot();
     203                // FIXME: perr[i] ???
    199204            }
    200205            num++;
    201206        }
    202207
    203         nphot[i] /= num;
    204         perr[i]  /= num;
     208        nphot[i] /= num*fGeomCam->GetPixRatio(id);
     209        perr[i]  /= num/*FIXME:???*/;
    205210    }
    206211
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r2009 r2015  
    251251    // Check System time (don't loose too much time by updates)
    252252    //
    253     static TTime t0 = gSystem->Now();
    254 
    255     const TTime t1 = gSystem->Now();
    256     if (t1-t0 < (TTime)20)
     253
     254    // FIXME: Not thread safe
     255    static Int_t start = num;
     256    static TTime t1 = gSystem->Now();
     257    static TTime t2 = t1;
     258
     259    //
     260    // No update < 20ms
     261    //
     262    const TTime t0 = gSystem->Now();
     263    if (t0-t1 < (TTime)20)
    257264        return rc;
    258 
    259     t0 = t1;
     265    t1 = t0;
     266
     267    //
     268    // Update current speed each second
     269    //
     270    if (t0-t2 > (TTime)1000)
     271    {
     272        const Int_t speed = 1000*(num-start)/(long int)(t0-t2);
     273        TString txt = "Processing...";
     274        if (speed>0)
     275        {
     276            txt += " (";
     277            txt += speed;
     278            txt += "Evts/s)";
     279        }
     280        fDisplay->SetStatusLine1(txt);
     281        start = num;
     282        t2 = t1;
     283    }
    260284
    261285    //
  • trunk/MagicSoft/Mars/mbase/MGGroupFrame.h

    r1664 r2015  
    3737    virtual Bool_t ProcessMessage(Long_t msg, Long_t param1, Long_t param2);
    3838
    39     ClassDef(MGGroupFrame, 0) // A interface to widgets in a group frame (makes live easier)
     39    ClassDef(MGGroupFrame, 0) // An interface to widgets in a group frame (makes live easier)
    4040};
    4141
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r1936 r2015  
    6969
    7070#include <fstream.h>
     71#include <TBaseClass.h>
    7172
    7273#include "MLog.h"
     
    317318     out << "   " << GetUniqueName() << ".SetFilter(&" << fFilter->GetUniqueName() <<");" << endl;
    318319}
     320
     321// --------------------------------------------------------------------------
     322//
     323// Check whether the class given in the argument overwrites MTask::Process.
     324// This function calls itself recursively. If you want to call it,
     325// leave out the argument.
     326//
     327Bool_t MTask::OverwritesProcess(TClass *cls) const
     328{
     329    if (!cls)
     330        cls = IsA();
     331
     332    //
     333    // Check whether we reached the base class MTask
     334    //
     335    if (TString(cls->GetName())=="MTask")
     336        return kFALSE;
     337
     338    //
     339    // Check whether the class cls overwrites Process
     340    //
     341    if (cls->GetMethodAny("Process"))
     342        return kTRUE;
     343
     344    //
     345    // If the class itself doesn't overload it check all it's base classes
     346    //
     347    TBaseClass *base=NULL;
     348    TIter NextBase(cls->GetListOfBases());
     349    while ((base=(TBaseClass*)NextBase()))
     350    {
     351        if (OverwritesProcess(base->GetClassPointer()))
     352            return kTRUE;
     353    }
     354
     355    return kFALSE;
     356}
  • trunk/MagicSoft/Mars/mbase/MTask.h

    r1661 r2015  
    8080    const TList *GetListOfBranches() const { return fListOfBranches; }
    8181
     82    Bool_t OverwritesProcess(TClass *cls=NULL) const;
     83
    8284    void SavePrimitive(ofstream &out, Option_t *o="");
    8385
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r1965 r2015  
    6060
    6161#include <TClass.h>
    62 #include <TBaseClass.h>
    6362#include <TOrdCollection.h>
    6463
     
    322321// --------------------------------------------------------------------------
    323322//
    324 // Check whether this task (or one of it's base classes) overloads
    325 // MTask::Process. Only if this function is overloaded this task is
    326 // added to the fTaskProcess-List. This makes the execution of the
    327 // tasklist a little bit (only a little bit) faster, bacause tasks
    328 // doing no Processing are not Processed.
    329 //
    330 Bool_t MTaskList::CheckClassForProcess(TClass *cls)
    331 {
    332     //
    333     // Check whether the class itself overloads the Process function
    334     //
    335     if (cls->GetName()=="MTask")
    336         return kFALSE;
    337 
    338     if (cls->GetMethodAny("Process"))
    339         return kTRUE;
    340 
    341     //
    342     // If the class itself doesn't overload it check all it's base classes
    343     //
    344     TBaseClass *base=NULL;
    345     TIter NextBase(cls->GetListOfBases());
    346     while ((base=(TBaseClass*)NextBase()))
    347     {
    348         if (CheckClassForProcess(base->GetClassPointer()))
    349             return kTRUE;
    350     }
    351 
    352     return kFALSE;
    353 }
    354 
    355 // --------------------------------------------------------------------------
    356 //
    357323//  do pre processing (before eventloop) of all tasks in the task-list
     324//  Only if a task overwrites the Process function the task is
     325//  added to the fTaskProcess-List. This makes the execution of the
     326//  tasklist a little bit (only a little bit) faster, bacause tasks
     327//  doing no Processing are not Processed.
    358328//
    359329Bool_t MTaskList::PreProcess(MParList *pList)
     
    410380    //
    411381    while ((task=(MTask*)Next()))
    412         if (CheckClassForProcess(task->IsA()))
     382        if (task->OverwritesProcess())
    413383            fTasksProcess.Add(task);
    414384
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r1965 r2015  
    3131
    3232    void   Remove(MTask *task);
    33     Bool_t CheckClassForProcess(TClass *cls);
    34 
    35     void StreamPrimitive(ofstream &out) const;
    36 
     33    void   StreamPrimitive(ofstream &out) const;
    3734    Bool_t CheckAddToList(MTask *task, const char *tType, const MTask *where=NULL) const;
    3835
  • trunk/MagicSoft/Mars/mhist/MFillH.cc

    r1994 r2015  
    326326}
    327327
     328// --------------------------------------------------------------------------
     329//
     330// Creates a new tab in a status display with the name of the MH class,
     331// if fDisplay is set and the MH-class overwrites the Draw function
     332//
    328333Bool_t MFillH::DrawToDisplay()
    329334{
     335    fCanvas = NULL;
     336
    330337    if (!fDisplay)
     338        return kTRUE;
     339
     340    if (!fH->OverwritesDraw())
    331341        return kTRUE;
    332342
     
    485495    fH->SetReadyToSave();
    486496
    487     if (fDisplay)
     497    //
     498    // Check whether fDisplay has previously been used (fCanvas)
     499    // and fDisplay is still open.
     500    //
     501    if (fCanvas && fDisplay)
    488502    {
    489503        fCanvas->cd();
  • trunk/MagicSoft/Mars/mhist/MH.cc

    r2010 r2015  
    5959#include <TLegend.h>
    6060#include <TPaveStats.h>
     61#include <TBaseClass.h>
    6162#if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01)
    6263#include <THLimitsFinder.h>
     
    589590
    590591    // FIXME: Also align max/min with set Maximum/Minimum
    591      const Double_t max = TMath::Max(hist1.GetBinContent(hist1.GetMaximumBin()), hist2.GetBinContent(hist2.GetMaximumBin()));
    592      const Double_t min = TMath::Min(hist1.GetBinContent(hist1.GetMinimumBin()), hist2.GetBinContent(hist2.GetMinimumBin()));
    593      h1->SetMaximum(max);
    594      h1->SetMinimum(min);
     592    const Double_t maxbin1 = hist1.GetBinContent(hist1.GetMaximumBin());
     593    const Double_t maxbin2 = hist2.GetBinContent(hist2.GetMaximumBin());
     594    const Double_t minbin1 = hist1.GetBinContent(hist1.GetMinimumBin());
     595    const Double_t minbin2 = hist2.GetBinContent(hist2.GetMinimumBin());
     596
     597    const Double_t max = TMath::Max(maxbin1, maxbin2);
     598    const Double_t min = TMath::Min(minbin1, minbin2);
     599
     600    h1->SetMaximum(max>0?max*1.05:max*0.95);
     601    h1->SetMinimum(max>0?min*0.95:min*1.05);
    595602
    596603    TPaveText *t = (TPaveText*)gPad->FindObject("title");
     
    658665    gPad->Update();
    659666
    660     // FIXME: Also align max/min with set Maximum/Minimum
    661667    /*
    662      const Double_t max = TMath::Max(hist1.GetBinContent(hist1.GetMaximumBin()), hist2.GetBinContent(hist2.GetMaximumBin()));
    663      const Double_t min = TMath::Min(hist1.GetBinContent(hist1.GetMinimumBin()), hist2.GetBinContent(hist2.GetMinimumBin()));
    664      hist1.SetMaximum(max);
    665      hist1.SetMinimum(min);
     668     const Double_t maxbin1 = hist1.GetBinContent(hist1.GetMaximumBin());
     669     const Double_t maxbin2 = hist2.GetBinContent(hist2.GetMaximumBin());
     670     const Double_t minbin1 = hist1.GetBinContent(hist1.GetMinimumBin());
     671     const Double_t minbin2 = hist2.GetBinContent(hist2.GetMinimumBin());
     672
     673     const Double_t max = TMath::Max(maxbin1, maxbin2);
     674     const Double_t min = TMath::Min(minbin1, minbin2);
     675
     676     hist1.SetMaximum(max>0?max*1.05:max*0.95);
     677     hist1.SetMinimum(max>0?min*0.95:min*1.05);
    666678     */
    667679
     
    751763    return o;
    752764}
     765
     766// --------------------------------------------------------------------------
     767//
     768// Check whether a class inheriting from MH overwrites the Draw function
     769//
     770Bool_t MH::OverwritesDraw(TClass *cls) const
     771{
     772    if (!cls)
     773        cls = IsA();
     774
     775    //
     776    // Check whether we reached the base class MTask
     777    //
     778    if (TString(cls->GetName())=="MH")
     779        return kFALSE;
     780
     781    //
     782    // Check whether the class cls overwrites Draw
     783    //
     784    if (cls->GetMethodAny("Draw"))
     785    {
     786        *fLog << all << "FOUND: " << cls->GetName() << " " << (cls->GetName()=="MH") << endl;
     787        return kTRUE;
     788    }
     789
     790    //
     791    // If the class itself doesn't overload it check all it's base classes
     792    //
     793    TBaseClass *base=NULL;
     794    TIter NextBase(cls->GetListOfBases());
     795    while ((base=(TBaseClass*)NextBase()))
     796    {
     797        if (OverwritesDraw(base->GetClassPointer()))
     798            return kTRUE;
     799    }
     800
     801    return kFALSE;
     802}
  • trunk/MagicSoft/Mars/mhist/MH.h

    r2003 r2015  
    2121    MH(const char *name=NULL, const char *title=NULL);
    2222
     23    Bool_t OverwritesDraw(TClass *cls=NULL) const;
     24
    2325    virtual Bool_t SetupFill(const MParList *pList) { return kTRUE; }
    2426    virtual Bool_t Fill(const MParContainer *par, Double_t weight=1);
     
    3032
    3133    static TCanvas *MakeDefCanvas(TString name="", const char *title="",
    32                                   const UInt_t w=580, const UInt_t h=435);
     34                                  const UInt_t w=625, const UInt_t h=440);
    3335    static TCanvas *MakeDefCanvas(const TObject *obj,
    34                                   const UInt_t w=580, const UInt_t h=435);
     36                                  const UInt_t w=625, const UInt_t h=440);
    3537
    3638    static void SetBinning(TH1 *h, const MBinning *binsx);
     
    6365    TObject *DrawClone(Option_t *opt="") const
    6466    {
    65         return MH::DrawClone(opt, 580, 435);
     67        return MH::DrawClone(opt, 625, 440);
    6668    }
    6769
  • trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc

    r1992 r2015  
    126126void MHAlphaEnergyTheta::Draw(Option_t *opt)
    127127{
    128     if (!gPad)
    129         MakeDefCanvas("AlphaEnergyTheta", fTitle);
     128    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
     129    pad->SetBorderMode(0);
    130130
    131     gPad->Divide(2,2);
     131    AppendPad("");
     132
     133    pad->Divide(2,2);
    132134
    133135    TH1 *h;
    134136
    135     gPad->cd(1);
     137    pad->cd(1);
     138    gPad->SetBorderMode(0);
    136139    h = fHist.Project3D("expro");
    137 
    138140    h->SetTitle("Distribution of \\alpha [\\circ]");
    139141    h->SetXTitle("\\alpha [\\circ]");
    140142    h->SetYTitle("Counts");
    141 
    142143    h->Draw(opt);
    143144    h->SetBit(kCanDelete);
    144145
    145     gPad->cd(2);
     146    pad->cd(2);
     147    gPad->SetBorderMode(0);
     148    gPad->SetLogx();
    146149    h = fHist.Project3D("eypro");
    147 
    148150    h->SetTitle("Distribution of E-est [GeV]");
    149151    h->SetXTitle("E_{est} [GeV]");
    150152    h->SetYTitle("Counts");
    151 
    152153    h->Draw(opt);
    153154    h->SetBit(kCanDelete);
    154     gPad->SetLogx();
    155155
    156     gPad->cd(3);
     156    pad->cd(3);
     157    gPad->SetBorderMode(0);
    157158    h = fHist.Project3D("ezpro");
    158 
    159159    h->SetTitle("Distribution of \\Theta [\\circ]");
    160160    h->SetXTitle("\\Theta [\\circ]");
    161161    h->SetYTitle("Counts");
    162 
    163162    h->Draw(opt);
    164163    h->SetBit(kCanDelete);
    165164
    166     gPad->cd(4);
     165    pad->cd(4);
     166    gPad->SetBorderMode(0);
    167167    fHist.Draw(opt);
    168168
    169     gPad->Modified();
    170     gPad->Update();
     169    pad->Modified();
     170    pad->Update();
    171171}
    172 
    173 // --------------------------------------------------------------------------
    174 //
    175 // Draw copies of the histogram
    176 //
    177 TObject *MHAlphaEnergyTheta::DrawClone(Option_t *opt) const
    178 {
    179     TCanvas &c = *MakeDefCanvas("AlphaEnergyTheta", fTitle);
    180     c.Divide(2, 2);
    181 
    182     gROOT->SetSelectedPad(NULL);
    183 
    184     TH1 *h;
    185 
    186     c.cd(1);
    187     h = ((TH3*)(&fHist))->Project3D(fName+"_expro");
    188 
    189     h->SetTitle("Distribution of \\alpha [\\circ]");
    190     h->SetXTitle("\\alpha [\\circ]");
    191     h->SetYTitle("Counts");
    192 
    193     h->Draw(opt);
    194     h->SetBit(kCanDelete);
    195 
    196     c.cd(2);
    197     h = ((TH3*)(&fHist))->Project3D(fName+"_eypro");
    198 
    199     h->SetTitle("Distribution of E-est [GeV]");
    200     h->SetXTitle("E_{est} [GeV]");
    201     h->SetYTitle("Counts");
    202 
    203     h->Draw(opt);
    204     h->SetBit(kCanDelete);
    205     gPad->SetLogx();
    206 
    207     c.cd(3);
    208     h = ((TH3*)(&fHist))->Project3D(fName+"_ezpro");
    209 
    210     h->SetTitle("Distribution of \\Theta [\\circ]");
    211     h->SetXTitle("\\Theta [\\circ]");
    212     h->SetYTitle("Counts");
    213 
    214     h->Draw(opt);
    215     h->SetBit(kCanDelete);
    216 
    217     c.cd(4);
    218     ((TH3&)fHist).DrawCopy(opt);
    219 
    220     c.Modified();
    221     c.Update();
    222 
    223     return &c;
    224 }
    225 
  • trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.h

    r1992 r2015  
    4242
    4343    void Draw(Option_t *option="");
    44     TObject *DrawClone(Option_t *option="") const;
    4544
    4645    ClassDef(MHAlphaEnergyTheta, 0) //3D-histogram in alpha, Energy and theta
  • trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc

    r1992 r2015  
    126126void MHAlphaEnergyTime::Draw(Option_t *opt)
    127127{
    128     if (!gPad)
    129         MakeDefCanvas("AlphaEnergyTime", fTitle);
    130 
    131     gPad->Divide(2,2);
     128    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
     129    pad->SetBorderMode(0);
     130
     131    pad->Divide(2,2);
    132132
    133133    TH1 *h;
    134134
    135     gPad->cd(1);
     135    pad->cd(1);
     136    gPad->SetBorderMode(0);
    136137    h = fHist.Project3D("ex");
    137 
    138138    h->SetTitle("Distribution of \\alpha [\\circ]");
    139139    h->SetXTitle("\\alpha [\\circ]");
    140140    h->SetYTitle("Counts");
    141 
    142141    h->Draw(opt);
    143142    h->SetBit(kCanDelete);
    144143
    145     gPad->cd(2);
     144    pad->cd(2);
     145    gPad->SetBorderMode(0);
     146    gPad->SetLogx();
    146147    h = fHist.Project3D("ey");
    147 
    148148    h->SetTitle("Distribution of E-est [GeV]");
    149149    h->SetXTitle("E-est [GeV]            ");
    150150    h->SetYTitle("Counts");
    151 
    152151    h->Draw(opt);
    153152    h->SetBit(kCanDelete);
    154     gPad->SetLogx();
    155 
    156     gPad->cd(3);
     153
     154    pad->cd(3);
     155    gPad->SetBorderMode(0);
    157156    h = fHist.Project3D("ez");
    158 
    159157    h->SetTitle("Distribution of time [s]");
    160158    h->SetXTitle("time [s]");
    161159    h->SetYTitle("Counts");
    162 
    163160    h->Draw(opt);
    164161    h->SetBit(kCanDelete);
    165162
    166     gPad->cd(4);
     163    pad->cd(4);
     164    gPad->SetBorderMode(0);
    167165    fHist.Draw(opt);
    168166
    169     gPad->Modified();
    170     gPad->Update();
    171 
    172 }
    173 
    174 // --------------------------------------------------------------------------
    175 //
    176 // Draw copies of the histogram
    177 //
    178 TObject *MHAlphaEnergyTime::DrawClone(Option_t *opt) const
    179 {
    180     TCanvas &c = *MakeDefCanvas("AlphaEnergyTime", fTitle);
    181 
    182     c.Divide(2, 2);
    183 
    184     gROOT->SetSelectedPad(NULL);
    185 
    186     TH1 *h;
    187 
    188     c.cd(1);
    189     h = ((TH3D*)(&fHist))->Project3D("ex");
    190 
    191     h->SetTitle("Distribution of \\alpha [\\circ]");
    192     h->SetXTitle("\\alpha [\\circ]");
    193     h->SetYTitle("Counts");
    194 
    195     h->Draw(opt);
    196     h->SetBit(kCanDelete);
    197 
    198     c.cd(2);
    199     h = ((TH3D*)(&fHist))->Project3D("ey");
    200 
    201     h->SetTitle("Distribution of E-est [GeV]");
    202     h->SetXTitle("E-est [GeV]            ");
    203     h->SetYTitle("Counts");
    204 
    205     h->Draw(opt);
    206     h->SetBit(kCanDelete);
    207     gPad->SetLogx();
    208 
    209     c.cd(3);
    210     h = ((TH3D*)(&fHist))->Project3D("ez");
    211 
    212     h->SetTitle("Distribution of time [s]");
    213     h->SetXTitle("time [s]");
    214     h->SetYTitle("Counts");
    215 
    216     h->Draw(opt);
    217     h->SetBit(kCanDelete);
    218 
    219     c.cd(4);
    220     ((TH3D&)fHist).DrawCopy(opt);
    221 
    222     c.Modified();
    223     c.Update();
    224 
    225     return &c;
    226 }
    227 
     167    pad->Modified();
     168    pad->Update();
     169
     170}
    228171
    229172// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.h

    r1992 r2015  
    4141
    4242    void Draw(Option_t *option="");
    43     TObject *DrawClone(Option_t *option="") const;
    4443
    4544    TH2D *IntegrateTime    (const char *title, Bool_t Draw);
  • trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc

    r2002 r2015  
    152152// --------------------------------------------------------------------------
    153153//
    154 // Draw clone
    155 //
    156 TObject *MHCerPhotEvt::DrawClone(Option_t *opt) const
    157 {
    158     return MH::DrawClone(opt, 750, 600);
    159 }
    160 
    161 // --------------------------------------------------------------------------
    162 //
    163154// Draw the present 'fill status'
    164155//
  • trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.h

    r1989 r2015  
    3737    const MCerPhotEvt &GetSum() const { return fSum; }
    3838
    39     TObject *DrawClone(Option_t *opt) const;
    40     void Draw(Option_t *);
     39    void Draw(Option_t *opt="");
    4140    void Paint(Option_t *option="");
    4241
  • trunk/MagicSoft/Mars/mhist/MHEffOnTime.cc

    r1992 r2015  
    361361// -------------------------------------------------------------------------
    362362//
    363 // Draw a copy of the histogram
    364 //
    365 TObject *MHEffOnTime::DrawClone(Option_t *opt) const
    366 {
    367     TCanvas &c = *MakeDefCanvas(TString("EffOnTime")+fVarname,
    368                                 TString("Results from on time fit vs. ")+fVarname);
    369     c.Divide(2, 2);
    370 
    371     gROOT->SetSelectedPad(NULL);
    372 
    373     c.cd(1);
    374     ((TH2*)&fHEffOn)->DrawCopy(opt);
    375 
    376     c.cd(2);
    377     ((TH2*)&fHProb)->DrawCopy(opt);
    378 
    379     c.cd(3);
    380     ((TH2*)&fHLambda)->DrawCopy(opt);
    381 
    382     c.cd(4);
    383     ((TH2*)&fHRdead)->DrawCopy(opt);
    384 
    385     c.Modified();
    386     c.Update();
    387 
    388     return &c;
    389 }
    390 
    391 // -------------------------------------------------------------------------
    392 //
    393363// Draw the histogram
    394364//
    395365void MHEffOnTime::Draw(Option_t *opt)
    396366{
    397     if (!gPad)
    398         MakeDefCanvas(TString("EffOnTime")+fVarname,
    399                       TString("Results from on time fit vs. ")+fVarname);
    400 
    401     gPad->Divide(2,2);
    402 
    403     gPad->cd(1);
     367    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
     368    pad->SetBorderMode(0);
     369
     370    pad->Divide(2,2);
     371
     372    pad->cd(1);
     373    gPad->SetBorderMode(0);
    404374    fHEffOn.Draw(opt);
    405375
    406     gPad->cd(2);
     376    pad->cd(2);
     377    gPad->SetBorderMode(0);
    407378    fHProb.Draw(opt);
    408379
    409     gPad->cd(3);
     380    pad->cd(3);
     381    gPad->SetBorderMode(0);
    410382    fHLambda.Draw(opt);
    411383
    412     gPad->cd(4);
     384    pad->cd(4);
     385    gPad->SetBorderMode(0);
    413386    fHRdead.Draw(opt);
    414387
    415     gPad->Modified();
    416     gPad->Update();
     388    pad->Modified();
     389    pad->Update();
    417390}
    418391
  • trunk/MagicSoft/Mars/mhist/MHEffOnTime.h

    r1992 r2015  
    4141
    4242    void Draw(Option_t *option="");
    43     TObject *DrawClone(Option_t *option="") const;
    4443
    4544    ClassDef(MHEffOnTime, 0) //1D-plot of Delta t vs. Var
  • trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.cc

    r1992 r2015  
    257257// -------------------------------------------------------------------------
    258258//
    259 // Draw a copy of the histogram
    260 //
    261 TObject *MHEffOnTimeTheta::DrawClone(Option_t *opt) const
    262 {
    263     TCanvas &c = *MakeDefCanvas("EffOnTimeTheta", "Results from on time fit vs. Theta");
    264 
    265     c.Divide(2, 2);
    266 
    267     gROOT->SetSelectedPad(NULL);
    268 
    269     c.cd(1);
    270     ((TH2*)&fHEffOn)->DrawCopy(opt);
    271 
    272     c.cd(2);
    273     ((TH2*)&fHChi2)->DrawCopy(opt);
    274 
    275     c.cd(3);
    276     ((TH2*)&fHLambda)->DrawCopy(opt);
    277 
    278     c.cd(4);
    279     ((TH2*)&fHN0del)->DrawCopy(opt);
    280 
    281     c.Modified();
    282     c.Update();
    283 
    284     return &c;
    285 }
    286 
    287 // -------------------------------------------------------------------------
    288 //
    289259// Draw the histogram
    290260//
    291261void MHEffOnTimeTheta::Draw(Option_t *opt)
    292262{
    293     if (!gPad)
    294         MakeDefCanvas("EffOnTimeTheta", "Results from on time fit vs. Theta");
    295 
    296     gPad->Divide(2,2);
    297 
    298     gPad->cd(1);
     263    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
     264    pad->SetBorderMode(0);
     265
     266    pad->Divide(2,2);
     267
     268    pad->cd(1);
     269    gPad->SetBorderMode(0);
    299270    fHEffOn.Draw(opt);
    300271
    301     gPad->cd(2);
     272    pad->cd(2);
     273    gPad->SetBorderMode(0);
    302274    fHChi2.Draw(opt);
    303275
    304     gPad->cd(3);
     276    pad->cd(3);
     277    gPad->SetBorderMode(0);
    305278    fHLambda.Draw(opt);
    306279
    307     gPad->cd(4);
     280    pad->cd(4);
     281    gPad->SetBorderMode(0);
    308282    fHN0del.Draw(opt);
    309283
    310     gPad->Modified();
    311     gPad->Update();
    312 }
     284    pad->Modified();
     285    pad->Update();
     286}
  • trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.h

    r1992 r2015  
    3232
    3333    void Draw(Option_t *option="");
    34     TObject *DrawClone(Option_t *option="") const;
    3534
    3635    ClassDef(MHEffOnTimeTheta, 0) //1D-plot of Delta t vs. Theta
  • trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.cc

    r1992 r2015  
    264264// -------------------------------------------------------------------------
    265265//
    266 // Draw a copy of the histogram
    267 //
    268 TObject *MHEffOnTimeTime::DrawClone(Option_t *opt) const
    269 {
    270     TCanvas &c = *MakeDefCanvas("EffOnTimeTime", "Results from on time fit vs. time");
    271     c.Divide(2, 2);
    272 
    273     gROOT->SetSelectedPad(NULL);
    274 
    275     c.cd(1);
    276     ((TH2*)&fHEffOn)->DrawCopy(opt);
    277 
    278     c.cd(2);
    279     ((TH2*)&fHChi2)->DrawCopy(opt);
    280 
    281     c.cd(3);
    282     ((TH2*)&fHLambda)->DrawCopy(opt);
    283 
    284     c.cd(4);
    285     ((TH2*)&fHN0del)->DrawCopy(opt);
    286 
    287     c.Modified();
    288     c.Update();
    289 
    290     return &c;
    291 }
    292 
    293 // -------------------------------------------------------------------------
    294 //
    295266// Draw the histogram
    296267//
    297268void MHEffOnTimeTime::Draw(Option_t *opt)
    298269{
    299     if (!gPad)
    300         MakeDefCanvas("EffOnTimeTime", "Results from on time fit vs. time");
    301 
    302     gPad->Divide(2,2);
    303 
    304     gPad->cd(1);
     270    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
     271    pad->SetBorderMode(0);
     272
     273    pad->Divide(2,2);
     274
     275    pad->cd(1);
     276    gPad->SetBorderMode(0);
    305277    fHEffOn.Draw(opt);
    306278
    307     gPad->cd(2);
     279    pad->cd(2);
     280    gPad->SetBorderMode(0);
    308281    fHChi2.Draw(opt);
    309282
    310     gPad->cd(3);
     283    pad->cd(3);
     284    gPad->SetBorderMode(0);
    311285    fHLambda.Draw(opt);
    312286
    313     gPad->cd(4);
     287    pad->cd(4);
     288    gPad->SetBorderMode(0);
    314289    fHN0del.Draw(opt);
    315290
    316     gPad->Modified();
    317     gPad->Update();
    318 }
    319 
    320 
    321 
    322 
    323 
     291    pad->Modified();
     292    pad->Update();
     293}
     294
     295
     296
     297
     298
  • trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.h

    r1992 r2015  
    3232
    3333    void Draw(Option_t *option="");
    34     TObject *DrawClone(Option_t *option="") const;
    3534
    3635    ClassDef(MHEffOnTimeTime, 0) //1D-plot of Delta t vs. time
  • trunk/MagicSoft/Mars/mhist/MHEnergyTheta.cc

    r1992 r2015  
    8989// --------------------------------------------------------------------------
    9090//
    91 // Delete the three histograms
    92 //
    93 MHEnergyTheta::~MHEnergyTheta()
    94 {
    95 }
    96 
    97 // --------------------------------------------------------------------------
    98 //
    9991// Fill data into the histogram which contains all showers
    10092//
     
    114106void MHEnergyTheta::Draw(Option_t* option)
    115107{
    116     if (!gPad)
    117         MakeDefCanvas(&fHist);
     108    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
     109    pad->SetBorderMode(0);
     110    pad->SetLogy();
    118111
    119     fHist.DrawCopy(option);
    120     gPad->SetLogy();
     112    fHist.Draw(option);
    121113
    122     gPad->Modified();
    123     gPad->Update();
    124 }
    125 
    126 // --------------------------------------------------------------------------
    127 //
    128 // Creates a new canvas and draws the histogram into it.
    129 // Be careful: The histogram belongs to this object and won't get deleted
    130 // together with the canvas.
    131 //
    132 TObject *MHEnergyTheta::DrawClone(Option_t* option) const
    133 {
    134     TCanvas *c = MakeDefCanvas(&fHist);
    135 
    136     //
    137     // This is necessary to get the expected bahviour of DrawClone
    138     //
    139     gROOT->SetSelectedPad(NULL);
    140 
    141     ((TH2D&)fHist).DrawCopy(option);
    142     gPad->SetLogy();
    143 
    144     c->Modified();
    145     c->Update();
    146 
    147     return c;
     114    pad->Modified();
     115    pad->Update();
    148116}
    149117
  • trunk/MagicSoft/Mars/mhist/MHEnergyTheta.h

    r1992 r2015  
    1818
    1919public:
    20 
    2120    MHEnergyTheta(const char *name=NULL, const char *title=NULL);
    22     ~MHEnergyTheta();
    2321
    2422    Bool_t Fill(const MParContainer *cont, Double_t w=1);
    2523
    2624    void Draw(Option_t *option="");
    27     TObject *DrawClone(Option_t *option="") const;
    2825
    2926    Bool_t SetupFill(const MParList *plist);
  • trunk/MagicSoft/Mars/mhist/MHEnergyTime.cc

    r1330 r2015  
    6262    //   we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins
    6363
    64  
    6564    fName  = name  ? name  : "MHEnergyTime";
    6665    fTitle = title ? title : "Data to Calculate Collection Area";
     
    9796// --------------------------------------------------------------------------
    9897//
    99 // Delete the three histograms
    100 //
    101 MHEnergyTime::~MHEnergyTime()
    102 {
    103 }
    104 
    105 // --------------------------------------------------------------------------
    106 //
    10798// Fill data into the histogram which contains all showers
    10899//
     
    122113void MHEnergyTime::Draw(Option_t* option)
    123114{
    124     if (!gPad)
    125         MakeDefCanvas(&fHist);
     115    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
     116    pad->SetBorderMode(0);
    126117
     118    AppendPad("");
     119
     120    pad->SetLogy();
    127121    fHist.DrawCopy(option);
    128     gPad->SetLogy();
    129122
    130     gPad->Modified();
    131     gPad->Update();
    132 }
    133 
    134 // --------------------------------------------------------------------------
    135 //
    136 // Creates a new canvas and draws the histogram into it.
    137 // Be careful: The histogram belongs to this object and won't get deleted
    138 // together with the canvas.
    139 //
    140 TObject *MHEnergyTime::DrawClone(Option_t* option) const
    141 {
    142     TCanvas *c = MakeDefCanvas(&fHist);
    143 
    144     //
    145     // This is necessary to get the expected bahviour of DrawClone
    146     //
    147     gROOT->SetSelectedPad(NULL);
    148 
    149     ((TH2D&)fHist).DrawCopy(option);
    150     gPad->SetLogy();
    151 
    152     c->Modified();
    153     c->Update();
    154 
    155     return c;
     123    pad->Modified();
     124    pad->Update();
    156125}
    157126
  • trunk/MagicSoft/Mars/mhist/MHEnergyTime.h

    r1663 r2015  
    1919
    2020public:
    21 
    2221    MHEnergyTime(const char *name=NULL, const char *title=NULL);
    23     ~MHEnergyTime();
    2422
    2523    Bool_t Fill(const MParContainer *cont);
    2624
    2725    void Draw(Option_t *option="");
    28     TObject *DrawClone(Option_t *option="") const;
    2926
    3027    Bool_t SetupFill(const MParList *plist);
  • trunk/MagicSoft/Mars/mhist/MHFlux.cc

    r1992 r2015  
    503503// -------------------------------------------------------------------------
    504504//
    505 //  Draw copies of the histograms
    506 //
    507 TObject *MHFlux::DrawClone(Option_t *opt) const
    508 {
    509     TCanvas &c = *MakeDefCanvas("flux", "Orig - Unfold - Flux plots");
    510     c.Divide(2, 2);
    511 
    512     gROOT->SetSelectedPad(NULL);
    513 
    514     c.cd(1);
    515     ((TH2*)&fHOrig)->DrawCopy("");
    516     gPad->SetLogx();
    517 
    518     c.cd(2);
    519     ((TH2*)&fHUnfold)->DrawCopy("");
    520     gPad->SetLogx();
    521 
    522     c.cd(3);
    523     ((TH2*)&fHFlux)->DrawCopy("");
    524     gPad->SetLogx();
    525 
    526     c.Modified();
    527     c.Update();
    528 
    529     return &c;
    530 }
    531 
    532 // -------------------------------------------------------------------------
    533 //
    534505//  Draw the histograms
    535506//
    536507void MHFlux::Draw(Option_t *opt)
    537508{
    538     if (!gPad)
    539         MakeDefCanvas("flux", "orig-unfold-flux plots");
    540 
    541     gPad->Divide(2,2);
    542 
    543     gPad->cd(1);
     509    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
     510    pad->SetBorderMode(0);
     511
     512    AppendPad("");
     513
     514    pad->Divide(2,2);
     515
     516    pad->cd(1);
     517    gPad->SetBorderMode(0);
    544518    fHOrig.Draw(opt);
    545519
    546     gPad->cd(2);
     520    pad->cd(2);
     521    gPad->SetBorderMode(0);
    547522    fHUnfold.Draw(opt);
    548523
    549     gPad->cd(3);
     524    pad->cd(3);
     525    gPad->SetBorderMode(0);
    550526    fHFlux.Draw(opt);
    551527
    552     gPad->Modified();
    553     gPad->Update();
     528    pad->Modified();
     529    pad->Update();
    554530}
    555531
  • trunk/MagicSoft/Mars/mhist/MHFlux.h

    r1992 r2015  
    5959
    6060    void Draw(Option_t *option="");
    61     TObject *DrawClone(Option_t *option="") const;
     61
    6262    void DrawFluxProjectionX(Option_t *opt="") const;
    6363    void DrawOrigProjectionX(Option_t *opt="") const;
  • trunk/MagicSoft/Mars/mhist/MHMatrix.cc

    r1992 r2015  
    880880        DrawDefRefInfo(hth, hthd, thsh, refcolumn);
    881881
    882     if (!rest)
    883         return kTRUE;
    884 
    885     CopyCrop(*rest, mrest, evtcount2);
     882    if (rest)
     883        CopyCrop(*rest, mrest, evtcount2);
    886884
    887885    return kTRUE;
  • trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc

    r1992 r2015  
    180180{
    181181    Double_t theta = fMcEvt->GetTelescopeTheta()*kRad2Deg;
    182     Double_t mySig = fSigmabar->Calc(*fCam, *fPed, *fEvt);
    183 
    184     fSigmaTheta.Fill(theta, mySig);
     182    Double_t mysig = fSigmabar->Calc(*fCam, *fPed, *fEvt);
     183
     184    fSigmaTheta.Fill(theta, mysig);
    185185
    186186    const UInt_t npix = fEvt->GetNumPixels();
     
    188188    for (UInt_t i=0; i<npix; i++)
    189189    {
    190       MCerPhotPix cerpix = (*fEvt)[i];
    191       if (!cerpix.IsPixelUsed())
    192           continue;
    193 
    194       const Int_t id = cerpix.GetPixId();
    195       const MPedestalPix &pix = (*fPed)[id];
    196 
    197       const Double_t sigma = pix.GetMeanRms();
    198       const Double_t area  = fCam->GetPixRatio(id);
    199 
    200 
    201       fSigmaPixTheta.Fill(theta, (Double_t)id, sigma);
    202 
    203       const Double_t diff = sigma*sigma/area - mySig*mySig;
    204       fDiffPixTheta.Fill(theta, (Double_t)id, diff);
     190        MCerPhotPix cerpix = (*fEvt)[i];
     191        if (!cerpix.IsPixelUsed())
     192            continue;
     193
     194        const Int_t id = cerpix.GetPixId();
     195        const MPedestalPix &pix = (*fPed)[id];
     196
     197        const Double_t sigma = pix.GetMeanRms();
     198        const Double_t area  = fCam->GetPixRatio(id);
     199
     200        fSigmaPixTheta.Fill(theta, (Double_t)id, sigma);
     201
     202        const Double_t diff = sigma*sigma/area - mysig*mysig;
     203        fDiffPixTheta.Fill(theta, (Double_t)id, diff);
    205204    }
    206205
    207206    return kTRUE;
    208 }
    209 
    210 // --------------------------------------------------------------------------
    211 //
    212 // Draw a copy of the histogram
    213 //
    214 TObject *MHSigmaTheta::DrawClone(Option_t *opt)
    215 {
    216     return MH::DrawClone(opt, 900, 900);
    217207}
    218208
  • trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h

    r1992 r2015  
    3232    MMcEvt         *fMcEvt;      //!
    3333 
    34     TH1D fNpix;          // 1D-distribution no.of pixels in MCerPhotEvt;
    35     TH1D fBlindId;       // 1D-distribution Id of blind pixel;
    3634    TH2D fSigmaTheta;    // 2D-distribution sigmabar versus Theta;
    3735                         // sigmabar is the average pedestasl sigma in an event
     
    4846    const TH2D *GetSigmaTheta() { return &fSigmaTheta; }
    4947    const TH2D *GetSigmaTheta() const { return &fSigmaTheta; }
    50     TH2D *GetSigmaThetaByName(const TString name) { return &fSigmaTheta; }
    5148
    5249    const TH3D *GetSigmaPixTheta() { return &fSigmaPixTheta; }
    5350    const TH3D *GetSigmaPixTheta() const { return &fSigmaPixTheta; }
    54     TH3D *GetSigmaPixThetaByName(const TString name) { return &fSigmaPixTheta; }
    5551
    5652    const TH3D *GetDiffPixTheta() { return &fDiffPixTheta; }
    5753    const TH3D *GetDiffPixTheta() const { return &fDiffPixTheta; }
    58     TH3D *GetDiffPixThetaByName(const TString name) { return &fDiffPixTheta; }
    5954
    6055    void Draw(Option_t *option="");
    61     TObject *DrawClone(Option_t *option="");
    6256
    6357    ClassDef(MHSigmaTheta, 0) //2D-histogram  sigmabar vs. Theta
  • trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc

    r1974 r2015  
    160160}
    161161
    162 // --------------------------------------------------------------------------
    163 //
    164 // Creates a new canvas and draws the histogram into it.
    165 // Be careful: The histogram belongs to this object and won't get deleted
    166 // together with the canvas.
    167 //
    168 TObject *MHMcCollectionArea::DrawClone(Option_t* opt) const
    169 {
    170     return MH::DrawClone(opt);
    171 /*
    172     TCanvas *c = MH::MakeDefCanvas(fHistCol);
    173 
    174     //
    175     // This is necessary to get the expected bahviour of DrawClone
    176     //
    177     gROOT->SetSelectedPad(NULL);
    178 
    179     fHistCol->DrawCopy(option);
    180 
    181     gPad->SetLogx();
    182 
    183     c->Modified();
    184     c->Update();
    185 
    186     return c;*/
    187 }
    188 
    189162void MHMcCollectionArea::Draw(Option_t* option)
    190163{
    191164    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
    192165    pad->SetBorderMode(0);
    193     //    if (!gPad)
    194     //        MH::MakeDefCanvas(fHistCol);
    195166
    196167    fHistCol->Draw(option);
  • trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h

    r1974 r2015  
    3636
    3737    void Draw(Option_t *option="");
    38     TObject *DrawClone(Option_t *option="") const;
    3938
    4039    void CalcEfficiency();
  • trunk/MagicSoft/Mars/mhistmc/MHMcDifRate.cc

    r1974 r2015  
    8282}
    8383
    84 //-------------------------------------------------------------------------
    85 //
    86 //  Defualt Destructor
    87 //
    88 MHMcDifRate::~MHMcDifRate()
    89 {
    90 }
    91 
    9284// ------------------------------------------------------------------------
    9385//
     
    9688void MHMcDifRate::Draw(Option_t *option)
    9789{
    98     if (!gPad)
    99         MH::MakeDefCanvas(&fHist);
     90    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
     91    pad->SetBorderMode(0);
    10092
    101     gPad->SetLogx();
     93    AppendPad("");
     94
     95    pad->SetLogx();
    10296
    10397    fHist.Draw(option);
    10498
    105     gPad->Modified();
    106     gPad->Update();
    107 }
    108 
    109 TObject *MHMcDifRate::DrawClone(Option_t *option) const
    110 {
    111     TCanvas *c = MH::MakeDefCanvas(&fHist);
    112 
    113     c->SetLogx();
    114 
    115     //
    116     // This is necessary to get the expected bahviour of DrawClone
    117     //
    118     gROOT->SetSelectedPad(NULL);
    119 
    120     ((TH1D&)fHist).DrawCopy(option);
    121 
    122     c->Modified();
    123     c->Update();
    124 
    125     return c;
     99    pad->Modified();
     100    pad->Update();
    126101}
    127102/*
  • trunk/MagicSoft/Mars/mhistmc/MHMcDifRate.h

    r1974 r2015  
    2323public:
    2424    MHMcDifRate(const char *name=NULL, const char *title=NULL);
    25     ~MHMcDifRate();
    2625
    2726    void SetName(const char *name);
     
    3433
    3534    void Draw(Option_t* option = "");
    36     TObject *DrawClone(Option_t* option = "") const;
    3735
    3836//    void Calc(const TH2D &hsel, const TH2D &hall);
  • trunk/MagicSoft/Mars/mhistmc/MHMcEfficiency.cc

    r1974 r2015  
    9191}
    9292
    93 //-------------------------------------------------------------------------
    94 //
    95 //  Defualt Destructor
    96 //
    97 MHMcEfficiency::~MHMcEfficiency()
    98 {
    99 }
    100 
    10193// ------------------------------------------------------------------------
    10294//
     
    10597void MHMcEfficiency::Draw(Option_t *option)
    10698{
    107     if (!gPad)
    108         MH::MakeDefCanvas(&fHist);
     99    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
     100    pad->SetBorderMode(0);
    109101
    110     gPad->SetLogx();
     102    AppendPad("");
     103
     104    pad->SetLogx();
    111105
    112106    fHist.Draw(option);
    113107
    114     gPad->Modified();
    115     gPad->Update();
    116 }
    117 
    118 TObject *MHMcEfficiency::DrawClone(Option_t *option) const
    119 {
    120     TCanvas *c = MH::MakeDefCanvas(&fHist);
    121 
    122     c->SetLogx();
    123 
    124     //
    125     // This is necessary to get the expected bahviour of DrawClone
    126     //
    127     gROOT->SetSelectedPad(NULL);
    128 
    129     ((TH2D&)fHist).DrawCopy(option);
    130 
    131     c->Modified();
    132     c->Update();
    133 
    134     return c;
     108    pad->Modified();
     109    pad->Update();
    135110}
    136111
  • trunk/MagicSoft/Mars/mhistmc/MHMcEfficiency.h

    r1974 r2015  
    2222public:
    2323    MHMcEfficiency(const char *name=NULL, const char *title=NULL);
    24     ~MHMcEfficiency();
    2524
    2625    void SetName(const char *name);
     
    3332
    3433    void Draw(Option_t* option = "");
    35     TObject *DrawClone(Option_t* option = "") const;
    3634
    3735    void Calc(const TH2D &hsel, const TH2D &hall);
  • trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyEnergy.cc

    r1974 r2015  
    8686}
    8787
    88 //-------------------------------------------------------------------------
    89 //
    90 //  Defualt Destructor
    91 //
    92 MHMcEfficiencyEnergy::~MHMcEfficiencyEnergy()
    93 {
    94 }
    95 
    9688// ------------------------------------------------------------------------
    9789//
     
    10092void MHMcEfficiencyEnergy::Draw(Option_t *option)
    10193{
    102     if (!gPad)
    103         MH::MakeDefCanvas(&fHist);
     94    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
     95    pad->SetBorderMode(0);
    10496
    105     gPad->SetLogx();
     97    AppendPad("");
     98
     99    pad->SetLogx();
    106100
    107101    fHist.Draw(option);
    108102
    109     gPad->Modified();
    110     gPad->Update();
    111 }
    112 
    113 TObject *MHMcEfficiencyEnergy::DrawClone(Option_t *option) const
    114 {
    115     TCanvas *c = MH::MakeDefCanvas(&fHist);
    116 
    117     c->SetLogx();
    118 
    119     //
    120     // This is necessary to get the expected bahviour of DrawClone
    121     //
    122     gROOT->SetSelectedPad(NULL);
    123 
    124     ((TH1D&)fHist).DrawCopy(option);
    125 
    126     c->Modified();
    127     c->Update();
    128 
    129     return c;
     103    pad->Modified();
     104    pad->Update();
    130105}
    131106
  • trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyEnergy.h

    r1974 r2015  
    2222public:
    2323    MHMcEfficiencyEnergy(const char *name=NULL, const char *title=NULL);
    24     ~MHMcEfficiencyEnergy();
    2524
    2625    void SetName(const char *name);
     
    3332
    3433    void Draw(Option_t* option = "");
    35     TObject *DrawClone(Option_t* option = "") const;
    3634
    3735    void Calc(const TH2D &hsel, const TH2D &hall);
  • trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyImpact.cc

    r1974 r2015  
    8686}
    8787
    88 //-------------------------------------------------------------------------
    89 //
    90 //  Defualt Destructor
    91 //
    92 MHMcEfficiencyImpact::~MHMcEfficiencyImpact()
    93 {
    94 }
    95 
    9688// ------------------------------------------------------------------------
    9789//
     
    10092void MHMcEfficiencyImpact::Draw(Option_t *option)
    10193{
    102     if (!gPad)
    103         MH::MakeDefCanvas(&fHist);
     94    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
     95    pad->SetBorderMode(0);
    10496
    105     gPad->SetLogx();
     97    AppendPad("");
     98
     99    pad->SetLogx();
    106100
    107101    fHist.Draw(option);
    108102
    109     gPad->Modified();
    110     gPad->Update();
     103    pad->Modified();
     104    pad->Update();
    111105}
    112106
  • trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyImpact.h

    r1974 r2015  
    2222public:
    2323    MHMcEfficiencyImpact(const char *name=NULL, const char *title=NULL);
    24     ~MHMcEfficiencyImpact();
    2524
    2625    void SetName(const char *name);
     
    3332
    3433    void Draw(Option_t* option = "");
    35     TObject *DrawClone(Option_t* option = "") const;
    3634
    3735    void Calc(const TH2D &hsel, const TH2D &hall);
  • trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.cc

    r1974 r2015  
    170170void MHMcEnergy::Draw(Option_t *option)
    171171{
    172     if (!gPad)
    173         MH::MakeDefCanvas(fHist);
     172    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
     173    pad->SetBorderMode(0);
     174
     175    AppendPad("");
    174176
    175177    fHist->Draw(option);
     
    177179    DrawLegend();
    178180
    179     gPad->Modified();
    180     gPad->Update();
    181 }
    182 
    183 TObject *MHMcEnergy::DrawClone(Option_t *option) const
    184 {
    185     TCanvas *c = MH::MakeDefCanvas(fHist);
    186 
    187     //
    188     // This is necessary to get the expected bahviour of DrawClone
    189     //
    190     gROOT->SetSelectedPad(NULL);
    191 
    192     fHist->DrawClone(option);
    193 
    194     DrawLegend();
    195 
    196     c->Modified();
    197     c->Update();
    198 
    199     return c;
     181    pad->Modified();
     182    pad->Update();
    200183}
    201184
  • trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.h

    r1974 r2015  
    4949
    5050    void Draw(Option_t* option = "");
    51     TObject *DrawClone(Option_t* option = "") const;
    5251
    5352    void Print(Option_t* option = NULL) const;
  • trunk/MagicSoft/Mars/mhistmc/MHMcEnergyImpact.cc

    r1992 r2015  
    9393}
    9494
    95 //-------------------------------------------------------------------------
    96 //
    97 //  Defualt Destructor
    98 //
    99 MHMcEnergyImpact::~MHMcEnergyImpact()
    100 {
    101 }
    102 
    103 
    10495Bool_t MHMcEnergyImpact::SetupFill(const MParList *pList)
    10596{
     
    137128void MHMcEnergyImpact::Draw(Option_t *option)
    138129{
    139     if (!gPad)
    140         MH::MakeDefCanvas(&fHist);
     130    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
     131    pad->SetBorderMode(0);
    141132
    142     gPad->SetLogx();
     133    AppendPad("");
     134
     135    pad->SetLogx();
    143136
    144137    fHist.Draw(option);
    145138
    146     gPad->Modified();
    147     gPad->Update();
     139    pad->Modified();
     140    pad->Update();
    148141}
    149 
    150 TObject *MHMcEnergyImpact::DrawClone(Option_t *option) const
    151 {
    152     TCanvas *c = MH::MakeDefCanvas(&fHist);
    153 
    154     c->SetLogx();
    155 
    156     //
    157     // This is necessary to get the expected bahviour of DrawClone
    158     //
    159     gROOT->SetSelectedPad(NULL);
    160 
    161     ((TH2D&)fHist).DrawCopy(option);
    162 
    163     c->Modified();
    164     c->Update();
    165 
    166     return c;
    167 }
    168 
  • trunk/MagicSoft/Mars/mhistmc/MHMcEnergyImpact.h

    r1992 r2015  
    1818public:
    1919    MHMcEnergyImpact(const char *name=NULL, const char *title=NULL);
    20     ~MHMcEnergyImpact();
    2120
    2221    void SetName(const char *name);
     
    3231
    3332    void Draw(Option_t* option = "");
    34     TObject *DrawClone(Option_t* option = "") const;
    3533
    3634    ClassDef(MHMcEnergyImpact, 1)  // Histogram container for 2D histogram in Energy and Impact
  • trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.cc

    r1992 r2015  
    107107// --------------------------------------------------------------------------
    108108//
    109 // Draw a copy of the histogram
    110 //
    111 TObject *MHMcEnergyMigration::DrawClone(Option_t *opt) const
    112 {
    113     TCanvas &c = *MakeDefCanvas("EnergyMigration", "E-est vs. E-true");
    114 
    115     c.Divide(2, 2);
    116 
    117     gROOT->SetSelectedPad(NULL);
    118 
    119     TH1 *h;
    120 
    121     c.cd(1);
    122     h = ((TH3*)(&fHist))->Project3D("expro");
    123 
    124     h->SetTitle("Distribution of E-true");
    125     h->SetXTitle("E_{true} [GeV]");
    126     h->SetYTitle("Counts");
    127 
    128     h->Draw(opt);
    129     h->SetBit(kCanDelete);
    130     gPad->SetLogx();
    131 
    132 
    133     c.cd(2);
    134     h = ((TH3*)(&fHist))->Project3D("eypro");
    135 
    136     h->SetTitle("Distribution of E-est");
    137     h->SetXTitle("E_{est} [GeV]");
    138     h->SetYTitle("Counts");
    139 
    140     h->Draw(opt);
    141     h->SetBit(kCanDelete);
    142     gPad->SetLogx();
    143 
    144     c.cd(3);
    145     h = ((TH3*)(&fHist))->Project3D("ezpro");
    146 
    147     h->SetTitle("Distribution of Theta");
    148     h->SetXTitle("\\Theta [\\circ]");
    149     h->SetYTitle("Counts");
    150 
    151     h->Draw(opt);
    152     h->SetBit(kCanDelete);
    153 
    154 
    155     c.cd(4);
    156     ((TH3*)(&fHist))->DrawCopy(opt);
    157 
    158     c.Modified();
    159     c.Update();
    160 
    161     return &c;
    162 }
    163 
    164 // --------------------------------------------------------------------------
    165 //
    166109// Draw the histogram
    167110//
    168111void MHMcEnergyMigration::Draw(Option_t *opt)
    169112{
    170     if (!gPad)
    171         MakeDefCanvas("EnergyMigration", "E-est vs. E-true");
     113    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
     114    pad->SetBorderMode(0);
    172115
    173     gPad->Divide(2,2);
     116    AppendPad("");
     117
     118    pad->Divide(2,2);
    174119   
    175120    TH1 *h;
    176121
    177     gPad->cd(1);
     122    pad->cd(1);
     123    gPad->SetBorderMode(0);
     124    gPad->SetLogx();
    178125    h = fHist.Project3D("ex_pro");
    179 
    180     h->SetTitle("Distribution of E-true");
     126    h->SetTitle("Distribution of E_{true}");
    181127    h->SetXTitle("E_{true} [GeV]");
    182 
    183128    h->Draw(opt);
    184129    h->SetBit(kCanDelete);
     130
     131    pad->cd(2);
     132    gPad->SetBorderMode(0);
    185133    gPad->SetLogx();
    186 
    187 
    188     gPad->cd(2);
    189134    h = fHist.Project3D("ey_pro");
    190 
    191     h->SetTitle("Distribution of E-est");
     135    h->SetTitle("Distribution of E_{est}");
    192136    h->SetXTitle("E_{est} [GeV]");
    193137    h->Draw(opt);
    194138    h->SetBit(kCanDelete);
    195     gPad->SetLogx();
    196139
    197     gPad->cd(3);
     140    pad->cd(3);
     141    gPad->SetBorderMode(0);
    198142    h = fHist.Project3D("ez_pro");
    199 
    200     h->SetTitle("Distribution of Theta");
     143    h->SetTitle("Distribution of \\Theta");
    201144    h->SetXTitle("\\Theta [\\circ]");
    202145    h->Draw(opt);
    203146    h->SetBit(kCanDelete);
    204147
     148    pad->cd(4);
     149    gPad->SetBorderMode(0);
     150    fHist.Draw(opt);
    205151
    206     gPad->cd(4);
    207     fHist.DrawCopy(opt);
    208 
    209     gPad->Modified();
    210     gPad->Update();
     152    pad->Modified();
     153    pad->Update();
    211154}
    212155
  • trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.h

    r2010 r2015  
    3434
    3535    void Draw(Option_t *option="");
    36     TObject *DrawClone(Option_t *option="") const;
    3736
    3837    ClassDef(MHMcEnergyMigration, 1) //3D-histogram   E-true E-est Theta
  • trunk/MagicSoft/Mars/mhistmc/MHMcRate.cc

    r1974 r2015  
    2020!   Author(s): Abelardo Moralejo 2/2003
    2121!
    22 !   Explanations on the rate calculation can be found in
    23 !   chapter 7 of the following diploma thesis:
    24 !   http://www.pd.infn.it/magic/tesi2.ps.gz (in Italian)
    25 !
    2622!   Copyright: MAGIC Software Development, 2000-2001
    2723!
    2824!
    2925\* ======================================================================== */
     26
     27/////////////////////////////////////////////////////////////////////////////
     28//
     29//   Explanations on the rate calculation can be found in
     30//   chapter 7 of the following diploma thesis:
     31//   http://www.pd.infn.it/magic/tesi2.ps.gz (in Italian)
     32//
     33////////////////////////////////////////////////////////////////////////////
    3034
    3135#include "MHMcRate.h"
     
    251255}
    252256
    253 TObject *MHMcRate::DrawClone(Option_t *) const
    254 {
    255     *fLog << all << dbginf << " - MHMcRate::DrawClone: To be iplemented" << endl;
    256     return NULL;
    257 }
     257q
  • trunk/MagicSoft/Mars/mhistmc/MHMcRate.h

    r1974 r2015  
    1212    UShort_t fPartId;           // Type of particle
    1313
    14     Float_t fEnergyMax;         // Maximum Energy in TeV
    15     Float_t fEnergyMin;         // Minimum Energy in TeV
     14    Float_t fEnergyMax;         // Maximum Energy [TeV]
     15    Float_t fEnergyMin;         // Minimum Energy [TeV]
    1616
    17     Float_t fThetaMax;          // Maximum theta angle of run
    18     Float_t fThetaMin;          // Minimum theta angle of run
    19     Float_t fPhiMax;            // Maximum phi angle of run
    20     Float_t fPhiMin;            // Minimum phi angle of run
     17    Float_t fThetaMax;          // Maximum theta angle of run [?]
     18    Float_t fThetaMin;          // Minimum theta angle of run [?]
     19    Float_t fPhiMax;            // Maximum phi angle of run [?]
     20    Float_t fPhiMin;            // Minimum phi angle of run [?]
    2121
    22     Float_t fSolidAngle;        // Solid angle within which incident directions
    23                                 // are distributed (sr)
     22    Float_t fSolidAngle;        // Solid angle within which incident directions are distributed [sr]
    2423
    25     Float_t fImpactMax;         // Maximum impact parameter (cm)
    26     Float_t fImpactMin;         // Minimum impact parameter (cm)
     24    Float_t fImpactMax;         //[cm] Maximum impact parameter [cm]
     25    Float_t fImpactMin;         //[cm] Minimum impact parameter [cm]
    2726
    2827    Float_t fBackTrig;          // Number of triggers from background
     
    3837    Float_t fTriggerRateError;  // Estimated error for the trigger rate in Hz
    3938
    40     Float_t fMeanThreshold;     // Mean discriminator threshold (mV) of trigger
    41                                 // pixels.
     39    Float_t fMeanThreshold;     // Mean discriminator threshold of trigger pixels [mV]
    4240
    4341    Short_t fMultiplicity;      // L1 trigger multiplicity.
    4442
    45     Short_t fTriggerCondNum;    // Trigger condition number, for the case of
    46                                 // running over camra files containing several.
     43    Short_t fTriggerCondNum;    // Trigger condition number, for the case of running over camra files containing several.
    4744
    4845    void Init(const char *name, const char *title);
     
    9390
    9491    void Draw(Option_t *o=NULL);
    95     TObject *DrawClone(Option_t *o=NULL) const;
    9692
    9793    ClassDef(MHMcRate, 1)  // Data Container to calculate trigger rate
  • trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc

    r1976 r2015  
    226226// To disable redirction call SetLogStream(NULL)
    227227//
    228 void MStatusDisplay::SetLogStream(MLog *log)
     228// if enable==kFALSE the stdout is disabled/enabled. Otherwise stdout
     229// is ignored.
     230//
     231void MStatusDisplay::SetLogStream(MLog *log, Bool_t enable)
    229232{
    230233    if (log && fLogBox==NULL)
     
    256259
    257260        log->SetOutputGui(fLogBox, kTRUE);
    258         log->DisableOutputDevice(MLog::eStdout);
    259261        log->EnableOutputDevice(MLog::eGui);
     262        if (!enable)
     263            log->DisableOutputDevice(MLog::eStdout);
    260264
    261265        fLogTimer.Start();
     
    266270
    267271        fLog->DisableOutputDevice(MLog::eGui);
    268         fLog->EnableOutputDevice(MLog::eStdout);
    269272        fLog->SetOutputGui(NULL);
     273        if (!enable)
     274            fLog->EnableOutputDevice(MLog::eStdout);
    270275
    271276        fLog = &gLog;
     
    11341139        if (num<0)
    11351140            *fLog << inf << " - ";
    1136         *fLog << "Writing Tab #" << i << ": " << c->GetName() << " (" << n << ") ";
     1141        *fLog << inf << "Writing Tab #" << i << ": " << c->GetName() << " (" << n << ") ";
    11371142        if (num>0)
    11381143            *fLog << "to " << name;
  • trunk/MagicSoft/Mars/mmain/MStatusDisplay.h

    r1965 r2015  
    105105     virtual ~MStatusDisplay();
    106106
    107      void SetLogStream(MLog *log);
     107     void SetLogStream(MLog *log, Bool_t enable=kFALSE);
    108108
    109109     void StartUpdate(Int_t millisec=-1);
Note: See TracChangeset for help on using the changeset viewer.