Ignore:
Timestamp:
04/20/03 12:51:47 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc

    r1668 r1966  
    9595// --------------------------------------------------------------------------
    9696//
    97 // Draw a copy of the histogram
    98 //
    99 TObject *MHTimeDiffTime::DrawClone(Option_t *opt) const
    100 {
    101 
    102     TCanvas &c = *MakeDefCanvas("DiffTimeTime", "Distrib of dt and t");
    103 
    104     c.Divide(2, 2);
    105 
    106     gROOT->SetSelectedPad(NULL);
    107 
    108     TH1D *h;
    109 
    110     c.cd(1);
    111     h = ((TH2*)&fHist)->ProjectionX("ProjX-sumtime", -1, 9999, "E");
    112 
    113     h->SetTitle("Distribution of \\Delta t [s]");
    114     h->SetXTitle("\\Delta t [s]");
    115     h->SetYTitle("Counts");
    116 
    117     h->Draw(opt);
    118     h->SetBit(kCanDelete);
    119     gPad->SetLogy();
    120 
    121     c.cd(2);
    122     h = ((TH2*)&fHist)->ProjectionY("ProjY-sumtimediff", -1, 9999, "E");
    123 
    124     h->SetTitle("Distribution of time [s]");
    125     h->SetXTitle("time [s]");
    126     h->SetYTitle("Counts");
    127 
    128     h->Draw(opt);
    129     h->SetBit(kCanDelete);
    130 
    131     c.cd(3);
    132     ((TH2*)&fHist)->DrawCopy(opt);
    133 
    134     c.Modified();
    135     c.Update();
    136 
    137     return &c;
    138 }
    139 
    140 // --------------------------------------------------------------------------
    141 //
    14297// Draw the histogram
    14398//
    14499void MHTimeDiffTime::Draw(Option_t *opt)
    145100{
    146     if (!gPad)
    147         MakeDefCanvas("DiffTimeTime", "Distrib of \\Delta t, time");
     101    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
     102    pad->SetBorderMode(0);
    148103
    149     gPad->Divide(2,2);
     104    AppendPad("");
     105
     106    pad->Divide(2,2);
    150107
    151108    TH1D *h;
    152109
    153     gPad->cd(1);
     110    pad->cd(1);
     111    gPad->SetLogy();
    154112    h = fHist.ProjectionX("ProjX_sumtime", -1, 9999, "E");
    155 
    156113    h->SetTitle("Distribution of \\Delta t [s]");
    157114    h->SetXTitle("\\Delta t [s]");
    158115    h->SetYTitle("Counts");
    159 
    160116    h->Draw(opt);
    161117    h->SetBit(kCanDelete);
    162     gPad->SetLogy();
    163118
    164     gPad->cd(2);
     119    pad->cd(2);
    165120    h = fHist.ProjectionY("ProjY_sumtimediff", -1, 9999, "E");
    166 
    167121    h->SetTitle("Distribution of time [s]");
    168122    h->SetXTitle("time [s]");
    169123    h->SetYTitle("Counts");
    170 
    171124    h->Draw(opt);
    172125    h->SetBit(kCanDelete);
    173126
    174     gPad->cd(3);
     127    pad->cd(3);
    175128    fHist.DrawCopy(opt);
    176129
    177     gPad->Modified();
    178     gPad->Update();
    179 
     130    pad->Modified();
     131    pad->Update();
    180132}
    181133
Note: See TracChangeset for help on using the changeset viewer.